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
| Field | Type | Description |
|---|---|---|
accountId | string (uuid) | Required. The account ID for the purchase. |
amount | number | Required. Amount in fiat currency to charge to the card. Minimum: $10.00. Example: 100.00. |
currency | string | Required. Fiat currency. Currently only USD is supported. |
coin | string | Required. 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
| Field | Type | Description |
|---|---|---|
previewId | string (uuid) | Unique preview ID for this purchase preview. Can be used to execute the purchase with locked rates. |
amount | string (decimal) | Amount in fiat currency that will be charged to the card. Example: "100.00". |
currency | string | Fiat currency. Example: USD. |
estimatedQuoteAmount | string (decimal) | Estimated amount of cryptocurrency the user will receive (after fees deducted). Example: "97.50". |
estimatedQuoteCurrency | string | Currency of the estimated quote. Example: USDC. |
estimatedRate | string (decimal) | Estimated exchange rate for fiat to the selected cryptocurrency. Example: "1.00". |
estimatedFee | string (decimal) | Estimated card processing fee in fiat currency (deducted from amount). Example: "2.50". |
estimatedFeeCurrency | string | Currency of the estimated fee. Example: USD. |
estimatedNetworkFee | string (decimal) | Estimated blockchain network fee in fiat currency (deducted from amount). Example: "0.00". |
estimatedNetworkFeeCurrency | string | Currency of the estimated network fee. Example: USD. |
expiresAt | string | Preview expiration time in ISO 8601 format. Example: 2025-01-01T12:01:00Z. |
Understanding the Preview Response
Fee Breakdown
| Fee Type | Field | Description |
|---|---|---|
| Processing Fee | estimatedFee | Card payment processing fee (deducted from amount). |
| Network Fee | estimatedNetworkFee | Blockchain 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
- Card is charged:
amountin fiat currency ($100.00) - Fees are deducted:
estimatedFee+estimatedNetworkFee($2.50) - Fiat after fees calculated: $97.50
- Exchange rate applied: $97.50 ×
estimatedRate - 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:
- Instagram: BlockWyre Instagram
- Twitter: BlockWyre Twitter
- Facebook: BlockWyre Facebook
- LinkedIn: BlockWyre LinkedIn
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!