Credit Purchase Integration: USDC Settled Directly to Coinflow Wallet
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.RequestResponse -
Submit a purchase through the provided link and go to the merchant dashboard to see the purchase record.
📘 At this point, the purchase for credits is complete, and the payer has credits in their wallet.
After the user has credits, they can use their credits for use at anytime.
-
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
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.
- Then, when the customer wants to redeem their credits, you can implement the
CoinflowPurchaselike below: - Add Chargeback protection on EVERY PAGE of your app
- 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!

