---
title: "Create Redeem Transaction"
method: POST
path: "/redeem"
tags: ["redeem"]
---

# Create Redeem Transaction

`POST /redeem`

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.

## Headers

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

## Request body

- RedeemBody
  - `merchantId` string, required
  - `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
  - `transaction` string, required — 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')`
  - `signedMessages` SignedMessages
    - `permitCredits` string, required — (Evm only) This is the signed permit messages that the user must sign granting the Merchant Contract access to their balances.
    - `customerUsdcAuthData` CustomerUsdcTransferData — Customer signed USDC transferWithAuthorization data for dual-source payments Used for combined USDC + Credit Card payments on EVM chains
      - `from` string, required
      - `to` string, required
      - `value` string, required
      - `validAfter` union, required
        - string
        - number, double
      - `validBefore` union, required
        - string
        - number, double
      - `nonce` string, required
      - `v` number, double, required
      - `r` string, required
      - `s` string, required
    - `customerUsdcAuthDataV2` CustomerUsdcTransferDataV2 — V2 of CustomerUsdcTransferData — replaces the (v, r, s) triple with a single `signature` bytes string, matching USDC FiatTokenV2_2's bytes-overload `transferWithAuthorization`. All other fields unchanged from V1.
      - `from` string, required
      - `to` string, required
      - `value` string, required
      - `validAfter` union, required
        - string
        - number, double
      - `validBefore` union, required
        - string
        - number, double
      - `nonce` string, required
      - `signature` string, required
  - `chargebackProtectionData` PickNftCartItemExcludeKeyofnftCartItemSellingPriceOrItemClass[]
    - `productName` string, required — The name of the related product
    - `productType` 'inGameProduct' | 'gameOfSkill' | 'dataStorage' | 'computingResources' | 'sportsTicket' | 'eSportsTicket' | 'musicTicket' | 'conferenceTicket' | 'virtualSportsTicket' | 'virtualESportsTicket' | 'virtualMusicTicket' | 'virtualConferenceTicket' | 'alcohol' | 'DLC' | 'subscription' | 'fundACause' | 'realEstate' | 'computingContract' | 'digitalArt' | 'topUp' | 'ownershipContract' | 'inGameCurrency' | 'digitalCollectibles' | 'digitalCollectiblesMarketplace' | 'digitalGiftingMarketplace' | 'sweepstakes' | 'virtualSportsEvents' | 'contractInvoicing' | 'onlineCasino' | 'cryptoOnramp' | 'gaming' | 'travelDocuments' | 'musicStreaming' | 'digitalContent' | 'eBooks' | 'digitalSubscriptionContent', required
    - `listPrice` PickNftCartItemExcludeKeyofnftCartItemSellingPriceOrItemClassListPrice — The item's list price
      - `currency` string
      - `valueInCurrency` number, double
    - `quantity` number, double, required — The number of units sold
    - `rawProductData` AnyObject
      - `example` string
    - `seller` SellerInfo
      - `id` string — Id of the seller
      - `email` string, nullable — Email Example: lois.lane@dailyplanet.com
      - `firstName` string — First name Example: Lois
      - `lastName` string — Last name Example: Lois
      - `dob` string — Date of birth, formatted as YYYY-MM-DD. If only the year is known, use YYYY Pattern: ^\d{4}(-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))?$
      - `rawSellerData` RecordStringAny — Construct a type with a set of properties K of type T
    - `transactionHistory` TransactionHistoryItem[]
      - `txType` string, required
      - `chain` string, required
      - `paymentAmount` string, required
      - `paymentToken` string, required
      - `to` string, required
      - `from` string, required
      - `registryContract` string, required
      - `assetID` string, required
      - `txTime` string, required
      - `blockNumber` number, double, required
      - `txHash` string, required
  - `rent` RedeemBodyRent — (Solana Only) if your transaction requires a known amount of Rent to be paid, you can pass it here.
    - `lamports` union, required
      - string
      - number, double
  - `nativeSolToConvert` RedeemBodyNativeSolToConvert — (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.
    - `lamports` union, required
      - string
      - number, double
  - `skipBalanceCheck` boolean

## Response `200`

Ok

- RedeemResponse
  - `transaction` string, required — 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());`

## 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)
