Create a Coin Withdrawal Using Cryptopay API

·

To initiate a cryptocurrency withdrawal via Cryptopay’s API, you’ll need to provide specific payment details:

Required Payment Details

Special Cases for XRP/XLM:

⚠️ Important:


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

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

👉 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?

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.