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

(EVM only) Get Credits Authorization Message

POST
https://api-sandbox.coinflow.cash/api/redeem/evm/creditsAuthMsg
POST
/api/redeem/evm/creditsAuthMsg
$curl -X POST https://api-sandbox.coinflow.cash/api/redeem/evm/creditsAuthMsg \
> -H "x-coinflow-auth-wallet: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "merchantId": "merchant_abc123",
> "subtotal": {
> "cents": 2500,
> "currency": "USD"
> },
> "transactionData": {
> "transaction": {
> "data": "0xa9059cbb000000000000000000000000b794f5ea0ba39494ce839613fffba7427957926800000000000000000000000000000000000000000000000000000000000003e8",
> "to": "0x5FbDB2315678afecb367f032d93F642f64180aa3"
> },
> "type": "safeMint"
> }
>}'
1{
2 "message": "{\"types\":{\"EIP712Domain\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"version\",\"type\":\"string\"},{\"name\":\"chainId\",\"type\":\"uint256\"},{\"name\":\"verifyingContract\",\"type\":\"address\"}],\"CreditsAuthorization\":[{\"name\":\"merchantId\",\"type\":\"string\"},{\"name\":\"subtotalCents\",\"type\":\"uint256\"},{\"name\":\"subtotalCurrency\",\"type\":\"string\"},{\"name\":\"nonce\",\"type\":\"string\"},{\"name\":\"validBefore\",\"type\":\"uint256\"}]},\"primaryType\":\"CreditsAuthorization\",\"domain\":{\"name\":\"Coinflow\",\"version\":\"1\",\"chainId\":1,\"verifyingContract\":\"0x5FbDB2315678afecb367f032d93F642f64180aa3\"},\"message\":{\"merchantId\":\"merchant_abc123\",\"subtotalCents\":2500,\"subtotalCurrency\":\"USD\",\"nonce\":\"nonce_789xyz\",\"validBefore\":1700000000}}",
3 "validBefore": "1700000000",
4 "nonce": "nonce_789xyz",
5 "creditsRawAmount": 2.75
6}
Endpoint to generate an EIP-712 typed data message for authorizing credits usage on EVM chains. This endpoint is used to retrieve a "CreditsAuthorization" message that the user must sign using their wallet (e.g., MetaMask) via the eth_signTypedData_v4 method. The resulting signed message (permitCredits) is then supplied to the `/api/redeem/evm/sendGaslessTx` endpoint to execute a gasless redeem transaction. **Request Body:** - `merchantId` (string): The ID of the merchant requesting redemption. - `subtotal` (Subtotal): The transaction subtotal (either in USDC or a token-based subtotal). - `transactionData` (EvmTransactionData): Transaction details used for calculating gas fees and total credits required. **Response:** Returns an object with the following properties: - `message` (string): A JSON string representing the EIP-712 typed data. - `validBefore` (string): A timestamp or block number indicating until when the message is valid. - `nonce` (string): A unique value to prevent replay attacks. - `creditsRawAmount` (number): The raw credits amount calculated based on the transaction subtotal and estimated gas fees.
Was this page helpful?
Previous

(EVM only) Send Redeem Transaction with Credits Authorization Message

Next
Built with

Endpoint to generate an EIP-712 typed data message for authorizing credits usage on EVM chains.

This endpoint is used to retrieve a “CreditsAuthorization” message that the user must sign using their wallet (e.g., MetaMask) via the eth_signTypedData_v4 method. The resulting signed message (permitCredits) is then supplied to the /api/redeem/evm/sendGaslessTx endpoint to execute a gasless redeem transaction.

Request Body:

  • merchantId (string): The ID of the merchant requesting redemption.
  • subtotal (Subtotal): The transaction subtotal (either in USDC or a token-based subtotal).
  • transactionData (EvmTransactionData): Transaction details used for calculating gas fees and total credits required.

Response: Returns an object with the following properties:

  • message (string): A JSON string representing the EIP-712 typed data.
  • validBefore (string): A timestamp or block number indicating until when the message is valid.
  • nonce (string): A unique value to prevent replay attacks.
  • creditsRawAmount (number): The raw credits amount calculated based on the transaction subtotal and estimated gas fees.

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
OR
x-coinflow-auth-session-keystring
The session key generated for the end user - see https://docs.coinflow.cash/api-reference/api-reference/authentication/get-session-key

Request

Request body containing the parameters required for generating the credits authorization message.
merchantIdstringRequired
The ID of the merchant requesting redemption.
subtotalobjectRequired
transactionDataobjectRequired

(EVM only) if you want to execute an EVM transaction on a successful purchase, you can pass a transaction request here.

Gas fees for the transaction will be automatically calculated and added to the total charged to the customer. Optionally the merchant can opt to pay for these gas fees.

usdcAmountobjectOptional

Response

Ok
messagestring

EIP-712 typed-data JSON string for the user to sign via eth_signTypedData_v

validBeforestring
Timestamp indicating signature validity period
noncestring
Unique identifier for the transaction
creditsRawAmountdouble
Total amount of credits that will be used including gas fees

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

The session key generated for the end user - see https://docs.coinflow.cash/api-reference/api-reference/authentication/get-session-key