curl --request POST \
--url https://staging.crossmint.com/api/2022-06-09/orders \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"payment": {
"method": "card",
"receiptEmail": "jsmith@example.com"
},
"lineItems": [
{
"tokenLocator": "<string>",
"executionParameters": {
"amount": "<string>",
"maxSlippageBps": "<string>"
}
}
],
"recipient": {
"walletAddress": "<string>"
},
"state": "create"
}
'import requests
url = "https://staging.crossmint.com/api/2022-06-09/orders"
payload = {
"payment": {
"method": "card",
"receiptEmail": "jsmith@example.com"
},
"lineItems": [
{
"tokenLocator": "<string>",
"executionParameters": {
"amount": "<string>",
"maxSlippageBps": "<string>"
}
}
],
"recipient": { "walletAddress": "<string>" },
"state": "create"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
payment: {method: 'card', receiptEmail: 'jsmith@example.com'},
lineItems: [
{
tokenLocator: '<string>',
executionParameters: {amount: '<string>', maxSlippageBps: '<string>'}
}
],
recipient: {walletAddress: '<string>'},
state: 'create'
})
};
fetch('https://staging.crossmint.com/api/2022-06-09/orders', 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://staging.crossmint.com/api/2022-06-09/orders",
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([
'payment' => [
'method' => 'card',
'receiptEmail' => 'jsmith@example.com'
],
'lineItems' => [
[
'tokenLocator' => '<string>',
'executionParameters' => [
'amount' => '<string>',
'maxSlippageBps' => '<string>'
]
]
],
'recipient' => [
'walletAddress' => '<string>'
],
'state' => 'create'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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://staging.crossmint.com/api/2022-06-09/orders"
payload := strings.NewReader("{\n \"payment\": {\n \"method\": \"card\",\n \"receiptEmail\": \"jsmith@example.com\"\n },\n \"lineItems\": [\n {\n \"tokenLocator\": \"<string>\",\n \"executionParameters\": {\n \"amount\": \"<string>\",\n \"maxSlippageBps\": \"<string>\"\n }\n }\n ],\n \"recipient\": {\n \"walletAddress\": \"<string>\"\n },\n \"state\": \"create\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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://staging.crossmint.com/api/2022-06-09/orders")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"payment\": {\n \"method\": \"card\",\n \"receiptEmail\": \"jsmith@example.com\"\n },\n \"lineItems\": [\n {\n \"tokenLocator\": \"<string>\",\n \"executionParameters\": {\n \"amount\": \"<string>\",\n \"maxSlippageBps\": \"<string>\"\n }\n }\n ],\n \"recipient\": {\n \"walletAddress\": \"<string>\"\n },\n \"state\": \"create\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.crossmint.com/api/2022-06-09/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payment\": {\n \"method\": \"card\",\n \"receiptEmail\": \"jsmith@example.com\"\n },\n \"lineItems\": [\n {\n \"tokenLocator\": \"<string>\",\n \"executionParameters\": {\n \"amount\": \"<string>\",\n \"maxSlippageBps\": \"<string>\"\n }\n }\n ],\n \"recipient\": {\n \"walletAddress\": \"<string>\"\n },\n \"state\": \"create\"\n}"
response = http.request(request)
puts response.read_body{
"clientSecret": "_removed_",
"order": {
"orderId": "b2959ca5-65e4-466a-bd26-1bd05cb4f837",
"phase": "payment",
"lineItems": [
{
"chain": "solana",
"metadata": {
"name": "USDC",
"description": "USDC Token",
"imageUrl": "https://cryptologos.cc/logos/usd-coin-usdc-logo.svg"
},
"quote": {
"status": "valid",
"charges": {
"unit": {
"amount": "1.47",
"currency": "usd"
}
},
"totalPrice": {
"amount": "5",
"currency": "usd"
}
},
"executionMode": "exact-in",
"executionParams": {
"mode": "exact-in",
"amount": "5"
}
}
],
"quote": {
"status": "valid",
"quotedAt": "2025-03-07T23:04:11.996Z",
"expiresAt": "2025-03-07T23:14:11.996Z",
"totalPrice": {
"amount": "5",
"currency": "usd"
}
},
"payment": {
"status": "requires-kyc",
"method": "card",
"currency": "usd",
"preparation": {
"kyc": {
"provider": "persona",
"inquiryId": "inq_example-inquiry-id",
"sessionToken": "<string>",
"environmentId": "<string>"
}
}
}
}
}{
"error": true,
"message": "<string>",
"code": "<string>"
}{
"error": true,
"message": "Malformed API key. / API key provided doesn't have required scopes."
}{
"error": true,
"message": "Not found"
}{
"error": true,
"message": "Please try again in a few minutes. If the issue still persists, contact Crossmint support."
}{
"error": true,
"message": "A timeout occurred."
}Create Order
Creates an onramp order to buy tokens with a card. The order returns a payment intent that the buyer completes to receive tokens in the specified wallet.
curl --request POST \
--url https://staging.crossmint.com/api/2022-06-09/orders \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"payment": {
"method": "card",
"receiptEmail": "jsmith@example.com"
},
"lineItems": [
{
"tokenLocator": "<string>",
"executionParameters": {
"amount": "<string>",
"maxSlippageBps": "<string>"
}
}
],
"recipient": {
"walletAddress": "<string>"
},
"state": "create"
}
'import requests
url = "https://staging.crossmint.com/api/2022-06-09/orders"
payload = {
"payment": {
"method": "card",
"receiptEmail": "jsmith@example.com"
},
"lineItems": [
{
"tokenLocator": "<string>",
"executionParameters": {
"amount": "<string>",
"maxSlippageBps": "<string>"
}
}
],
"recipient": { "walletAddress": "<string>" },
"state": "create"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
payment: {method: 'card', receiptEmail: 'jsmith@example.com'},
lineItems: [
{
tokenLocator: '<string>',
executionParameters: {amount: '<string>', maxSlippageBps: '<string>'}
}
],
recipient: {walletAddress: '<string>'},
state: 'create'
})
};
fetch('https://staging.crossmint.com/api/2022-06-09/orders', 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://staging.crossmint.com/api/2022-06-09/orders",
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([
'payment' => [
'method' => 'card',
'receiptEmail' => 'jsmith@example.com'
],
'lineItems' => [
[
'tokenLocator' => '<string>',
'executionParameters' => [
'amount' => '<string>',
'maxSlippageBps' => '<string>'
]
]
],
'recipient' => [
'walletAddress' => '<string>'
],
'state' => 'create'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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://staging.crossmint.com/api/2022-06-09/orders"
payload := strings.NewReader("{\n \"payment\": {\n \"method\": \"card\",\n \"receiptEmail\": \"jsmith@example.com\"\n },\n \"lineItems\": [\n {\n \"tokenLocator\": \"<string>\",\n \"executionParameters\": {\n \"amount\": \"<string>\",\n \"maxSlippageBps\": \"<string>\"\n }\n }\n ],\n \"recipient\": {\n \"walletAddress\": \"<string>\"\n },\n \"state\": \"create\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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://staging.crossmint.com/api/2022-06-09/orders")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"payment\": {\n \"method\": \"card\",\n \"receiptEmail\": \"jsmith@example.com\"\n },\n \"lineItems\": [\n {\n \"tokenLocator\": \"<string>\",\n \"executionParameters\": {\n \"amount\": \"<string>\",\n \"maxSlippageBps\": \"<string>\"\n }\n }\n ],\n \"recipient\": {\n \"walletAddress\": \"<string>\"\n },\n \"state\": \"create\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.crossmint.com/api/2022-06-09/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payment\": {\n \"method\": \"card\",\n \"receiptEmail\": \"jsmith@example.com\"\n },\n \"lineItems\": [\n {\n \"tokenLocator\": \"<string>\",\n \"executionParameters\": {\n \"amount\": \"<string>\",\n \"maxSlippageBps\": \"<string>\"\n }\n }\n ],\n \"recipient\": {\n \"walletAddress\": \"<string>\"\n },\n \"state\": \"create\"\n}"
response = http.request(request)
puts response.read_body{
"clientSecret": "_removed_",
"order": {
"orderId": "b2959ca5-65e4-466a-bd26-1bd05cb4f837",
"phase": "payment",
"lineItems": [
{
"chain": "solana",
"metadata": {
"name": "USDC",
"description": "USDC Token",
"imageUrl": "https://cryptologos.cc/logos/usd-coin-usdc-logo.svg"
},
"quote": {
"status": "valid",
"charges": {
"unit": {
"amount": "1.47",
"currency": "usd"
}
},
"totalPrice": {
"amount": "5",
"currency": "usd"
}
},
"executionMode": "exact-in",
"executionParams": {
"mode": "exact-in",
"amount": "5"
}
}
],
"quote": {
"status": "valid",
"quotedAt": "2025-03-07T23:04:11.996Z",
"expiresAt": "2025-03-07T23:14:11.996Z",
"totalPrice": {
"amount": "5",
"currency": "usd"
}
},
"payment": {
"status": "requires-kyc",
"method": "card",
"currency": "usd",
"preparation": {
"kyc": {
"provider": "persona",
"inquiryId": "inq_example-inquiry-id",
"sessionToken": "<string>",
"environmentId": "<string>"
}
}
}
}
}{
"error": true,
"message": "<string>",
"code": "<string>"
}{
"error": true,
"message": "Malformed API key. / API key provided doesn't have required scopes."
}{
"error": true,
"message": "Not found"
}{
"error": true,
"message": "Please try again in a few minutes. If the issue still persists, contact Crossmint support."
}{
"error": true,
"message": "A timeout occurred."
}Authorizations
Body
Payment configuration for the onramp order. Onramp is completed with a card.
Show child attributes
Show child attributes
The tokens to purchase. Provide a single line item identifying the token and the amount to spend.
1 elementShow child attributes
Show child attributes
Recipient of the tokens being purchased. Provide either walletAddress or email, not both. When an email is provided, Crossmint creates a custodial wallet for the user that they can later log in to.
- Wallet
- Email
Show child attributes
Show child attributes
Determines whether an order is officially created or whether it simply returns what an order would look like. Use draft to review the quote prior to committing. Draft orders are not persisted and will not be queryable via APIs. Use create (default) to place the order and proceed to payment.
draft, create Was this page helpful?

