Credit Purchase Integration: USDC Settled Directly to BYO Wallet (EVM)
Credit Purchase Integration: USDC Settled Directly to BYO Wallet (EVM)
This page is for advanced / cryptocurrency-native companies. If that’s not you, head back to the Quickstart for the standard flows.
Summary
This implementation guide outlines how Merchants on EVM chains can accept pay-ins and settle to a Merchant’s EVM wallet.
Setup
Complete account setup first
This integration assumes you’ve completed the Account Setup prerequisites — sandbox merchant account, API key, team access, and any product-specific configuration (settlement location, chargeback protection, or wallet funding).
Quick Links:
- How does settlement to EVM 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:
Authorization— Your API key from the merchant dashboard.x-coinflow-auth-user-id— A unique customer ID from your own systems identifying the payer or payee.x-coinflow-auth-session-key— A JWT that authorizes the payer. Valid for 24 hours; refresh after expiry.
Checkout Implementation
React SDK
-
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.
SignUpEventSignInEventSignInFailureEventBuyerChallengeEventFor full descriptions and timing guidance for each event, see Sending Payer Events.
-
Install Coinflow package
npm i @coinflowlabs/react
- Tokenize the checkout parameters. This encrypts the checkout parameters so bad actors cannot tamper with the checkout args.
- Implement
CoinflowPurchasecomponent
- Customize the UI on your dashboard
- Whitelist your url By whitelisting your domain, checkout can only be completed on your domain. This protects against bad actors trying to take your checkout link and injecting it onto their site.
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.
SignUpEventSignInEventSignInFailureEventBuyerChallengeEventFor full descriptions and timing guidance for each event, see Sending Payer Events.
-
Fetch a session key This creates a JWT token for the customer, and authorizes the user to call these endpoints. You will pass the returned session key as
x-coinflow-auth-session-keyheader.RequestResponse -
Get the Totals for the checkout to show the customer a quote inclusive of all fees.
RequestResponse -
Tokenize the Credit Card Number. See tab:
Tokenize New Card -
Tokenize the checkout parameters. This encrypts the checkout parameters so bad actors cannot tamper with the checkout args.
RequestResponse -
Enable a New Card Checkout This endpoint will enable a new user who has never made a purchase to complete their purchase with a credit card. Below is an example of how you’d call the card checkout endpoint:
-
RequestResponse
-
-
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:
- Optional Implementation: Get payment by id This endpoint allows your to get details about the payment.
- At this point, you’ve successfully made a purchase with a new card and with a saved card. Next, lets add 3DS for card purchases. Please reach out to the Coinflow team when you’ve reached this step so we can configure 3DS on your account.
Adding 3DS to Card Checkout
Follow the below recipe to learn how to add 3DS to your new card and saved card requests.
Adding Chargeback Protection
- Add the chargeback protection script to every page of your app.
This script allows our provider to analyze user behavior and determine if the behavior could lead to fraud.
- On sandbox, use the test
partnerIdprovided by the Coinflow team.
- On sandbox, use the test
- Pass the
chargebackProtectionDataobject to the new and saved card checkout as well as the below headers. See an example of what the request will look like when you pass chargeback protection data to the new card checkout endpoint.x-device-id- Get this after adding the script in step 1x-coinflow-client-ip- the payer’s ipv4 addressuser-agent- the payer’s User Agent
-
Get Credits Authorization Message Get a message which the payer’s wallet should sign - this authorizes them to spend the credit balance.
-
Sign the Message.
-

