Crossmint Checkout makes it possible to buy real world products and services with stablecoins via a single API.
Before getting started, you will need:
orders.create, orders.read, wallets:transactions.create, wallets.create, wallets.read, wallets.balance:readCall the Create Order API, providing payment information and an Amazon product locator:
**POST** /api/2022-06-09/orders
{
"recipient": {
"email": "[email protected]"
},
"payment": {
"method": "base-sepolia", // chain the payment is on, "base" for production
"currency": "usdc",
"payerAddress": "0x..." // the user's wallet (who's paying for the order)
},
"lineItems": [
{
// Amazon ASIN or URL, i.e. "amazon:https://www.amazon.com/dp/B07MJL8NXR"
"productLocator": "amazon:B07MJL8NXR"
}
]
}
Since the order involves a physical product, the order’s response status is set to requires-physical-address .
{
"order": {
"orderId": "...",
"phase": "quote"
"quote": {
"status": "requires-physical-address"
},
"payment": {
"status": "requires-quote"
}
}
}
Collect the user’s address information and update the order by calling the Edit Order API:
**PATCH** /api/2022-06-09/orders/{orderId}
{
"recipient": {
"physicalAddress": {
"name": "Filippos L",
"line1": "14 ABC Street",
"city": "New York City",
"state": "NY",
"postalCode": "10007",
"country": "US"
}
}
}
The status in the order’s response is now valid, including the information needed to proceed with the onchain transaction.
{
"order": {
"orderId": "a25a350b-2080-4465-b8a1-d1d25ca11fa2",
"quote": {
"status": "valid",
"expiresAt": "2025-02-28T19:30:00Z",
"totalAmount": "10.50",
"currency": "usdc"
},
"payment": {
"status": "awaiting-payment",
"preparation": {
"chain": "base-sepolia",
"payerAddress": "0x...",
"serializedTransaction": "0x02f90....."
}
}
}
}
Sign the order with the user’s wallet to complete purchase:
**POST** /api/2022-06-09/wallets/${user_wallet}/transactions
{
"params": {
"calls":[{
// Insert the serializedTransaction found in the previous step's response
"transaction": serializedTransaction
}],
"chain": "base-sepolia"
}
}