---
title: "(EVM only) Get Credits Authorization Message"
method: POST
path: "/redeem/evm/creditsAuthMsg"
tags: ["redeem"]
---

# (EVM only) Get Credits Authorization Message

`POST /redeem/evm/creditsAuthMsg`

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.

## Headers

- `x-coinflow-auth-wallet` string, required

## Request body

- GetEvmCreditsAuthMsgBody
  - `merchantId` string, required — The ID of the merchant requesting redemption.
  - `subtotal` union, required
    - CurrencyCents
      - `cents` integer, required
      - `currency` 'USD' | 'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BZD' | 'CAD' | 'CHF' | 'CLF' | 'CLP' | 'CNY' | 'COP' | 'CRC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ETB' | 'EUR' | 'FJD' | 'GBP' | 'GEL' | 'GHS' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRU' | 'MUR' | 'MWK' | 'MVR' | 'MXN' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RWF' | 'SAR' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SLE' | 'SLL' | 'SOS' | 'SRD' | 'STN' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'UYU' | 'UZS' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XCD' | 'XOF' | 'XPF' | 'YER' | 'ZAR' | 'ZMW' | 'ZWL' | 'CDF' | 'ERN' | 'FKP' | 'KPW' | 'RUB' | 'SBD' | 'SHP' | 'SSP' | 'VES', required
    - Cents
      - `cents` integer, required
    - TokenSubtotal
      - `address` string, required — The tokens address Solana - Token Mint Address Evm - Token Contract Address
      - `amount` union, required — Number of tokens
        - number, double
        - string
      - `decimals` number, double — Number of decimals for the token
  - `transactionData` union, required — (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.
    - SafeMintRedeem — (EVM only) If your contract mints an NFT via a OpenZeppelin Safe Mint Call, then utilize this object. The contract mints the NFT to msg.sender (which is the Coinflow contract), the Coinflow contract picks up the SafeMint event, and fwd's the NFT to the end user's wallet.
      - `waitForHash` boolean — Whether the UI should wait for the transaction to be sent and the hash to be returned.
      - `transaction` SafeMintRedeemTransaction, required — Transaction to be called.
        - `data` string, required — The data to call this contract with, HEX encoded. The coinflow contract calls the "to" contract, contract pulls USDC from msg.sender, and transfers the NFT/item to the "receiver" address defined in the contract function arguments.
        - `to` string, required — The merchant's whitelisted contract
      - `type` 'safeMint', required
      - `nftContract` string
    - ReturnedTokenIdRedeem — (EVM only) If your contract returns the NFT ID, then utilize this object. The contract mints the NFT to msg.sender (which is the Coinflow contract), the Coinflow contract picks up the returned NFT ID, and fwd's the NFT to the end user's wallet.
      - `waitForHash` boolean — Whether the UI should wait for the transaction to be sent and the hash to be returned.
      - `transaction` ReturnedTokenIdRedeemTransaction, required — Transaction to be called.
        - `data` string, required — The data to call this contract with, HEX encoded. The coinflow contract calls the "to" contract, contract pulls USDC from msg.sender, and transfers the NFT/item to the "receiver" address defined in the contract function arguments.
        - `to` string, required — The merchant's whitelisted contract
      - `type` 'returned', required
      - `nftContract` string
    - KnownTokenIdRedeem — (EVM only) If your know the ID of the NFT being purchased, then utilize this object. The contract transfers the NFT to msg.sender (which is the Coinflow contract), the Coinflow contract fwd's the NFT to the end user's wallet.
      - `waitForHash` boolean — Whether the UI should wait for the transaction to be sent and the hash to be returned.
      - `transaction` KnownTokenIdRedeemTransaction, required — Transaction to be called.
        - `data` string, required — The data to call this contract with, HEX encoded. The coinflow contract calls the "to" contract, contract pulls USDC from msg.sender, and transfers the NFT/item to the "receiver" address defined in the contract function arguments.
        - `to` string, required — The merchant's whitelisted contract
      - `nftContract` string, required — The address of the Nft's Contract
      - `nftId` string, required — The ID of the NFT being purchased. Will be forwarded by the Coinflow contract to the customer's wallet.
    - NormalRedeem — (EVM only) If your contract sends the item/service being purchased via a custom "receiver" field, then utilize this object. The coinflow contract calls the "to" contract, which transfers the NFT/item to the "receiver" address defined in the contract function arguments.
      - `waitForHash` boolean — Whether the UI should wait for the transaction to be sent and the hash to be returned.
      - `transaction` NormalRedeemTransaction, required — Transaction to be called.
        - `data` string, required — The data to call this contract with, HEX encoded. The coinflow contract calls the "to" contract, contract pulls USDC from msg.sender, and transfers the NFT/item to the "receiver" address defined in the contract function arguments.
        - `to` string, required — The merchant's whitelisted contract
    - TokenRedeem
      - `waitForHash` boolean — Whether the UI should wait for the transaction to be sent and the hash to be returned.
      - `type` 'token', required
      - `destination` string, required
    - DecentRedeem — If your contract exists on a chain supported by Decent, pass this object in order to call it.
      - `waitForHash` boolean — Whether the UI should wait for the transaction to be sent and the hash to be returned.
      - `type` 'decent', required
      - `dstChainId` number, double, required — ID of the destination chain you will be using Find your chain ID here: https://chainlist.org/
      - `dstToken` string, required — Address on that chain of the token you will be receiving
      - `contractAddress` string, required — The contract address which will be called on the destination chain
      - `contractData` string, required
      - `cost` DecentRedeemCost, required — Amount of the token on the destination chain you will be receiving
        - `isNative` boolean, required — Whether or not the token is the native token for the chain (ex: Ethereum - ETH, Polygon - POL). If native dstToken should be the 0 address (0x00...)
        - `amount` string, required — This is the raw amount of the token ex: 50000000000000n
  - `usdcAmount` Cents
    - `cents` integer, required

## Response `200`

Ok

- GetCreditsAuthMessageResponse — For retrieving the typed-data (EIP-712) that a user must sign to authorize credits usage.
  - `message` string, required — EIP-712 typed-data JSON string for the user to sign via eth_signTypedData_v
  - `validBefore` string, required — Timestamp indicating signature validity period
  - `nonce` string, required — Unique identifier for the transaction
  - `creditsRawAmount` number, double, required — Total amount of credits that will be used including gas fees

## Other responses

- `412` — Wallet does not have enough credits to complete redeem request, this can happen when the network is slow. Please retry the request.

---

[API](https://skmtc.net/coinflow/apis/api-reference.md) · [All operations](https://skmtc.net/coinflow/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/coinflow/api-reference/versions/3f6a046fbb34/schema)
