curl --request POST \
--url https://api.moonpay.com/platform/v1/quotes/buy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source": {
"asset": {
"code": "<string>"
},
"amount": "<string>"
},
"destination": {
"asset": {
"code": "<string>",
"caip19": "<string>"
},
"amount": "<string>"
},
"feeBehavior": "inclusive"
}
'import requests
url = "https://api.moonpay.com/platform/v1/quotes/buy"
payload = {
"source": {
"asset": { "code": "<string>" },
"amount": "<string>"
},
"destination": {
"asset": {
"code": "<string>",
"caip19": "<string>"
},
"amount": "<string>"
},
"feeBehavior": "inclusive"
}
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({
source: {asset: {code: '<string>'}, amount: '<string>'},
destination: {asset: {code: '<string>', caip19: '<string>'}, amount: '<string>'},
feeBehavior: 'inclusive'
})
};
fetch('https://api.moonpay.com/platform/v1/quotes/buy', 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.moonpay.com/platform/v1/quotes/buy",
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([
'source' => [
'asset' => [
'code' => '<string>'
],
'amount' => '<string>'
],
'destination' => [
'asset' => [
'code' => '<string>',
'caip19' => '<string>'
],
'amount' => '<string>'
],
'feeBehavior' => 'inclusive'
]),
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.moonpay.com/platform/v1/quotes/buy"
payload := strings.NewReader("{\n \"source\": {\n \"asset\": {\n \"code\": \"<string>\"\n },\n \"amount\": \"<string>\"\n },\n \"destination\": {\n \"asset\": {\n \"code\": \"<string>\",\n \"caip19\": \"<string>\"\n },\n \"amount\": \"<string>\"\n },\n \"feeBehavior\": \"inclusive\"\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.moonpay.com/platform/v1/quotes/buy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source\": {\n \"asset\": {\n \"code\": \"<string>\"\n },\n \"amount\": \"<string>\"\n },\n \"destination\": {\n \"asset\": {\n \"code\": \"<string>\",\n \"caip19\": \"<string>\"\n },\n \"amount\": \"<string>\"\n },\n \"feeBehavior\": \"inclusive\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moonpay.com/platform/v1/quotes/buy")
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 \"source\": {\n \"asset\": {\n \"code\": \"<string>\"\n },\n \"amount\": \"<string>\"\n },\n \"destination\": {\n \"asset\": {\n \"code\": \"<string>\",\n \"caip19\": \"<string>\"\n },\n \"amount\": \"<string>\"\n },\n \"feeBehavior\": \"inclusive\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"source": {
"amount": "<string>",
"asset": {
"code": "<string>",
"name": "<string>",
"precision": 123
}
},
"destination": {
"amount": "<string>",
"asset": {
"code": "<string>",
"name": "<string>",
"precision": 123,
"caip19": "<string>"
}
},
"fees": {
"network": {
"amount": "<string>",
"asset": {
"code": "<string>"
}
},
"moonpay": {
"amount": "<string>",
"asset": {
"code": "<string>"
}
},
"ecosystem": {
"amount": "<string>",
"asset": {
"code": "<string>"
}
},
"defi": {
"amount": "<string>",
"asset": {
"code": "<string>"
}
},
"partner": {
"amount": "<string>",
"asset": {
"code": "<string>"
}
}
},
"wallet": {
"address": "0x1234567890123456789012345678901234567890"
},
"paymentMethod": {
"id": "<string>"
},
"limits": {
"daily": {
"limit": {
"amount": "<string>",
"asset": {
"code": "<string>"
}
},
"remaining": {
"amount": "<string>",
"asset": {
"code": "<string>"
}
}
},
"monthly": {
"limit": {
"amount": "<string>",
"asset": {
"code": "<string>"
}
},
"remaining": {
"amount": "<string>",
"asset": {
"code": "<string>"
}
}
},
"yearly": {
"limit": {
"amount": "<string>",
"asset": {
"code": "<string>"
}
},
"remaining": {
"amount": "<string>",
"asset": {
"code": "<string>"
}
}
}
},
"expiresAt": "2023-11-07T05:31:56Z",
"executable": true,
"exchangeRate": "<string>",
"paymentDisclosures": [
{
"version": "<string>"
}
],
"signature": "<string>",
"slippageBps": 123
}
}{
"message": "<string>",
"errors": [
{
"message": "<string>",
"field": "<string>",
"details": {}
}
]
}{
"code": "unauthorized",
"message": "Not authorized"
}{
"code": "forbidden",
"message": "Forbidden"
}Get a quote
Build quotes for fiat->crypto transactions
curl --request POST \
--url https://api.moonpay.com/platform/v1/quotes/buy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source": {
"asset": {
"code": "<string>"
},
"amount": "<string>"
},
"destination": {
"asset": {
"code": "<string>",
"caip19": "<string>"
},
"amount": "<string>"
},
"feeBehavior": "inclusive"
}
'import requests
url = "https://api.moonpay.com/platform/v1/quotes/buy"
payload = {
"source": {
"asset": { "code": "<string>" },
"amount": "<string>"
},
"destination": {
"asset": {
"code": "<string>",
"caip19": "<string>"
},
"amount": "<string>"
},
"feeBehavior": "inclusive"
}
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({
source: {asset: {code: '<string>'}, amount: '<string>'},
destination: {asset: {code: '<string>', caip19: '<string>'}, amount: '<string>'},
feeBehavior: 'inclusive'
})
};
fetch('https://api.moonpay.com/platform/v1/quotes/buy', 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.moonpay.com/platform/v1/quotes/buy",
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([
'source' => [
'asset' => [
'code' => '<string>'
],
'amount' => '<string>'
],
'destination' => [
'asset' => [
'code' => '<string>',
'caip19' => '<string>'
],
'amount' => '<string>'
],
'feeBehavior' => 'inclusive'
]),
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.moonpay.com/platform/v1/quotes/buy"
payload := strings.NewReader("{\n \"source\": {\n \"asset\": {\n \"code\": \"<string>\"\n },\n \"amount\": \"<string>\"\n },\n \"destination\": {\n \"asset\": {\n \"code\": \"<string>\",\n \"caip19\": \"<string>\"\n },\n \"amount\": \"<string>\"\n },\n \"feeBehavior\": \"inclusive\"\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.moonpay.com/platform/v1/quotes/buy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source\": {\n \"asset\": {\n \"code\": \"<string>\"\n },\n \"amount\": \"<string>\"\n },\n \"destination\": {\n \"asset\": {\n \"code\": \"<string>\",\n \"caip19\": \"<string>\"\n },\n \"amount\": \"<string>\"\n },\n \"feeBehavior\": \"inclusive\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moonpay.com/platform/v1/quotes/buy")
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 \"source\": {\n \"asset\": {\n \"code\": \"<string>\"\n },\n \"amount\": \"<string>\"\n },\n \"destination\": {\n \"asset\": {\n \"code\": \"<string>\",\n \"caip19\": \"<string>\"\n },\n \"amount\": \"<string>\"\n },\n \"feeBehavior\": \"inclusive\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"source": {
"amount": "<string>",
"asset": {
"code": "<string>",
"name": "<string>",
"precision": 123
}
},
"destination": {
"amount": "<string>",
"asset": {
"code": "<string>",
"name": "<string>",
"precision": 123,
"caip19": "<string>"
}
},
"fees": {
"network": {
"amount": "<string>",
"asset": {
"code": "<string>"
}
},
"moonpay": {
"amount": "<string>",
"asset": {
"code": "<string>"
}
},
"ecosystem": {
"amount": "<string>",
"asset": {
"code": "<string>"
}
},
"defi": {
"amount": "<string>",
"asset": {
"code": "<string>"
}
},
"partner": {
"amount": "<string>",
"asset": {
"code": "<string>"
}
}
},
"wallet": {
"address": "0x1234567890123456789012345678901234567890"
},
"paymentMethod": {
"id": "<string>"
},
"limits": {
"daily": {
"limit": {
"amount": "<string>",
"asset": {
"code": "<string>"
}
},
"remaining": {
"amount": "<string>",
"asset": {
"code": "<string>"
}
}
},
"monthly": {
"limit": {
"amount": "<string>",
"asset": {
"code": "<string>"
}
},
"remaining": {
"amount": "<string>",
"asset": {
"code": "<string>"
}
}
},
"yearly": {
"limit": {
"amount": "<string>",
"asset": {
"code": "<string>"
}
},
"remaining": {
"amount": "<string>",
"asset": {
"code": "<string>"
}
}
}
},
"expiresAt": "2023-11-07T05:31:56Z",
"executable": true,
"exchangeRate": "<string>",
"paymentDisclosures": [
{
"version": "<string>"
}
],
"signature": "<string>",
"slippageBps": 123
}
}{
"message": "<string>",
"errors": [
{
"message": "<string>",
"field": "<string>",
"details": {}
}
]
}{
"code": "unauthorized",
"message": "Not authorized"
}{
"code": "forbidden",
"message": "Forbidden"
}404, see
Capability
enablement.Identifying the destination token
The destination crypto asset is identified differently depending on whether it is a centralised (CeFi) or DeFi token:- CeFi assets — pass
destination.code(e.g.ETH,USDC_SOL). - DeFi tokens — pass
destination.caip19, the CAIP-19 identifier returned by the list assets endpoint. A DeFi token’scodeis not unique, socaip19is required to disambiguate it.
caip19 takes precedence.Authorizations
Bearer authentication header using an access token.
Example: Authorization: Bearer <accessToken>
Body
Source asset in fiat. Amount can be set in source or destination.
Show child attributes
Show child attributes
{
"amount": "100.02",
"asset": { "code": "USD" }
}
Destination asset in crypto. Amount can be set in destination or source. For DeFi tokens, identify the asset by caip19 and set the amount on source only (quoting by destination token amount is not supported).
Show child attributes
Show child attributes
Wallet address and optional tag where the crypto will be sent. Required for the quote to be executable.
Show child attributes
Show child attributes
{
"address": "0x1234567890123456789012345678901234567890"
}
Payment method for the transaction. Required for the quote to be executable.
Show child attributes
Show child attributes
Whether MoonPay fees are included in source.amount (inclusive) or added on top of it (exclusive). Defaults to inclusive. Only applies when quoting by source.amount; ignored when destination.amount is provided.
inclusive, exclusive Response
The request has succeeded.
Quote for a fiat-to-crypto buy. Contains locked rate, fees, expiry, and signature for payment execution.
Show child attributes
Show child attributes
{
"source": {
"amount": "100.00",
"asset": { "code": "USD" }
},
"destination": {
"amount": "31250.0",
"asset": {
"caip19": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:2zMMhcVQEXDtdE6vsFS7S7D5oUodfJHE8vd1gnBouauv",
"code": "PENGU",
"name": "Pudgy Penguins",
"precision": 6
}
},
"fees": {
"network": {
"amount": "2.39",
"asset": { "code": "USD" }
},
"moonpay": {
"amount": "4.99",
"asset": { "code": "USD" }
},
"ecosystem": {
"amount": "1.00",
"asset": { "code": "USD" }
},
"defi": {
"amount": "1.00",
"asset": { "code": "USD" }
}
},
"wallet": {
"address": "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"
},
"paymentMethod": { "type": "apple_pay" },
"feeBehavior": "inclusive",
"limits": null,
"expiresAt": "2026-03-27T12:30:00.000Z",
"executable": true,
"exchangeRate": "0.0032",
"slippageBps": 50,
"paymentDisclosures": [{ "id": "gateway-token", "version": "1" }],
"signature": "cXVvdGUuc2lnbmF0dXJl..."
}
{
"source": {
"amount": "100.00",
"asset": { "code": "USD" }
},
"destination": {
"amount": "0.00114",
"asset": { "code": "BTC" }
},
"fees": {
"network": {
"amount": "2.39",
"asset": { "code": "USD" }
},
"moonpay": {
"amount": "4.99",
"asset": { "code": "USD" }
},
"ecosystem": {
"amount": "1.00",
"asset": { "code": "USD" }
}
},
"wallet": {
"address": "0x1234567890123456789012345678901234567890"
},
"paymentMethod": { "type": "apple_pay" },
"feeBehavior": "inclusive",
"limits": null,
"expiresAt": "2026-03-27T12:30:00.000Z",
"executable": true,
"exchangeRate": "87523.17",
"paymentDisclosures": [
{
"id": "eea-crypto-asset-risk",
"version": "1"
}
],
"signature": "cXVvdGUuc2lnbmF0dXJl..."
}