One-Time Purchase Integration: USDC Settlement to Solana Contract
Setup
You MUST complete the account setup section before you start integrating!
Quick Links:
- How does settlement to Solana Contract work
- Testing Card Numbers to use on Sandbox
- Listening to checkout webhooks
- Customize the UI to match your company branding guidelines if using Coinflow’s SDK or Checkout link
Authorization Headers:
Authorizationis your API Key. You can generate this from the merchant dashboardx-coinflow-auth-user-idis a unique customer ID you use within your systems to identify the user withdrawing fundsx-coinflow-auth-blockchainshould always besolanaif your settlement location is the Coinflow in-app walletx-coinflow-auth-session-keyis a JWT that authorizes the payer. This is valid for 24 hours and must be refreshed anytime after
Checkout Link Implementation
- Share payer events with Coinflow
Sharing major events that a payer makes throughout their lifecycle on your website prior to them making a purchase will allow us to collect more information about them and improve your approval rates.SignUpEventSignInEventSignInFailureEventBuyerChallengeEvent - Get a checkout link
This endpoint will generate a link which you can embed in an iframe or redirect users directly to. Leverage the Checkout link to complete the payment. Once we receive the payment, Coinflow will send credits to the user’s wallet.RequestResponse - Create a redeem transaction
Create a redeem transaction instantly after the payer completes their card payment. The transaction passed should be a base58 encoded tx created by you and passed into our redeem endpoint. This transaction should be created as if the receiver (your whitelisted contract) will receive USDC as settlement.
- Have the user wallet sign and send the transaction. Below is an example of how you can sign it. You may use Coinflow’s endpoint to then send the transaction to the solana blockchain.
React SDK Implementation
- Share payer events with Coinflow
Sharing major events that a payer makes throughout their lifecycle on your website prior to them making a purchase will allow us to collect more information about them and improve your approval rates.SignUpEventSignInEventSignInFailureEventBuyerChallengeEvent - Install Coinflow package
- Below is an example of how to implement the
CoinflowPurchasemodal so a user can purchase credits with their payment method.
-
Upon completion of the card payment, coinflow will send credits to the payer’s wallet. Then, subsequently call the redeem transaction upon success. To Create a redeem transaction- create and pass a base58 encoded tx created by you and passed into our redeem endpoint. This transaction should be created as if the receiver (your whitelisted contract) will receive USDC as settlement.
RequestResponse -
Have the user wallet sign and send the transaction. Below is an example of how you can sign it. You may use Coinflow’s endpoint to then send the transaction to the solana blockchain.
Sign TransactionSend Transaction
- Note: This is required!
API Implementation
-
Share payer events with Coinflow
Sharing major events that a payer makes throughout their lifecycle on your website prior to them making a purchase will allow us to collect more information about them and improve your approval rates.SignUpEventSignInEventSignInFailureEventBuyerChallengeEvent -
Generate an API Key from Merchant Dashboard > API Keys > Create.
-
Get a Session Key
This creates a JWT for the payer and must be refreshed every 24 hours.RequestResponseNote: Session keys are valid for 30 minutes and must be refreshed upon expiration.
-
Get the Totals for the checkout
This will return the total price inclusive of all fees for the purchase.
- Tokenize the Credit Card Number. See tab:
Tokenize New Card - Enable a New Card Checkout
This endpoint will enable a new user who has never made a purchase to complete their purchase using the tokenized credit card retrieved from Step 4. Below is an example of how you’d call the card checkout endpoint:
- Re-tokenize a saved card number. See tab:
Refresh Token w/ CVV - Enable a Saved Card Checkout
This endpoint will enable a returning user to complete a purchase with a previously saved card. The returning user will need to enter their CVV before confirming the purchase.
Once you’ve retrieved the refreshed card token, pass it into the Saved Card Checkout endpoint. Below is an example request:
-
-
Have the user wallet sign and send the transaction. Below is an example of how you can sign it. You may use Coinflow’s endpoint to then send the transaction to the solana blockchain.
Sign TransactionSend Transaction -
Add Chargeback protection on EVERY PAGE of your app
- Note: This is required!

