curl https://api.swiftpay.cx/api/withdrawals/wd_abc123 \
-H "Authorization: Bearer mp_live_your_api_key"
const withdrawalId = "wd_abc123";
const response = await fetch(
`https://api.swiftpay.cx/api/withdrawals/${withdrawalId}`,
{
headers: {
Authorization: "Bearer mp_live_your_api_key",
},
}
);
const withdrawal = await response.json();
switch (withdrawal.data.status) {
case "completed":
console.log("Withdrawal successful!");
if (withdrawal.data.transactionHash) {
console.log(`TX: ${withdrawal.data.transactionHash}`);
}
break;
case "failed":
console.log(`Failed: ${withdrawal.data.failureReason}`);
break;
case "pending":
case "processing":
console.log("Still processing...");
break;
}
import requests
withdrawal_id = 'wd_abc123'
response = requests.get(
f'https://api.swiftpay.cx/api/withdrawals/{withdrawal_id}',
headers={'Authorization': 'Bearer mp_live_your_api_key'}
)
withdrawal = response.json()
print(f"Status: {withdrawal['data']['status']}")
{
"success": true,
"data": {
"id": "wd_abc123",
"amountInCents": 5000,
"status": "completed",
"destinationType": "paypal",
"destinationDetails": "{\"paypalEmail\":\"user@example.com\"}",
"processorTransactionId": "PAY-123456789",
"requestedAt": "2024-01-15T10:30:00Z",
"completedAt": "2024-01-15T14:00:00Z"
}
}
{
"success": true,
"data": {
"id": "wd_def456",
"amountInCents": 2500,
"status": "failed",
"destinationType": "crypto",
"destinationDetails": "{\"cryptoCoin\":\"USDT\",\"cryptoNetwork\":\"TRC20\",\"cryptoAddress\":\"T...\"}",
"failureReason": "Invalid wallet address",
"requestedAt": "2024-01-16T09:00:00Z",
"completedAt": null
}
}
{
"success": false,
"error": {
"type": "not_found",
"message": "Withdrawal not found",
"requestId": "req_abc123"
}
}
Withdrawals
Get Withdrawal
Retrieve a specific withdrawal by ID
GET
/
api
/
withdrawals
/
:id
curl https://api.swiftpay.cx/api/withdrawals/wd_abc123 \
-H "Authorization: Bearer mp_live_your_api_key"
const withdrawalId = "wd_abc123";
const response = await fetch(
`https://api.swiftpay.cx/api/withdrawals/${withdrawalId}`,
{
headers: {
Authorization: "Bearer mp_live_your_api_key",
},
}
);
const withdrawal = await response.json();
switch (withdrawal.data.status) {
case "completed":
console.log("Withdrawal successful!");
if (withdrawal.data.transactionHash) {
console.log(`TX: ${withdrawal.data.transactionHash}`);
}
break;
case "failed":
console.log(`Failed: ${withdrawal.data.failureReason}`);
break;
case "pending":
case "processing":
console.log("Still processing...");
break;
}
import requests
withdrawal_id = 'wd_abc123'
response = requests.get(
f'https://api.swiftpay.cx/api/withdrawals/{withdrawal_id}',
headers={'Authorization': 'Bearer mp_live_your_api_key'}
)
withdrawal = response.json()
print(f"Status: {withdrawal['data']['status']}")
{
"success": true,
"data": {
"id": "wd_abc123",
"amountInCents": 5000,
"status": "completed",
"destinationType": "paypal",
"destinationDetails": "{\"paypalEmail\":\"user@example.com\"}",
"processorTransactionId": "PAY-123456789",
"requestedAt": "2024-01-15T10:30:00Z",
"completedAt": "2024-01-15T14:00:00Z"
}
}
{
"success": true,
"data": {
"id": "wd_def456",
"amountInCents": 2500,
"status": "failed",
"destinationType": "crypto",
"destinationDetails": "{\"cryptoCoin\":\"USDT\",\"cryptoNetwork\":\"TRC20\",\"cryptoAddress\":\"T...\"}",
"failureReason": "Invalid wallet address",
"requestedAt": "2024-01-16T09:00:00Z",
"completedAt": null
}
}
{
"success": false,
"error": {
"type": "not_found",
"message": "Withdrawal not found",
"requestId": "req_abc123"
}
}
Get Withdrawal
Retrieves the details of an existing withdrawal request.Request
Bearer token with your API key
The unique identifier of the withdrawal (e.g.,
wd_abc123)Response
Whether the request was successful
Show properties
Show properties
Unique withdrawal identifier
Withdrawal amount in cents
Current status:
pending, processing, completed, failed,
cancelledType of withdrawal:
paypal or cryptoJSON string containing destination details
Reason for failure (if status is
failed)External transaction identifier or hash
ISO 8601 creation timestamp
ISO 8601 completion timestamp
curl https://api.swiftpay.cx/api/withdrawals/wd_abc123 \
-H "Authorization: Bearer mp_live_your_api_key"
const withdrawalId = "wd_abc123";
const response = await fetch(
`https://api.swiftpay.cx/api/withdrawals/${withdrawalId}`,
{
headers: {
Authorization: "Bearer mp_live_your_api_key",
},
}
);
const withdrawal = await response.json();
switch (withdrawal.data.status) {
case "completed":
console.log("Withdrawal successful!");
if (withdrawal.data.transactionHash) {
console.log(`TX: ${withdrawal.data.transactionHash}`);
}
break;
case "failed":
console.log(`Failed: ${withdrawal.data.failureReason}`);
break;
case "pending":
case "processing":
console.log("Still processing...");
break;
}
import requests
withdrawal_id = 'wd_abc123'
response = requests.get(
f'https://api.swiftpay.cx/api/withdrawals/{withdrawal_id}',
headers={'Authorization': 'Bearer mp_live_your_api_key'}
)
withdrawal = response.json()
print(f"Status: {withdrawal['data']['status']}")
{
"success": true,
"data": {
"id": "wd_abc123",
"amountInCents": 5000,
"status": "completed",
"destinationType": "paypal",
"destinationDetails": "{\"paypalEmail\":\"user@example.com\"}",
"processorTransactionId": "PAY-123456789",
"requestedAt": "2024-01-15T10:30:00Z",
"completedAt": "2024-01-15T14:00:00Z"
}
}
{
"success": true,
"data": {
"id": "wd_def456",
"amountInCents": 2500,
"status": "failed",
"destinationType": "crypto",
"destinationDetails": "{\"cryptoCoin\":\"USDT\",\"cryptoNetwork\":\"TRC20\",\"cryptoAddress\":\"T...\"}",
"failureReason": "Invalid wallet address",
"requestedAt": "2024-01-16T09:00:00Z",
"completedAt": null
}
}
{
"success": false,
"error": {
"type": "not_found",
"message": "Withdrawal not found",
"requestId": "req_abc123"
}
}
Use webhooks to get notified when withdrawal status changes rather than
polling this endpoint.
⌘I