> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.coinflow.cash/guides/checkout/implementation-overview/implementation-guides/advanced-use-cases/one-time-purchase-usdc-to-3rd-party/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.coinflow.cash/_mcp/server. # One-Time Purchase Integration - Third-Party USDC Settlement > **Warning** > > **This page is for advanced / cryptocurrency-native companies.** If that's not you, head back to the [Quickstart](/guides/getting-started/quickstart) for the standard flows. This guide walks you through integrating Coinflow checkout to accept one-time credit card purchases with USDC settlement to a third-party wallet address. ## Prerequisites > **Warning** > > Complete these steps before starting the integration. #### Create your sandbox account [Register](https://sandbox-merchant.coinflow.cash/register) or [login](https://sandbox-merchant.coinflow.cash/login) to your sandbox merchant account #### Generate API keys [Create a sandbox API key](https://sandbox-merchant.coinflow.cash/api-keys) for authentication #### Add team members [Add team members](https://sandbox-merchant.coinflow.cash/users-and-roles) to your sandbox account #### Add chargeback protection [Add the protection script](/guides/checkout/payment-security-risk-management/fraud-protection/implement-chargeback-protection#how-to-add-chargeback-protection) to every page of your app #### Configure settlement [Configure settlement settings](https://sandbox-merchant.coinflow.cash/settings) - Select [Your Own Merchant Wallet](/guides/checkout/settlement-locations/merchant-byo-wallet-settlement) ## Quick Reference #### Authorization Headers | Header | Description | | ----------------------------- | ------------------------------------------------------------------------------------------------------------------- | | `Authorization` | Your API key from [the merchant dashboard](https://sandbox-merchant.coinflow.cash/api-keys) | | `x-coinflow-auth-user-id` | Unique customer ID you use within your systems to identify the user | | `x-coinflow-auth-blockchain` | Use `solana` for Solana settlement | | `x-coinflow-auth-session-key` | [JWT token](/api-reference/api-reference/authentication/get-session-key) authorizing the payer (valid for 24 hours) | #### Helpful Resources * [Test card numbers for sandbox](/guides/checkout/testing/testing-credit-cards) * [Checkout webhooks](/guides/developer-resources/webhooks/checkout-webhooks) * [Custom branding](/guides/developer-resources/custom-branding) --- ## Choose Your Implementation #### API Only Best for custom checkout UIs. Full control over the payment flow. ### Step 1: Get a session key Create a JWT token for the customer that authorizes them to call checkout endpoints. **`Request`** ```bash title="Request" curl --request GET \ --url https://api-sandbox.coinflow.cash/api/auth/session-key \ --header 'Authorization: YOUR_API_KEY' \ --header 'accept: application/json' \ --header 'x-coinflow-auth-user-id: customer123' ``` **`Response`** ```json title="Response" { "key": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." } ``` > **Warning** > > Session keys expire after 24 hours. Refresh them before expiration. ### Step 2: Get pricing totals Show the customer a quote inclusive of all fees. **`Request`** ```bash title="Request" curl --request POST \ --url https://api-sandbox.coinflow.cash/api/checkout/totals/YOUR_MERCHANT_ID \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-coinflow-auth-session-key: SESSION_KEY' \ --data '{ "subtotal": { "cents": 100 }, "settlementType": "USDC" }' ``` **`Response`** ```json title="Response" { "card": { "subtotal": { "cents": 100 }, "creditCardFees": { "cents": 40 }, "chargebackProtectionFees": { "cents": 0 }, "gasFees": { "cents": 0 }, "total": { "cents": 140 } }, "ach": { "subtotal": { "cents": 100 }, "creditCardFees": { "cents": 100 }, "chargebackProtectionFees": { "cents": 0 }, "gasFees": { "cents": 0 }, "total": { "cents": 200 } } } ``` ### Step 3: Tokenize the credit card See [PCI-compliant card tokenization](/recipes/recipes/pci-compliant-card-tokenization) for the "Tokenize New Card" implementation. ### Step 4: Tokenize the destination wallet Tokenize the wallet address that will receive the USDC settlement. **`Request`** ```bash title="Request" curl --request POST \ --url https://api-sandbox.coinflow.cash/api/checkout/destination-auth-key \ --header 'Authorization: YOUR_API_KEY' \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --data '{ "blockchain": "solana", "destination": "78C3dn4yUJST9pcX9GtA3yWBcKUCjDw1RWqw1MLpoUDh" }' ``` **`Response`** ```json title="Response" { "destinationAuthKey": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." } ``` ### Step 5: Process a new card payment **`Request`** ```bash title="Request" curl --request POST \ --url https://api-sandbox.coinflow.cash/api/checkout/card/YOUR_MERCHANT_ID \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-coinflow-auth-session-key: SESSION_KEY' \ --data '{ "subtotal": { "currency": "USD", "cents": 500 }, "webhookInfo": { "example": "{\"wineId\": \"123abc\"}" }, "card": { "cardToken": "411111YJM5TX1111", "expYear": "30", "expMonth": "10", "email": "test@gmail.com", "firstName": "John", "lastName": "Doe", "address1": "380 prospect ave", "city": "brooklyn", "zip": "11215", "state": "ny", "country": "US" }, "destinationAuthKey": "DESTINATION_AUTH_KEY", "settlementType": "USDC" }' ``` **`Response`** ```json title="Response" { "paymentId": "f3fc8a34-680b-4b91-905b-1db5628bbb0e" } ``` ### Step 6: Process saved card payments (returning users) Re-tokenize the saved card with CVV first (see [card tokenization docs](/recipes/recipes/pci-compliant-card-tokenization) - "Refresh Token w/ CVV" tab), then: **`Request`** ```bash title="Request" curl --request POST \ --url https://api-sandbox.coinflow.cash/api/checkout/token/YOUR_MERCHANT_ID \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-coinflow-auth-session-key: SESSION_KEY' \ --data '{ "subtotal": { "currency": "USD", "cents": 500 }, "webhookInfo": { "example": "{\"wineId\": \"123abc\"}" }, "settlementType": "USDC", "token": "411111YJM5TX1111", "destinationAuthKey": "DESTINATION_AUTH_KEY" }' ``` **`Response`** ```json title="Response" { "paymentId": "0090c04b-1ae8-4672-a108-32874df36f11" } ``` ### Step 7: Get payment details (optional) **`Request`** ```bash title="Request" curl --request GET \ --url https://api-sandbox.coinflow.cash/api/merchant/payments/enhanced/PAYMENT_ID \ --header 'Authorization: YOUR_API_KEY' \ --header 'accept: application/json' ``` **`Response`** ```json title="Response" { "info": { "firstName": "Dwayne", "lastName": "Johnson", "email": "customer@email.com", "streetAddress": "385 Prospect Ave", "city": "Brooklyn", "state": "NY", "zip": "11215", "country": "US", "bin": "411111", "expMonth": "10", "expYear": "30" } } ``` #### Checkout Link Best for simple integrations. Generate a hosted checkout URL to redirect users or embed in an iframe. ### Step 1: Tokenize the destination wallet **`Request`** ```bash title="Request" curl --request POST \ --url https://api-sandbox.coinflow.cash/api/checkout/destination-auth-key \ --header 'Authorization: YOUR_API_KEY' \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --data '{ "blockchain": "solana", "destination": "78C3dn4yUJST9pcX9GtA3yWBcKUCjDw1RWqw1MLpoUDh" }' ``` **`Response`** ```json title="Response" { "destinationAuthKey": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." } ``` ### Step 2: Generate the checkout link **`Request`** ```bash title="Request" 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-user-id: user123' \ --data '{ "subtotal": { "currency": "USD", "cents": 500 }, "email": "payer@gmail.com", "blockchain": "solana", "settlementType": "USDC", "destinationAuthKey": "DESTINATION_AUTH_KEY" }' ``` **`Response`** ```json title="Response" { "link": "https://sandbox.coinflow.cash/solana/purchase-v2/testtest?sessionKey=..." } ``` ### Step 3: Listen for success events (optional) When embedding the checkout in an iframe, you can listen for success events: ```javascript