Skip to main content

Check Status

Retrieve detailed information and current status of a withdrawal.

Endpoint

GET /api/withdraws/withdraws/{reference}

Parameters

ParameterTypeRequiredDescription
referenceStringUnique withdrawal reference (e.g. WTD1704067200000ABC123)

Request example

curl -X GET "https://app.awdpay.com/api/withdraws/withdraws/WTD1704067200000ABC123" \
-H "Authorization: Bearer $AWDPAY_TOKEN"

Response

{
"reference": "WTD1704067200000ABC123",
"status": "success",
"amount": 5000.00,
"currency": "XOF",
"beneficiaryName": "Amadou Diallo",
"beneficiaryPhone": "+221770123456",
"beneficiaryEmail": "amadou@example.com",
"country": "SN",
"gatewayName": "wave-senegal",
"createdAt": "2025-01-15T10:30:00Z",
"processedAt": "2025-01-15T10:30:45Z",
"expiresAt": "2025-01-15T11:30:00Z",
"failureReason": null,
"externalReference": "WAVE_TXN_987654",
"description": "Payment completed successfully"
}

Response fields

FieldTypeDescription
referenceStringUnique withdrawal reference
statusStringCurrent status (see table below)
amountDoubleWithdrawal amount
currencyStringCurrency code
beneficiaryNameStringBeneficiary name
beneficiaryPhoneStringPhone number
beneficiaryEmailStringBeneficiary email
countryStringCountry code
gatewayNameStringGateway used
createdAtDateTimeCreation date
processedAtDateTimeProcessing date (if completed)
expiresAtDateTimeExpiration date
failureReasonStringFailure reason (if failed)
externalReferenceStringExternal gateway reference
descriptionStringStatus description

Possible statuses

StatusDescriptionRecommended action
pendingWithdrawal created, awaiting processingWait or cancel
processingBeing processed by gatewayWait
success✅ Funds successfully transferred to beneficiaryCompleted
failed❌ Transfer failedCheck failureReason, retry
expired⏰ Withdrawal expired before processingCreate a new withdrawal
cancelled🚫 Withdrawal cancelledCreate a new withdrawal

Status flow diagram

┌─────────┐
│ pending │
└────┬────┘


┌────────────┐
│ processing │
└─────┬──────┘

├──────────────┬──────────────┐
▼ ▼ ▼
┌─────────┐ ┌─────────┐ ┌─────────┐
│ success │ │ failed │ │ expired │
└─────────┘ └─────────┘ └─────────┘
Polling strategy

For gateways without webhooks, query status with exponential backoff:

  • 1st attempt: after 5 seconds
  • 2nd attempt: after 15 seconds
  • 3rd attempt: after 30 seconds
  • Then every minute for max 10 minutes
async function pollWithdrawStatus(reference, maxAttempts = 10) {
const delays = [5000, 15000, 30000, 60000, 60000, 60000, 60000, 60000, 60000, 60000];

for (let i = 0; i < maxAttempts; i++) {
const response = await fetch(
`https://app.awdpay.com/api/withdraws/withdraws/${reference}`,
{ headers: { 'Authorization': `Bearer ${token}` } }
);

const data = await response.json();

if (['success', 'failed', 'expired', 'cancelled'].includes(data.status)) {
return data; // Final state reached
}

await new Promise(resolve => setTimeout(resolve, delays[i]));
}

throw new Error('Timeout: status not resolved');
}

Next step

➡️ List withdrawals — View your disbursement history