POST
/
2022-06-09
/
orders
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 '{
  "recipient": {
    "email": "jsmith@example.com"
  },
  "locale": "en-US",
  "payment": {
    "receiptEmail": "jsmith@example.com",
    "method": "arbitrum-sepolia",
    "currency": "eth",
    "payerAddress": "<string>"
  },
  "lineItems": {
    "collectionLocator": "crossmint:<collectionId>",
    "callData": {
      "totalPrice": "<string>"
    }
  }
}'
{
  "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"
            }
          },
          "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....."
      }
    }
  }
}

Authorizations

X-API-KEY
string
headerrequired

Body

application/json
recipient
object

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.

locale
enum<string>
default: en-US

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
payment
object
lineItems

Response

201 - application/json
clientSecret
string

A token exclusively scoped to a particular order, allowing for the reading or updating of that order.

order
object