Set up required endpoints
Last updated
Last updated
FEATURE FOR MANAGED PARTNERS ONLY
This is a feature intended for managed partners. If you are not a managed partner and would like to become one, please reach out to us on our #dev-discussion channel on Discord.
If you are a managed partner, your partner success manager needs to set up a commercial partnership with MoonPay for you. Please reach out to them to facilitate this.
In order to implement this NFT primary sale card checkout feature, you need to complete the following:
Establish a commercial partnership with MoonPay (your partner success manager will facilitate this for you)
Set up and register with XpansionChain with the required endpoints
💡STEPS:
Create required endpoints
Register with XpansionChain using created endpoints
Validate the IMX-Signature
You are required to provide the following endpoints:
Trigger the mint: An endpoint to mint the asset once payment has been confirmed with MoonPay
Get asset info: An endpoint to get information about the minted asset and render the checkout
IMX-Signature
- How to validate this
Signature to confirm that the request was made by XpansionChain
IMX-Timestamp
- How to generate this
Timestamp header to validate IMX-Signature
offer_id
String
The ID of the offer provided for the NFT to be minted
contract_address
String
Smart contract address of the NFT
user
String
User that the NFT will be minted for (will become the NFT's owner)
wallet_address
String
Wallet address that will receive the payment, in crypto (from MoonPay), for the minted NFT
external_transaction_id
String (UUID)
Unique XpansionChaintransaction ID that can be used to get information about the transaction
contract_address
String
Smart contract address of the NFT
token_id
String
Token ID (as specified by the NFT smart contract) of the minted asset
tx_id
Integer
Minting transaction ID - see mintTokens response
ERROR ON MINT
If minting fails, please provide a response with the error code and message.
This endpoint will be used to get information about the asset to be minted using trigger mint endpoint.
offer_id
String
The ID of the offer provided for the NFT to be minted
contract_address
String
Smart contract address of the NFT
name
String
Token name to be rendered at checkout
collection
String
Collection name to be rendered at checkout
image_url
String
URL where the image to be displayed for the minted asset is hosted
price_currency_code
String
Currency of the amount to be paid. Choose from: "ETH"
or "USDC"
price
String
Amount of the currency required to mint the token
seller_address
String
Wallet address that will receive the payment, in crypto (from MoonPay), for the minted NFT
UNAVAILABLE OFFER
If an offer is unavailable, a response should return 404 - Not Found
.
When you've set up the endpoints required in the previous step, please register with XpansionChain using the registerNftPrimarySalesContract API endpoint.
After registration, XpansionChain will send you a webhook key that will be used to validate the signature when initiating mint requests.
Generate a signed_payload
by concatenating the following:
IMX-Timestamp
header
The character .
JSON payload of the message to be signed
Example:
You will then need to compute an HMAC with the SHA-256 hash function using the webhook key that we provided when you registered the endpoints with XpansionChain for the signed_payload
and use it to compare the signature in the header:
Headers required:
Request body:
Response:
Example:
Response:
Example: