Create Order
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": {
"receiptEmail": "jsmith@example.com",
"payerAddress": "<string>"
},
"lineItems": {
"collectionLocator": "crossmint:<collectionId>",
"callData": {
"totalPrice": "<string>"
}
},
"recipient": {
"email": "jsmith@example.com"
},
"locale": "en-US"
}
'import requests
url = "https://staging.crossmint.com/api/2022-06-09/orders"
payload = {
"payment": {
"receiptEmail": "jsmith@example.com",
"payerAddress": "<string>"
},
"lineItems": {
"collectionLocator": "crossmint:<collectionId>",
"callData": { "totalPrice": "<string>" }
},
"recipient": { "email": "jsmith@example.com" },
"locale": "en-US"
}
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: {receiptEmail: 'jsmith@example.com', payerAddress: '<string>'},
lineItems: {
collectionLocator: 'crossmint:<collectionId>',
callData: {totalPrice: '<string>'}
},
recipient: {email: 'jsmith@example.com'},
locale: 'en-US'
})
};
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' => [
'receiptEmail' => 'jsmith@example.com',
'payerAddress' => '<string>'
],
'lineItems' => [
'collectionLocator' => 'crossmint:<collectionId>',
'callData' => [
'totalPrice' => '<string>'
]
],
'recipient' => [
'email' => 'jsmith@example.com'
],
'locale' => 'en-US'
]),
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 \"receiptEmail\": \"jsmith@example.com\",\n \"payerAddress\": \"<string>\"\n },\n \"lineItems\": {\n \"collectionLocator\": \"crossmint:<collectionId>\",\n \"callData\": {\n \"totalPrice\": \"<string>\"\n }\n },\n \"recipient\": {\n \"email\": \"jsmith@example.com\"\n },\n \"locale\": \"en-US\"\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 \"receiptEmail\": \"jsmith@example.com\",\n \"payerAddress\": \"<string>\"\n },\n \"lineItems\": {\n \"collectionLocator\": \"crossmint:<collectionId>\",\n \"callData\": {\n \"totalPrice\": \"<string>\"\n }\n },\n \"recipient\": {\n \"email\": \"jsmith@example.com\"\n },\n \"locale\": \"en-US\"\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 \"receiptEmail\": \"jsmith@example.com\",\n \"payerAddress\": \"<string>\"\n },\n \"lineItems\": {\n \"collectionLocator\": \"crossmint:<collectionId>\",\n \"callData\": {\n \"totalPrice\": \"<string>\"\n }\n },\n \"recipient\": {\n \"email\": \"jsmith@example.com\"\n },\n \"locale\": \"en-US\"\n}"
response = http.request(request)
puts response.read_body{
"clientSecret": "_removed_",
"order": {
"orderId": "b2959ca5-65e4-466a-bd26-1bd05cb4f837",
"phase": "payment",
"locale": "en-US",
"lineItems": [
{
"chain": "polygon-amoy",
"quantity": 1,
"callData": {
"quantity": 1,
"ADDITIONAL_PROPERTIES": "Your other mint function arguments"
},
"metadata": {
"name": "Headless Checkout Demo",
"description": "NFT Description",
"imageUrl": "https://cdn.io/image.png"
},
"quote": {
"status": "valid",
"charges": {
"unit": {
"amount": "0.0001",
"currency": "eth"
},
"salesTax": {
"amount": "0.34",
"currency": "usdc"
},
"shipping": {
"amount": "0",
"currency": "usdc"
}
},
"totalPrice": {
"amount": "0.0001",
"currency": "eth"
}
},
"delivery": {
"status": "awaiting-payment",
"recipient": {
"locator": "email:<email_address>:<chain>",
"email": "testy@crossmint.com",
"walletAddress": "0x1234abcd..."
}
}
}
],
"quote": {
"status": "valid",
"quotedAt": "2024-06-07T16:55:44.653Z",
"expiresAt": "2024-06-07T17:55:44.653Z",
"totalPrice": {
"amount": "0.0001375741",
"currency": "eth"
}
},
"payment": {
"status": "awaiting-payment",
"method": "base-sepolia",
"currency": "eth",
"preparation": {
"chain": "base-sepolia",
"payerAddress": "0x1234abcd...",
"serializedTransaction": "0x02f90....."
}
}
}
}{
"error": true,
"message": "Invalid arguments or empty parameter <missing parameter>."
}{
"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."
}Headless Checkout
Create Order
Creates a new order that can be used to complete a headless checkout.
API scope required: orders.create
POST
/
2022-06-09
/
orders
Create Order
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": {
"receiptEmail": "jsmith@example.com",
"payerAddress": "<string>"
},
"lineItems": {
"collectionLocator": "crossmint:<collectionId>",
"callData": {
"totalPrice": "<string>"
}
},
"recipient": {
"email": "jsmith@example.com"
},
"locale": "en-US"
}
'import requests
url = "https://staging.crossmint.com/api/2022-06-09/orders"
payload = {
"payment": {
"receiptEmail": "jsmith@example.com",
"payerAddress": "<string>"
},
"lineItems": {
"collectionLocator": "crossmint:<collectionId>",
"callData": { "totalPrice": "<string>" }
},
"recipient": { "email": "jsmith@example.com" },
"locale": "en-US"
}
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: {receiptEmail: 'jsmith@example.com', payerAddress: '<string>'},
lineItems: {
collectionLocator: 'crossmint:<collectionId>',
callData: {totalPrice: '<string>'}
},
recipient: {email: 'jsmith@example.com'},
locale: 'en-US'
})
};
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' => [
'receiptEmail' => 'jsmith@example.com',
'payerAddress' => '<string>'
],
'lineItems' => [
'collectionLocator' => 'crossmint:<collectionId>',
'callData' => [
'totalPrice' => '<string>'
]
],
'recipient' => [
'email' => 'jsmith@example.com'
],
'locale' => 'en-US'
]),
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 \"receiptEmail\": \"jsmith@example.com\",\n \"payerAddress\": \"<string>\"\n },\n \"lineItems\": {\n \"collectionLocator\": \"crossmint:<collectionId>\",\n \"callData\": {\n \"totalPrice\": \"<string>\"\n }\n },\n \"recipient\": {\n \"email\": \"jsmith@example.com\"\n },\n \"locale\": \"en-US\"\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 \"receiptEmail\": \"jsmith@example.com\",\n \"payerAddress\": \"<string>\"\n },\n \"lineItems\": {\n \"collectionLocator\": \"crossmint:<collectionId>\",\n \"callData\": {\n \"totalPrice\": \"<string>\"\n }\n },\n \"recipient\": {\n \"email\": \"jsmith@example.com\"\n },\n \"locale\": \"en-US\"\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 \"receiptEmail\": \"jsmith@example.com\",\n \"payerAddress\": \"<string>\"\n },\n \"lineItems\": {\n \"collectionLocator\": \"crossmint:<collectionId>\",\n \"callData\": {\n \"totalPrice\": \"<string>\"\n }\n },\n \"recipient\": {\n \"email\": \"jsmith@example.com\"\n },\n \"locale\": \"en-US\"\n}"
response = http.request(request)
puts response.read_body{
"clientSecret": "_removed_",
"order": {
"orderId": "b2959ca5-65e4-466a-bd26-1bd05cb4f837",
"phase": "payment",
"locale": "en-US",
"lineItems": [
{
"chain": "polygon-amoy",
"quantity": 1,
"callData": {
"quantity": 1,
"ADDITIONAL_PROPERTIES": "Your other mint function arguments"
},
"metadata": {
"name": "Headless Checkout Demo",
"description": "NFT Description",
"imageUrl": "https://cdn.io/image.png"
},
"quote": {
"status": "valid",
"charges": {
"unit": {
"amount": "0.0001",
"currency": "eth"
},
"salesTax": {
"amount": "0.34",
"currency": "usdc"
},
"shipping": {
"amount": "0",
"currency": "usdc"
}
},
"totalPrice": {
"amount": "0.0001",
"currency": "eth"
}
},
"delivery": {
"status": "awaiting-payment",
"recipient": {
"locator": "email:<email_address>:<chain>",
"email": "testy@crossmint.com",
"walletAddress": "0x1234abcd..."
}
}
}
],
"quote": {
"status": "valid",
"quotedAt": "2024-06-07T16:55:44.653Z",
"expiresAt": "2024-06-07T17:55:44.653Z",
"totalPrice": {
"amount": "0.0001375741",
"currency": "eth"
}
},
"payment": {
"status": "awaiting-payment",
"method": "base-sepolia",
"currency": "eth",
"preparation": {
"chain": "base-sepolia",
"payerAddress": "0x1234abcd...",
"serializedTransaction": "0x02f90....."
}
}
}
}{
"error": true,
"message": "Invalid arguments or empty parameter <missing parameter>."
}{
"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
application/json
- EVM
- Solana
- Fiat
Show child attributes
Show child attributes
- Single Line Item - Collection Locator · object
- Single Line Item - Product Locator · object
- Single Line Item - Token Locator · object
- Multiple Line Items - Collection Locators · object[]
- Multiple Line Items - Token Locators · object[]
Show child attributes
Show child attributes
Recipient of the items being purchased. Crossmint will create a custodial wallet address for the user on the fly, that they can later log in to. If no recipient is passed, an order will be created with the status 'requires-recipient', until you pass one.
- Email
- Wallet
Show child attributes
Show child attributes
Locale for the checkout, in IETF BCP 47. It impacts the email receipt language. Ensure your UI is set to the same language as specified here. Throws an error if passed an invalid language.
Available options:
en-US, es-ES, fr-FR, it-IT, ko-KR, pt-PT, ja-JP, zh-CN, zh-TW, de-DE, ru-RU, tr-TR, uk-UA, th-TH, vi-VN, Klingon Example:
"en-US"
Was this page helpful?

