Initial phase of the order lifecycle
lineItems
array, which indicate the details of what is being purchased.
lineItems
in an order you must create a new order.requires-recipient
requires-physical-address
- When purchasing physical items, a shipping address is required. The order will remain in this status until a valid physical address is provided, and payment.preparation
parameters will not be present.expired
valid
clientSecret
returned in the create-order API response as an authorization
header. This guide is written with
the expectation of using a server-side API key.POST
request to the /api/2022-06-09/orders
endpoint (view API reference). The required properties to create an order are: payment
and lineItems
.
payment
object indicates the method and currency you intend to make the payment with. For crypto payments, this can be the same chain of the NFT or another chain that the buyer has liquidity on.
For example, buying an NFT on BASE
chain with BASE
ETH
, buying an NFT on Solana with SOL
, or any cross-chain combination of a supported chain and currency.
The payment.method
value for credit card checkouts is stripe-payment-element
and the payment.currency
can be any of the supported fiat currencies.
The lineItems
object describes the NFTs being purchased.
For primary sales, each item must be available from the same collectionId
. Currently, minting from multiple contracts in the same purchase is not supported.
collectionLocator
within lineItems
is how you specify the collection within Crossmint. For primary sales where the NFTs are being minted for the first time, the contract will need to be registered in the Crossmint console. You can find your collectionId
within the Token collections tab in the developer console.
tokenLocator
, instead of a collectionLocator
.
Using a token locator means you do not need to register the collection in the Crossmint console.
The tokenLocator
for EVM Chains follows the format blockchain:contractAddress:tokenId
and for Solana follows the format blockchain:tokenAddress
.
More information on the tokenLocator
format can be found in the marketplaces and launchpads guide.
PATCH
request to the /api/2022-06-09/orders/<orderId>
endpoint to make these changes and receive a response with updated payment details. View API reference here.
You can update all of these fields at the same time or individually depending on what makes the most sense for your use case.
requires-recipient
state occurs when you initialize a minimal order and do not include a recipient value. Valid options for the recipient property are email
or walletAddress
.
When you set an email recipient, the token will be minted to a Crossmint custodial wallet that can be accessed via www.crossmint.com (or staging.crossmint.com during testing).
You can update the recipient for an existing order as follows:
PATCH
/api/2022-06-09/orders/<orderId>
payment.preparation.serializedTransaction
to construct the transaction.locale
is used to set the language and currency for the email receipt sent to your buyer. The default is en-US
.
Below is an example of the body you’d pass to update the locale setting:
en-US
, de-DE
, es-ES
, fr-FR
, it-IT
, ja-JP
, ko-KR
, pt-PT
, ru-RU
th-TH
tr-TR
uk-UA
vi-VN
zh-CN
zh-TW
, Klingon
quote.expiresAt
property to determine how long the quote is valid for. Additionally, the quote.status
property will be set to expired
if this timeframe is exceeded.
If your quote has expired you’ll need to create a new order.