To initiate a cryptocurrency withdrawal via Cryptopay’s API, you’ll need to provide specific payment details:
Required Payment Details
- Payment Amount: e.g.,
100 - Payment Currency: e.g.,
EUR - Cryptocurrency Type: e.g.,
BTC - Destination Address: e.g.,
2MvWu1QjMuDWP4x3wZpPxhuVHpvfzBJmyw3
Special Cases for XRP/XLM:
- XRP: Requires a
destination_tag(similar to a bank reference number). - XLM: Uses a
memo_id.
⚠️ Important:
- Never leave the
destination_tagblank for XRP. Use0only if the recipient’s address is unique. - Incorrect tags may result in permanent loss of funds for shared wallets.
API Request Example
curl -X POST \
https://business-sandbox.cryptopay.me/api/coin_withdrawals \
-H 'Authorization: HMAC ***' \
-H 'Content-Type: application/json' \
-H 'Date: Tue, 19 Mar 2019 10:11:40 GMT' \
-d '{
"charged_currency": "EUR",
"charged_amount_to_send": "100",
"address": "2MyYeAkU162aMh3otEhYHP9yhUR7xqS7S1r",
"received_currency": "BTC",
"network": "bitcoin",
"custom_id": "113562013",
"force_commit": "false"
}'Key Parameters Explained
| Parameter | Description |
|-----------|------------|
| charged_amount_to_send | Amount to deduct from merchant balance (fees excluded). |
| charged_currency | Payment currency (e.g., EUR). |
| address | Recipient’s wallet address. |
| network | Blockchain network (e.g., bitcoin). |
| custom_id | Merchant’s reference ID (e.g., 113562013). |
| force_commit | Two-step withdrawal flag (default: false). |
👉 Pro Tip: Use Cryptopay’s network guide to verify supported blockchains.
Fee Handling: charged_amount vs. charged_amount_to_send
charged_amount_to_send: Fees are deducted separately; recipient gets the full amount.charged_amount: Fees are included in the transaction (recipient receives less).
Example API Response:
{
"data": {
"id": "945965c5-737f-4716-a55d-0392129843f5",
"status": "pending",
"charged_amount": "100.0",
"received_amount": "0.00318659",
"network_fee": "0.0000054"
}
}Withdrawal Statuses
- Pending: Request received.
- Completed: Transaction broadcasted (confirmation time varies by network).
- Failed: Funds refunded to merchant (usually within hours).
👉 Best Practice: Always verify status via a retrieval request. Callbacks aren’t guaranteed.
FAQ
Q1: Can I omit the destination_tag for XRP?
No. Use 0 for unique addresses only.
Q2: How long do failed withdrawals take to refund?
Typically minutes to hours—no action needed.
Q3: What’s the difference between network_fee and fee?
network_fee: Miner fee.fee: Cryptopay service charge.
Q4: Is force_commit mandatory?
No. Defaults to false (30-second commit window).
Q5: Why does charged_amount_to_send show a higher charged amount?
It includes fees added to the merchant’s balance (e.g., 101.19 EUR for a 100 EUR send).
Q6: How do I track a withdrawal?
Use the id from the API response with a status request.