Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.prudra.dev/llms.txt

Use this file to discover all available pages before exploring further.

Track a withdrawal

After requesting a withdrawal, track its status by polling the API or by subscribing to the withdrawal.completed webhook.

Poll withdrawal status

import { initialise } from '@prudra/core';
import { getWithdrawal, listWithdrawals } from '@prudra/wallet';

initialise({ apiKey: process.env.PRUDRA_API_KEY! });

// Get a specific withdrawal
const w = await getWithdrawal({ withdrawalId: 'wdr_clx1abc123' });
console.log(w.status);       // 'pending_conversion' | 'conversion_complete' | 'completed'
console.log(w.txHash);       // on-chain transfer hash
console.log(w.reference);    // your reference

// List all withdrawals
const history = await listWithdrawals();
for (const withdrawal of history) {
  console.log(`${withdrawal.id}  ${withdrawal.reference}  ${withdrawal.status}`);
}
Via cURL:
curl https://api.prudra.dev/withdrawals/wdr_clx1abc123 \
  -H "Authorization: Bearer prv_test_sk_..."

Status lifecycle

StatusMeaningTypical duration
pending_conversionOn-chain confirmed, waiting for crypto→fiat sale0–4 hours
conversion_completeFiat ready, bank wire initiated1–3 business days
completedWire received at destination bankTerminal
failedError — contact support with your referenceTerminal

Webhook notification

Register for withdrawal.completed to be notified when the bank wire arrives:
// Register once
curl -X POST https://api.prudra.dev/webhooks \
  -H "Authorization: Bearer prv_test_sk_..." \
  -d '{
    "url": "https://your-server.com/webhooks/prudra",
    "events": ["withdrawal.completed", "withdrawal.failed"]
  }'
withdrawal.completed payload:
{
  "type":    "withdrawal.completed",
  "eventId": "evt_clx1abc123",
  "payload": {
    "withdrawalId": "wdr_clx1abc123",
    "walletId":     "mwt_clx1abc123",
    "amount":       "100.00",
    "token":        "USDC",
    "reference":    "WD-001",
    "completedAt":  "2026-05-02T14:30:00.000Z"
  }
}