Enterprise feature. Contact us for access.
Introduction
In this quickstart you’ll learn how to accept credit card payments (including Apple and Google Pay) using Crossmint’s headless APIs to purchase an NFT on thepolygon-amoy testnet
Prerequisites
From Crossmint
- Create a developer account in the Staging Console.
- Create a new collection or import yours into the console, and have your
collectionIdready.- Make sure you follow the maximum prices for collections set in staging outlined here.
- Create a server-side API key with the
orders.create,orders.update, andorders.readscopes enabled. More info on creating API keys here.
To integrate in production/mainnet, you'll also need to complete account and collection verification. More
information in the production launch guide.
Integration Steps
This quickstart will focus on the API calls to Crossmint necessary to implement headless checkout in your project, as well as the usage of Crossmint Embedded Checkout component to collect the user's payment.This guide assumes you are using React, however Crossmint's checkout can be used in all platforms
such as Web, iOS, Android, and React Native.
1. Create an Order
The first step in the headless checkout process is to create an order. An order is an object datastructure, that represents an intent to purchase in Crossmint's systems. This guide will create a basic order, and then update it with required info step-by-step.You can also create the entire order in one API call if the necessary information is available at the time of order
creation. This can be used for custom "one-click-checkout" experiences, should you wish to make them.
POST https://staging.crossmint.com/api/2022-06-09/orders
Refer to the complete create order API reference here.
Example Response
Example Response
For the comprehensive list of supported currencies and chains, view the Supported
Currencies page.
quote phase and is awaiting a recipient to be set. Setting a recipient does not mean that we are sending the NFT to them; it is merely used to verify that the intended recipient is a valid address, before beginning gathering payment info.
Optional - View the Order in the Console
Congratulations! You've made your first contact with Crossmint's systems. You can see your request show up in the developer console. Navigate to the Orders tab for your collection in the Staging Console and enter theorderId returned from your API response to find your incomplete order object and status.
2. Update the Order with Recipient
Next, you will set who's the intended recipient of the order by specifying a wallet address or email. When arecipient is passed as an email, Crossmint will automatically create a custodial wallet associated with this email, that can be accessed by logging in to the (staging) Crossmint Wallet or from your website if you're using whitelabel wallets.
PATCH https://staging.crossmint.com/api/2022-06-09/orders/<orderId>
Refer to the complete edit order API reference here.
- Email recipient
- Wallet recipient with receipt email
3. Render the Crossmint Embedded Component
After creating an order, you’ll need to render the Crossmint Embedded Component to collect payment information.4. Poll for Status Updates
After making the payment via whichever payment method, you'll need to poll the Get Order API to check on the delivery status and present this info to your user. Refer to the complete get order API reference here.GET https://staging.crossmint.com/api/2022-06-09/orders/<orderId>

