Skip to main content

Preview Card Purchase

This endpoint provides a preview of a card purchase, including fees, exchange rate, and the final amount of cryptocurrency the user will receive.

Authorization:

bearer

HTTP: bearer

HTTP Authorization Scheme: bearer

Headers:
Authorization: APIKey {YOUR_API_KEY}

Endpoint

POST

/api/v2/cards/purchase/preview

Request Body Sample​

{
"accountId": "00000000-0000-0000-0000-000000000000",
"amount": 100.00,
"currency": "USD",
"coin": "USDC"
}

Request Body Schema​

FieldTypeDescription
accountIdstring (uuid)Required. The account ID for the purchase.
amountnumberRequired. Amount in fiat currency to charge to the card. Minimum: $10.00. Example: 100.00.
currencystringRequired. Fiat currency. Currently only USD is supported.
coinstringRequired. Cryptocurrency to purchase. Possible values: USDC, USDT.

Response Sample​

{
"previewId": "33333333-3333-3333-3333-333333333333",
"amount": "100.00",
"currency": "USD",
"estimatedQuoteAmount": "97.50",
"estimatedQuoteCurrency": "USDC",
"estimatedRate": "1.00",
"estimatedFee": "2.50",
"estimatedFeeCurrency": "USD",
"estimatedNetworkFee": "0.00",
"estimatedNetworkFeeCurrency": "USD",
"expiresAt": "2025-01-01T12:01:00Z"
}

Response Schema​

FieldTypeDescription
previewIdstring (uuid)Unique preview ID for this purchase preview. Can be used to execute the purchase with locked rates.
amountstring (decimal)Amount in fiat currency that will be charged to the card. Example: "100.00".
currencystringFiat currency. Example: USD.
estimatedQuoteAmountstring (decimal)Estimated amount of cryptocurrency the user will receive (after fees deducted). Example: "97.50".
estimatedQuoteCurrencystringCurrency of the estimated quote. Example: USDC.
estimatedRatestring (decimal)Estimated exchange rate for fiat to the selected cryptocurrency. Example: "1.00".
estimatedFeestring (decimal)Estimated card processing fee in fiat currency (deducted from amount). Example: "2.50".
estimatedFeeCurrencystringCurrency of the estimated fee. Example: USD.
estimatedNetworkFeestring (decimal)Estimated blockchain network fee in fiat currency (deducted from amount). Example: "0.00".
estimatedNetworkFeeCurrencystringCurrency of the estimated network fee. Example: USD.
expiresAtstringPreview expiration time in ISO 8601 format. Example: 2025-01-01T12:01:00Z.

Understanding the Preview Response​

Fee Breakdown​

Fee TypeFieldDescription
Processing FeeestimatedFeeCard payment processing fee (deducted from amount).
Network FeeestimatedNetworkFeeBlockchain transaction fee (deducted from amount).

Crypto Amount Calculation​

Step 1: Calculate USD after fees
USD After Fees = amount - estimatedFee - estimatedNetworkFee

Step 2: Convert to crypto using exchange rate
Crypto You Receive = (USD After Fees) × estimatedRate

Example 1: (1:1 rate)

Card Charge (amount): $100.00
Processing Fee: $ 2.50 (deducted)
Network Fee: $ 0.00 (deducted)
─────────────────────────────────────────────
USD After Fees: $ 97.50
Exchange Rate (estimatedRate): × 1.00
─────────────────────────────────────────────
Crypto You Will Receive: 97.50 USDC (estimatedQuoteAmount)

Example 2: (variable rate)

Card Charge (amount): $100.00
Processing Fee: $ 2.50 (deducted)
Network Fee: $ 0.00 (deducted)
─────────────────────────────────────────────
USD After Fees: $ 97.50
Exchange Rate (estimatedRate): × 0.98 (market rate)
─────────────────────────────────────────────
Crypto You Will Receive: 95.55 USDC (estimatedQuoteAmount)

How It Works​

  1. Card is charged: amount in fiat currency ($100.00)
  2. Fees are deducted: estimatedFee + estimatedNetworkFee ($2.50)
  3. Fiat after fees calculated: $97.50
  4. Exchange rate applied: $97.50 × estimatedRate
  5. Crypto is delivered: estimatedQuoteAmount (amount varies based on rate)

Support and Resources​

If you need assistance or have any questions, our support team is here to help. You can contact our support team at support@blockwyre.com.

Stay Updated​

Stay up-to-date with the latest news, updates, and features from BlockWyre by following us on social media:

We are excited to have you on board and look forward to seeing how you leverage BlockWyre's powerful tools to enhance your financial operations. Happy integrating!