redeem

(EVM only) Get Credits Authorization Message

Changed on

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.
post/redeem/evm/creditsAuthMsg

Request

  • Base URL
    https://api-sandbox.coinflow.cash/api
  • URL
    https://api-sandbox.coinflow.cash/api/redeem/evm/creditsAuthMsg
  • Auth
    API key in header x-coinflow-auth-wallet

Request body

merchantIdstring required

The ID of the merchant requesting redemption.

Response

Ok

messagestring required

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

validBeforestring required

Timestamp indicating signature validity period

noncestring required

Unique identifier for the transaction

creditsRawAmountnumber double required

Total amount of credits that will be used including gas fees

Changes

    • warning

      deleted the header request parameter x-coinflow-auth-wallet

    • info

      the endpoint scheme security wallet was added to the API

    • info

      api operation id get-evm-credits-auth-msg removed and replaced with redeem_GetEvmCreditsAuthMsg