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": "arbitrum-sepolia",
"currency": "eth",
"receiptEmail": "[email protected]",
"payerAddress": "<string>"
},
"lineItems": {
"collectionLocator": "crossmint:<collectionId>",
"callData": {
"totalPrice": "<string>"
}
},
"recipient": {
"email": "[email protected]",
"physicalAddress": {
"name": "<string>",
"line1": "<string>",
"city": "<string>",
"postalCode": "<string>",
"country": "<string>",
"line2": "<string>",
"state": "<string>"
}
},
"locale": "en-US"
}
'{
"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": "[email protected]",
"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....."
}
}
}
}Creates a new order that can be used to complete a headless checkout.
API scope required: orders.create
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": "arbitrum-sepolia",
"currency": "eth",
"receiptEmail": "[email protected]",
"payerAddress": "<string>"
},
"lineItems": {
"collectionLocator": "crossmint:<collectionId>",
"callData": {
"totalPrice": "<string>"
}
},
"recipient": {
"email": "[email protected]",
"physicalAddress": {
"name": "<string>",
"line1": "<string>",
"city": "<string>",
"postalCode": "<string>",
"country": "<string>",
"line2": "<string>",
"state": "<string>"
}
},
"locale": "en-US"
}
'{
"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": "[email protected]",
"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....."
}
}
}
}Show child attributes
arbitrum-sepolia, base-sepolia, ethereum-sepolia, optimism-sepolia, arbitrum, bsc, ethereum, optimism eth, usdc, degen, brett, toshi, usdxm, credit Email that the receipt will be sent to.
An EVM wallet address.
Show child attributes
The collection locator of the line item. For example: crossmint:<collectionId>. These fields can be retrieved from the Crossmint console.
"crossmint:<collectionId>"
Information that you pass to your contract mint function.
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.
Show child attributes
Physical shipping address for the recipient. Required when purchasing physical products.
Show child attributes
Full name of the recipient
Street address, P.O. box, company name, c/o
City, district, suburb, town, or village
ZIP or postal code
Two-letter country code (ISO 3166-1 alpha-2). Currently only US is supported.
Apartment, suite, unit, building, floor, etc.
State, county, province, or region. Required for US addresses.
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.
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 "en-US"
Order successfully created.
A token exclusively scoped to a particular order, allowing for the reading or updating of that order.
"_removed_"
Show child attributes
"b2959ca5-65e4-466a-bd26-1bd05cb4f837"
"payment"
"en-US"
Show child attributes
"polygon-amoy"
1
Show child attributes
"valid"
Show child attributes
Show child attributes
Status of the delivery. 'awaiting-payment': Initial state before payment is made. 'in-progress': Payment received, transaction submitted but not yet completed. 'completed': Successfully delivered with transaction ID and tokens. 'failed': Delivery failed, typically for refunded transactions.
awaiting-payment, in-progress, completed, failed "awaiting-payment"
Show child attributes
"email:<email_address>:<chain>"
"0x1234abcd..."
Show child attributes
Status of the quote. 'requires-physical-address' indicates that a shipping address is required for physical products.
valid, expired, all-line-items-unavailable, requires-physical-address "valid"
"2024-06-07T16:55:44.653Z"
"2024-06-07T17:55:44.653Z"
Show child attributes
Status of the payment. View the status codes for more information.
requires-kyc, failed-kyc, manual-kyc, awaiting-payment, requires-recipient, requires-crypto-payer-address, failed, in-progress, completed "awaiting-payment"
"base-sepolia"
"eth"
Was this page helpful?