For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
RegisterLoginSandbox Login
GuidesRecipesAPI Reference
GuidesRecipesAPI Reference
  • Getting Started
    • Getting Started with Checkout
    • ACH Checkout
    • Card Checkout with Credits
    • Card Checkout
    • Direct USDC Settlement
    • Fiat/Crypto Pay-ins
    • Secure Marketplace Checkout
    • EVM Checkout
    • How to Enable Checkout with Credit Cards
    • Quick Start Marketplace Implementation
    • Payouts
    • Common FAQs
  • Checkout
      • Getting Started with Implmentation
        • Credit Purchase - USDC to BYO Wallet (EVM)
        • Credit Purchase - USDC to Coinflow/BYO Wallet (Solana)
        • Credit Purchase - USDC to Coinflow Wallet
        • Credit Purchase - USDC to Solana Contract
        • Credit Purchase - USDC to EVM Contract
        • One-Time Purchase - USDC to Coinflow/BYO Wallet
        • One-Time Purchase - USDC to EVM Contract
        • One-Time Purchase - USDC to Solana Contract
        • One-Time Purchase - USDC to 3rd Party
        • One-Time Purchase - USDC to Stellar Contract
        • One-Time Purchase - Direct USDC Transfer (Stellar)
      • Mobile App Payments
    • Settlement Locations
    • Checkout Webhooks
  • Payouts
    • Payout Overview
    • What is a Payout
  • Subscriptions
    • Subscriptions Overview
  • Marketplaces
    • Marketplace Overview
    • How Marketplaces Work
    • How to Withdraw USDC
    • Countries Eligible for USDC Withdraw
    • Marketplaces Webhooks
    • Marketplaces Implementation
  • Developer Resources
    • Custom Branding
    • Checkout Implementation
    • Webhooks
  • Merchant Dashboard
    • Login & Account Access
    • Users and Roles
    • Rate Limits
    • Developer Contact
LogoLogo
RegisterLoginSandbox Login
On this page
  • Prerequisites
  • Quick Reference
  • Choose Your Implementation
  • Step 1: Generate the checkout link
  • Step 2: Create a redeem transaction
  • Step 3: Sign and send the transaction
  • Step 1: Install the SDK
  • Step 2: Render the checkout component
  • Step 3: Create a redeem transaction on success
  • Step 4: Sign and send the transaction
  • Step 1: Get a session key
  • Step 2: Get pricing totals
  • Step 3: Tokenize the credit card
  • Step 4: Process the new card payment
  • Step 5: Process saved card payments (returning users)
  • Step 6: Create a redeem transaction
  • Step 7: Sign and send the transaction
  • Chargeback Protection
  • Add the protection script
  • Send user events
  • Next Steps
CheckoutImplementation OverviewImplementation Guides

One-Time Purchase Integration - Solana Contract Settlement

Accept credit card payments and settle USDC directly to your Solana smart contract
Was this page helpful?
Previous

One-Time Purchase Integration - Third-Party USDC Settlement

Accept credit card payments and settle USDC directly to a third-party wallet

Next
Built with

This guide walks you through integrating Coinflow checkout to accept one-time credit card purchases with USDC settlement to your whitelisted Solana program.

Prerequisites

Complete these steps before starting the integration.

1

Create your sandbox account

Register or login to your sandbox merchant account

2

Generate API keys

Create a sandbox API key for authentication

3

Add chargeback protection

Add the protection script to every page of your app

4

Whitelist your Solana program

Whitelist your program to receive USDC settlement

Quick Reference

Authorization Headers
HeaderDescription
AuthorizationYour API key from the merchant dashboard
x-coinflow-auth-walletUser’s Solana wallet address
x-coinflow-auth-blockchainUse solana for Solana contract settlement
x-coinflow-auth-session-keyJWT token authorizing the payer
Helpful Resources
  • How Solana contract settlement works
  • Test card numbers for sandbox
  • Checkout webhooks
  • Custom branding

Choose Your Implementation

Checkout Link
React SDK
API Only

Best for simple integrations. Generate a hosted checkout URL to redirect users or embed in an iframe.

Step 1: Generate the checkout link

$curl --request POST \
> --url https://api-sandbox.coinflow.cash/api/checkout/link \
> --header 'Authorization: YOUR_API_KEY' \
> --header 'accept: application/json' \
> --header 'content-type: application/json' \
> --header 'x-coinflow-auth-blockchain: solana' \
> --header 'x-coinflow-auth-wallet: USER_WALLET_ADDRESS' \
> --data '{
> "webhookInfo": {
> "depositId": "123-abc-456"
> },
> "subtotal": {
> "currency": "USD",
> "cents": 500
> },
> "settlementType": "Credits",
> "email": "customer@example.com",
> "blockchain": "solana",
> "chargebackProtectionData": [{
> "productType": "inGameProduct",
> "productName": "In-Game Credits",
> "quantity": 1,
> "rawProductData": {
> "description": "Purchase credits for gameplay"
> }
> }],
> "deviceId": "123456789",
> "supportEmail": "support@yourcompany.com"
> }'

Step 2: Create a redeem transaction

After the payer completes checkout, create a redeem transaction to settle USDC to your contract. Create a base58 encoded transaction for your whitelisted program.

$curl --request POST \
> --url https://api-sandbox.coinflow.cash/api/redeem \
> --header 'accept: application/json' \
> --header 'content-type: application/json' \
> --header 'x-coinflow-auth-blockchain: solana' \
> --header 'x-coinflow-auth-wallet: USER_WALLET_ADDRESS' \
> --data '{
> "subtotal": {
> "currency": "USD",
> "cents": 500
> },
> "merchantId": "YOUR_MERCHANT_ID",
> "transaction": "BASE58_ENCODED_TRANSACTION",
> "chargebackProtectionData": [{
> "productType": "inGameProduct",
> "productName": "In-Game Credits",
> "quantity": 1
> }]
> }'

Step 3: Sign and send the transaction

Have the user’s wallet sign and send the transaction.

1const { Connection, Keypair, VersionedTransaction } = require('@solana/web3.js');
2const bs58 = require('bs58');
3
4async function signTransaction(base58Transaction, keypair) {
5 const decodedTransactionBytes = bs58.decode(base58Transaction);
6 const versionedTransaction = VersionedTransaction.deserialize(decodedTransactionBytes);
7 versionedTransaction.sign([keypair]);
8 const serializedTransaction = versionedTransaction.serialize();
9 return bs58.encode(serializedTransaction);
10}

Chargeback Protection

Add the protection script

Add the chargeback protection script to every page of your app.

Send user events

Track key user actions throughout their journey.

$curl --request POST \
> --url https://api-sandbox.coinflow.cash/api/events \
> --header 'Authorization: YOUR_API_KEY' \
> --header 'content-type: application/json' \
> --data '{
> "eventType": "SignUp",
> "customerId": "user-123-abc",
> "country": "US",
> "username": "johndoe",
> "email": "john@example.com",
> "firstName": "John",
> "lastName": "Doe"
> }'

On sandbox, use partnerId = COINFTEST when configuring the protection script.


Next Steps

Test Your Integration

Use sandbox test cards to verify your implementation

Configure Webhooks

Receive real-time payment notifications

Go Live

Create your production merchant account

API Reference

Explore the complete API documentation