Crossmint Checkout makes it possible to buy real world products and services with stablecoins via a single API.

Set up

Before getting started, you will need:

  1. A Crossmint project created both in the Crossmint Console in staging or production
  2. A server-side API key for each project
    1. Navigate to Integrate > API Keys > Create API key
    2. Select scopes: orders.create, orders.read, wallets:transactions.create, wallets.create, wallets.read, wallets.balance:read
    3. Save the API key for later

API Quickstart

1. Submit an Amazon Order

Call 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"
        }
    }
}

2. Include Shipping Information

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....."
      }
    }
  }
}

3. Sign the Order

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"
	}
}

4. Poll for Status Updates