curl --request POST \
--url https://api.globalstack.io/v1/onramps/quotes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"wallet_id": "<string>",
"source_currency": "<string>",
"country_code": "<string>",
"source_amount": "<string>",
"target_amount": "6.05",
"phone_number": "<string>",
"provider_id": "<string>",
"full_name": "<string>",
"reference": "<string>",
"split_code": "<string>"
}
'import requests
url = "https://api.globalstack.io/v1/onramps/quotes"
payload = {
"wallet_id": "<string>",
"source_currency": "<string>",
"country_code": "<string>",
"source_amount": "<string>",
"target_amount": "6.05",
"phone_number": "<string>",
"provider_id": "<string>",
"full_name": "<string>",
"reference": "<string>",
"split_code": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
wallet_id: '<string>',
source_currency: '<string>',
country_code: '<string>',
source_amount: '<string>',
target_amount: '6.05',
phone_number: '<string>',
provider_id: '<string>',
full_name: '<string>',
reference: '<string>',
split_code: '<string>'
})
};
fetch('https://api.globalstack.io/v1/onramps/quotes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.globalstack.io/v1/onramps/quotes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'wallet_id' => '<string>',
'source_currency' => '<string>',
'country_code' => '<string>',
'source_amount' => '<string>',
'target_amount' => '6.05',
'phone_number' => '<string>',
'provider_id' => '<string>',
'full_name' => '<string>',
'reference' => '<string>',
'split_code' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.globalstack.io/v1/onramps/quotes"
payload := strings.NewReader("{\n \"wallet_id\": \"<string>\",\n \"source_currency\": \"<string>\",\n \"country_code\": \"<string>\",\n \"source_amount\": \"<string>\",\n \"target_amount\": \"6.05\",\n \"phone_number\": \"<string>\",\n \"provider_id\": \"<string>\",\n \"full_name\": \"<string>\",\n \"reference\": \"<string>\",\n \"split_code\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.globalstack.io/v1/onramps/quotes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"wallet_id\": \"<string>\",\n \"source_currency\": \"<string>\",\n \"country_code\": \"<string>\",\n \"source_amount\": \"<string>\",\n \"target_amount\": \"6.05\",\n \"phone_number\": \"<string>\",\n \"provider_id\": \"<string>\",\n \"full_name\": \"<string>\",\n \"reference\": \"<string>\",\n \"split_code\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.globalstack.io/v1/onramps/quotes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"wallet_id\": \"<string>\",\n \"source_currency\": \"<string>\",\n \"country_code\": \"<string>\",\n \"source_amount\": \"<string>\",\n \"target_amount\": \"6.05\",\n \"phone_number\": \"<string>\",\n \"provider_id\": \"<string>\",\n \"full_name\": \"<string>\",\n \"reference\": \"<string>\",\n \"split_code\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Quote created successfully",
"code": "ok",
"data": {
"id": "quo_01KPBK123456789ABCDEFG",
"operation": "onramp",
"status": "active",
"wallet_id": "wal_seed_alice_usdc",
"customer_id": "cust_01HXYZABC1234567890ABCDEFG",
"source_amount": "10000.00",
"source_currency": "NGN",
"destination_amount": "6.046600",
"destination_currency": "USDC",
"rate": "0.000605",
"expires_at": "2026-04-22T02:30:00.000Z",
"created_at": "2026-04-22T02:00:00.000Z",
"updated_at": "2026-04-22T02:00:00.000Z",
"reference": "INV-2026-001",
"destination_wallet_id": "wal_seed_alice_ngn",
"received_amount": "6.046600",
"fee": {
"line_items": [
{
"name": "gateway",
"amount": "100",
"currency": "NGN"
},
{
"name": "network",
"amount": "0.5",
"currency": "USDC"
}
]
},
"split": {
"type": "percentage",
"fee_bearer": "merchant",
"shares": [
{
"wallet_id": "wal_01HXYZ",
"percentage": "60.00",
"amount": "10.000000"
}
],
"split_id": "spl_01HXYZ"
}
},
"meta": {
"request_id": "req_01HXYZ4K5ABCDEFGHJKLMNPQRS",
"timestamp": "2026-05-14T15:43:55.732Z",
"version": "1"
}
}{
"status": false,
"message": "Resource not found",
"code": "not_found",
"data": null,
"meta": {
"next_steps": {
"action": "Verify the resource identifier and retry.",
"docs_url": "https://docs.globalstack.io/errors#not_found"
},
"request_id": "req_01HXYZ4K5ABCDEFGHJKLMNPQRS",
"timestamp": "2026-05-14T15:43:55.732Z",
"version": "1"
}
}{
"status": false,
"message": "Resource not found",
"code": "not_found",
"data": null,
"meta": {
"next_steps": {
"action": "Verify the resource identifier and retry.",
"docs_url": "https://docs.globalstack.io/errors#not_found"
},
"request_id": "req_01HXYZ4K5ABCDEFGHJKLMNPQRS",
"timestamp": "2026-05-14T15:43:55.732Z",
"version": "1"
}
}{
"status": false,
"message": "Resource not found",
"code": "not_found",
"data": null,
"meta": {
"next_steps": {
"action": "Verify the resource identifier and retry.",
"docs_url": "https://docs.globalstack.io/errors#not_found"
},
"request_id": "req_01HXYZ4K5ABCDEFGHJKLMNPQRS",
"timestamp": "2026-05-14T15:43:55.732Z",
"version": "1"
}
}{
"status": false,
"message": "Resource not found",
"code": "not_found",
"data": null,
"meta": {
"next_steps": {
"action": "Verify the resource identifier and retry.",
"docs_url": "https://docs.globalstack.io/errors#not_found"
},
"request_id": "req_01HXYZ4K5ABCDEFGHJKLMNPQRS",
"timestamp": "2026-05-14T15:43:55.732Z",
"version": "1"
}
}{
"status": false,
"message": "Resource not found",
"code": "not_found",
"data": null,
"meta": {
"next_steps": {
"action": "Verify the resource identifier and retry.",
"docs_url": "https://docs.globalstack.io/errors#not_found"
},
"request_id": "req_01HXYZ4K5ABCDEFGHJKLMNPQRS",
"timestamp": "2026-05-14T15:43:55.732Z",
"version": "1"
}
}Create an onramp quote
Price an onramp: local currency paid in, credited as crypto to a wallet. The quote is active
until expires_at. Execute it with POST /v1/onramps before then.
Body
| Field | Required | Description |
|---|---|---|
wallet_id | Yes | The crypto wallet to credit. Its currency, e.g. USDC, is the destination. |
source_currency | Yes | The fiat being paid in, e.g. NGN. |
source_network | Yes | How it’s paid: bank or mobile_money. |
source_amount or target_amount | Yes | Send exactly one. Fiat paid in, or crypto to receive. Positive decimal strings. With target_amount, the quote returns the source_amount needed. |
country_code | No | Needed when source_currency exists in several countries. It doesn’t have to match the customer’s country. |
destination_network | No | The chain. Defaults to the wallet’s newest active credential, or solana if it has none. |
phone_number | No | The payer’s phone, in E.164 format. |
provider_id | No | Required for mobile money. The payer’s operator (prov_…). |
full_name | No | The phone owner’s name, 2–128 chars. Sometimes required for mobile money: see below. |
reference | No | Echoed back on the quote. |
split_code | No | A saved split to apply (spl_…). See Splits below. |
split | No | An inline split to apply. See Splits below. |
Mobile money
When source_network is mobile_money:
- A payer phone is required: either
phone_number, or a phone on the customer’s profile. provider_idis required.full_nameis required if you sendphone_number(the payer may not be the customer) or the customer is a business. It’s sent to the network as the sender name.
full_name on a non-mobile-money onramp is rejected.
Splits
Attach a split to share what the quote’s destination wallet receives between several wallets
(for example, a marketplace paying its sellers). Send either split_code, a saved split’s
id (spl_…, see POST /v1/splits), or split, the same object inline (type plus
shares). Not both.
- Recipients must be custodial wallets of your integration that hold the destination currency.
- The destination wallet must be custodial too, and must not be a recipient: it keeps the remainder.
percentageshares are percentages of the amount actually delivered.flatshares are fixed amounts and needtarget_amounton the quote; together they must not exceed it.- An inline
splitalso acceptsfee_bearer(merchantorall_proportional). An onramp delivers crypto, which carries no provider fee, so it changes nothing here. - The quote keeps a copy of the split, so editing or deactivating a saved split later never changes a quote that already uses it.
The split is applied when the deposit settles. If the delivered amount can’t cover a flat split,
or every share rounds to zero, nothing is split and the whole amount stays on the destination
wallet; the operation’s split.status is then skipped, with the reason.
Errors
| Status | Code | When |
|---|---|---|
| 400 | bad_request / invalid_input | Both or neither amount sent, an unsupported currency or network, an ambiguous currency without country_code, a missing mobile money field, or a customer profile missing a field the route needs. |
| 400 | invalid_input | Splits: both split_code and split sent, a non-custodial wallet, split wallets in a different currency from the destination wallet, the destination wallet listed as a recipient, an inactive saved split, a flat split without target_amount or above it; an inline split with a wallet listed twice, percentage on a flat split or amount on a percentage split, a zero value or too many decimals, or percentages adding up to more than 100. |
| 400 | bad_request | Splits: an inline split body that fails validation, e.g. fewer than 1 or more than 20 shares, or an unknown type. |
| 404 | not_found | Splits: an unknown split_code, or a share wallet that isn’t yours. |
Example
POST /v1/onramps/quotes
{
"wallet_id": "wal_01HXYZ…",
"source_currency": "NGN",
"source_network": "bank",
"source_amount": "50000"
}
curl --request POST \
--url https://api.globalstack.io/v1/onramps/quotes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"wallet_id": "<string>",
"source_currency": "<string>",
"country_code": "<string>",
"source_amount": "<string>",
"target_amount": "6.05",
"phone_number": "<string>",
"provider_id": "<string>",
"full_name": "<string>",
"reference": "<string>",
"split_code": "<string>"
}
'import requests
url = "https://api.globalstack.io/v1/onramps/quotes"
payload = {
"wallet_id": "<string>",
"source_currency": "<string>",
"country_code": "<string>",
"source_amount": "<string>",
"target_amount": "6.05",
"phone_number": "<string>",
"provider_id": "<string>",
"full_name": "<string>",
"reference": "<string>",
"split_code": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
wallet_id: '<string>',
source_currency: '<string>',
country_code: '<string>',
source_amount: '<string>',
target_amount: '6.05',
phone_number: '<string>',
provider_id: '<string>',
full_name: '<string>',
reference: '<string>',
split_code: '<string>'
})
};
fetch('https://api.globalstack.io/v1/onramps/quotes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.globalstack.io/v1/onramps/quotes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'wallet_id' => '<string>',
'source_currency' => '<string>',
'country_code' => '<string>',
'source_amount' => '<string>',
'target_amount' => '6.05',
'phone_number' => '<string>',
'provider_id' => '<string>',
'full_name' => '<string>',
'reference' => '<string>',
'split_code' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.globalstack.io/v1/onramps/quotes"
payload := strings.NewReader("{\n \"wallet_id\": \"<string>\",\n \"source_currency\": \"<string>\",\n \"country_code\": \"<string>\",\n \"source_amount\": \"<string>\",\n \"target_amount\": \"6.05\",\n \"phone_number\": \"<string>\",\n \"provider_id\": \"<string>\",\n \"full_name\": \"<string>\",\n \"reference\": \"<string>\",\n \"split_code\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.globalstack.io/v1/onramps/quotes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"wallet_id\": \"<string>\",\n \"source_currency\": \"<string>\",\n \"country_code\": \"<string>\",\n \"source_amount\": \"<string>\",\n \"target_amount\": \"6.05\",\n \"phone_number\": \"<string>\",\n \"provider_id\": \"<string>\",\n \"full_name\": \"<string>\",\n \"reference\": \"<string>\",\n \"split_code\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.globalstack.io/v1/onramps/quotes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"wallet_id\": \"<string>\",\n \"source_currency\": \"<string>\",\n \"country_code\": \"<string>\",\n \"source_amount\": \"<string>\",\n \"target_amount\": \"6.05\",\n \"phone_number\": \"<string>\",\n \"provider_id\": \"<string>\",\n \"full_name\": \"<string>\",\n \"reference\": \"<string>\",\n \"split_code\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Quote created successfully",
"code": "ok",
"data": {
"id": "quo_01KPBK123456789ABCDEFG",
"operation": "onramp",
"status": "active",
"wallet_id": "wal_seed_alice_usdc",
"customer_id": "cust_01HXYZABC1234567890ABCDEFG",
"source_amount": "10000.00",
"source_currency": "NGN",
"destination_amount": "6.046600",
"destination_currency": "USDC",
"rate": "0.000605",
"expires_at": "2026-04-22T02:30:00.000Z",
"created_at": "2026-04-22T02:00:00.000Z",
"updated_at": "2026-04-22T02:00:00.000Z",
"reference": "INV-2026-001",
"destination_wallet_id": "wal_seed_alice_ngn",
"received_amount": "6.046600",
"fee": {
"line_items": [
{
"name": "gateway",
"amount": "100",
"currency": "NGN"
},
{
"name": "network",
"amount": "0.5",
"currency": "USDC"
}
]
},
"split": {
"type": "percentage",
"fee_bearer": "merchant",
"shares": [
{
"wallet_id": "wal_01HXYZ",
"percentage": "60.00",
"amount": "10.000000"
}
],
"split_id": "spl_01HXYZ"
}
},
"meta": {
"request_id": "req_01HXYZ4K5ABCDEFGHJKLMNPQRS",
"timestamp": "2026-05-14T15:43:55.732Z",
"version": "1"
}
}{
"status": false,
"message": "Resource not found",
"code": "not_found",
"data": null,
"meta": {
"next_steps": {
"action": "Verify the resource identifier and retry.",
"docs_url": "https://docs.globalstack.io/errors#not_found"
},
"request_id": "req_01HXYZ4K5ABCDEFGHJKLMNPQRS",
"timestamp": "2026-05-14T15:43:55.732Z",
"version": "1"
}
}{
"status": false,
"message": "Resource not found",
"code": "not_found",
"data": null,
"meta": {
"next_steps": {
"action": "Verify the resource identifier and retry.",
"docs_url": "https://docs.globalstack.io/errors#not_found"
},
"request_id": "req_01HXYZ4K5ABCDEFGHJKLMNPQRS",
"timestamp": "2026-05-14T15:43:55.732Z",
"version": "1"
}
}{
"status": false,
"message": "Resource not found",
"code": "not_found",
"data": null,
"meta": {
"next_steps": {
"action": "Verify the resource identifier and retry.",
"docs_url": "https://docs.globalstack.io/errors#not_found"
},
"request_id": "req_01HXYZ4K5ABCDEFGHJKLMNPQRS",
"timestamp": "2026-05-14T15:43:55.732Z",
"version": "1"
}
}{
"status": false,
"message": "Resource not found",
"code": "not_found",
"data": null,
"meta": {
"next_steps": {
"action": "Verify the resource identifier and retry.",
"docs_url": "https://docs.globalstack.io/errors#not_found"
},
"request_id": "req_01HXYZ4K5ABCDEFGHJKLMNPQRS",
"timestamp": "2026-05-14T15:43:55.732Z",
"version": "1"
}
}{
"status": false,
"message": "Resource not found",
"code": "not_found",
"data": null,
"meta": {
"next_steps": {
"action": "Verify the resource identifier and retry.",
"docs_url": "https://docs.globalstack.io/errors#not_found"
},
"request_id": "req_01HXYZ4K5ABCDEFGHJKLMNPQRS",
"timestamp": "2026-05-14T15:43:55.732Z",
"version": "1"
}
}Headers
Optional client-supplied key. Identical key + identical body within 24h replays the original response. Identical key + different body returns 409 idempotency_conflict. The hash is over raw bytes — clients retrying must send the byte-identical body; a re-serialised JSON payload will produce a different hash and a 409. Strongly recommended for retry-safe clients.
^[A-Za-z0-9_\-]{8,255}$Body
CreateOnrampQuoteDto
Response
Quote created successfully