Buy Crypto: Card Payment

In a card Buy trade, the end-user pays with a credit or debit card, Apple Pay or Google Pay, and receives cryptocurrency at a wallet address. You create the trade through the API, then send the end-user to Coinify’s Payment Page to pay.

ℹ️

Using the Trade Widget or SDK? The widget handles this entire flow, so there is nothing to implement. This page applies to Full API Integration →.


Payment methods

The payment method is set with the transferIn.medium field of the trade. For a Buy trade, transferOut.medium is always blockchain.

transferIn.mediumPayment methodNotes
cardCredit or debit cardCovered on this page.
applepayApple PayNeeds a separate setup.
googlepayGoogle PayEnabled by default
bankBank transferA different flow; see Buy Crypto: Bank Transfer

Which methods you can offer depends on the end-user’s country and currency. See Payment Methods →.


How it works

  1. Get a trade quote for the trade.
  2. Create the trade with the quote ID and a returnUrl.
  3. Redirect the end-user to the redirectUrl returned in the response.
  4. The end-user pays on the Payment Page and is returned to your returnUrl.
  5. Wait for the webhook that confirms the outcome.

Step 1: Get a trade quote

Request a quote with the end-user’s chosen payment method as the transferIn medium and blockchain as the transferOut medium. See Trade Quotes → for details, including fees-included vs fees-on-top and quote expiry.

Card Buy quotes are valid for 15 minutes, so create the trade promptly after the end-user confirms the order summary.

ℹ️

Quote expiry is yours to handle. The Trade Widget automatically offers the end-user a new quote when one expires. In a full API integration there is no such built-in mechanism. Check the quote’s expiryTime before creating the trade, and if it has passed, request a new quote, either automatically or when the end-user asks for it.


Step 2: Create the trade

Call Create a Buy Trade: Credit Card → with the end-user’s access token:

curl --location 'https://app-api.sandbox.coinify.com/trades' \
--header 'Authorization: Bearer eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3OTE1Mzk0ODQsImV4cCI6MTc5MTU0MDY4NCwidWlkIjo1ODYxNywiZXYiOnRydWUsInNjIjp7InRfMTM0NTAiOiIqIn19.IugqNPJbR094I01me53WSfbGFDGcS88n9IPq5R89yF4d0OO3oqoGZdlVeMx3snKxf8trJVHvLMRVSCRtjafNdg' \
--header 'Origin: https://trade.coinify.com' \
--header 'referer: https://trade.coinify.com/' \
--header 'sec-ch-ua: \' \
--data '{
  "priceQuoteId": 123456,
  "transferIn": {
    "medium": "card",
    "details": {
      "returnUrl":"https://yourapp.com/payment-return"
    }
  },
  "transferOut": {
    "medium": "blockchain",
    "details": {
      "account": "<end-user wallet address>"
    }
  },
  "partnerContext": { "orderId": "your-internal-order-id" }
}'

Did this page help you?