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
  • API Reference
    • POSTGets USDC/SBC/EuroE on testnets
      • POST(EVM only) Get Credits Authorization Message
      • POST(EVM only) Send Redeem Transaction with Credits Authorization Message
      • POSTCreate Merchant Wallet Redemption Transaction
      • POSTCreate Redeem Transaction
LogoLogo
RegisterLoginSandbox Login
API ReferenceRedeem

Create Redeem Transaction

POST
https://api-sandbox.coinflow.cash/api/redeem
POST
/api/redeem
$curl -X POST https://api-sandbox.coinflow.cash/api/redeem \
> -H "x-coinflow-auth-wallet: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "merchantId": "merchant_9f8b7c6d5e4a3b2c1d0e",
> "subtotal": {
> "cents": 2599,
> "currency": "USD"
> },
> "transaction": "BPFz7Q1vX9a2Yh3JkLmN8pR4sTqVwXzC1bD5eF7gHjKlMnOpQrStUvWxYz0123456789"
>}'
1{
2 "transaction": "eyJ0eXBlIjoiVHJhbnNhY3Rpb24iLCJpbnB1dHMiOnsicmVjaXBpZW50IjoiMHg1YjY3YzQ1ZjY3YjY3YjY3IiwibWV0aG9kIjoiY3JlYXRlIn0sIm91dHB1dCI6eyJzdGF0dXMiOiJzdWNjZXNzIn19"
3}

Creates a transaction for the user to sign in order to redeem their Coinflow credits with a merchant’s contract.

The transaction passed to this endpoint should be the same as if the end user’s wallet was calling the merchant’s contract with enough USDC/Other Cryto Currency to successfully complete the transaction.

Was this page helpful?
Previous

Get Refunds

Next
Built with

Authentication

x-coinflow-auth-walletstring
The web3 wallet of the end user - see https://docs.coinflow.cash/api-reference/api-reference/authentication/get-session-key
x-coinflow-auth-blockchainstring
The blockchain associated with the end user - see https://docs.coinflow.cash/api-reference/api-reference/authentication/get-session-key

Headers

x-device-idstringOptional

Request

This endpoint expects an object.
merchantIdstringRequired
subtotalobjectRequired
transactionstringRequired

Transaction for which the purchase will be redeemed. This should be constructed by the merchant, and should be setup the same way as if the user has USDC/Purchase Token in their wallet. The endpoint will modify this transaction and then send it back to the user to sign and send.

Solana - base 58 encoded transaction, create using: base58.encode(transaction.serialize({ requireAllSignatures: false, verifySignatures: false })) Evm - Base 64 encoded stringified transaction, create using: Buffer.from(JSON.stringify(transaction)).toString('base64')

signedMessagesobjectOptional
chargebackProtectionDatalist of objectsOptional
rentobjectOptional

(Solana Only) if your transaction requires a known amount of Rent to be paid, you can pass it here.

nativeSolToConvertobjectOptional

(Solana Only) Only use this if your subtotal.token is So11111111111111111111111111111111111111112 and your contract requires native SOL. This will convert the amount of wSOL to native SOL for use in the transaction.

skipBalanceCheckbooleanOptional

Response

Ok
transactionstring

Transaction for the users wallet to sign and send.

Solana - base 58 encoded transaction, recover using: Transaction.from(base58.decode(transaction)) Near - Base 64 encoded stringified transaction, recover using: JSON.parse(Buffer.from(transaction, 'base64').toString()); Evm - Base 64 encoded stringified transaction, recover using: JSON.parse(Buffer.from(transaction, 'base64').toString());

Errors

412
Precondition Failed Error

The web3 wallet of the end user - see https://docs.coinflow.cash/api-reference/api-reference/authentication/get-session-key

The blockchain associated with the end user - see https://docs.coinflow.cash/api-reference/api-reference/authentication/get-session-key