redeem

Create Redeem Transaction

Changed on

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.

post/redeem

Request

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

Headers

x-device-idstring

Request body

merchantIdstring required
transactionstring 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')

skipBalanceCheckboolean

Response

Ok

transactionstring 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());

Changes

    • breaking

      request property / list-of-types was narrowed by removing types number from media type application/json

    • breaking

      request property / list-of-types was narrowed by removing types number from media type application/json

    • breaking

      the // request property type changed from number to integer, and format from double to no format

    • breaking

      the // request property type changed from number to integer, and format from double to no format

    • warning

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

    • info

      the endpoint scheme security wallet was added to the API