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
If an offer is unavailable, a response should return 404 - Not Found.
2. Register with XpansionChain using created endpoints
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:
Status: 404
Response: {
"code": "404", // the error code
"message": "Missing offer", // the error message
"details": "The offer id {offer_id} is not a valid offer for purchase" // the error details
}