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>"
}
'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>"
}
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>'
})
};
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>'
]),
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}")
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}")
.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}"
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"
}
]
}
},
"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
Creates an onramp quote — a short-lived, priced offer to convert fiat into the
crypto held by the wallet identified by wallet_id.
source_currency is the fiat being paid in (e.g. NGN); the wallet’s own currency
(e.g. USDC) is the destination. source_network is the fiat rail (e.g. bank,
mobile_money). destination_network is optional — when omitted it is derived from
the wallet’s newest active credential, defaulting to solana when the wallet has no
active credential; when supplied it must be a network the wallet currency supports.
country_code (optional, ISO 3166-1 alpha-2, e.g. NG) disambiguates
source_currency when the same code is supported in multiple countries. If the code
is only supported in one country, country_code can be omitted. If the code is
supported in two or more countries and country_code is omitted, the request is
rejected with a 400 listing the available countries. country_code no longer needs
to match the customer’s registered country — the payer may transact from a country
other than their KYC country.
phone_number (optional, international/E.164 format) and provider_id (optional,
a prov_… id) are accepted. When source_network is mobile_money, a payer phone
must be resolvable — either phone_number is supplied or the customer has a phone on
their profile — and provider_id is required.
full_name (optional, 2–128 characters) is the full name of the phone owner. It is
required when source_network is mobile_money and either phone_number is
supplied on the request (the phone owner may differ from the customer) or the
customer is a business (whose sender payload otherwise carries no individual name).
full_name is stored on the quote’s metadata under fullName and forwarded to the
payout rail as the sender name. Supplying full_name on a non-mobile-money onramp
is rejected with a 400.
reference is optional and echoed back as the quote reference.
Specify either source_amount (the fiat amount paid in) or target_amount
(the crypto amount the recipient receives) — exactly one, each a positive decimal
string. Providing both, or neither, is rejected with a 400. When target_amount is
supplied, we compute and return the required source_amount on the quote.
The quote is created with status: active and an expires_at in the near future.
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>"
}
'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>"
}
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>'
})
};
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>'
]),
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}")
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}")
.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}"
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"
}
]
}
},
"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"
}
}Authorizations
API key issued during merchant onboarding.
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
64^[A-Z0-9]{2,8}$mobile_money, bank, solana, base, ethereum ^[A-Z]{2}$^\d+(\.\d+)?$Destination amount the recipient receives, as a decimal string. Provide exactly one of source_amount or target_amount.
^\d+(\.\d+)?$"6.05"
mobile_money, bank, solana, base, ethereum ^\+[1-9]\d{6,14}$642 - 128128Response
Quote created successfully