> ## Documentation Index
> Fetch the complete documentation index at: https://docs.swiftpay.cx/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Withdrawal

> Retrieve a specific withdrawal by ID

# Get Withdrawal

Retrieves the details of an existing withdrawal request.

## Request

<ParamField header="Authorization" type="string" required>
  Bearer token with your API key
</ParamField>

<ParamField path="id" type="string" required>
  The unique identifier of the withdrawal (e.g., `wd_abc123`)
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Whether the request was successful
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="id" type="string">
      Unique withdrawal identifier
    </ResponseField>

    <ResponseField name="amountInCents" type="integer">
      Withdrawal amount in cents
    </ResponseField>

    <ResponseField name="status" type="string">
      Current status: `pending`, `processing`, `completed`, `failed`,
      `cancelled`
    </ResponseField>

    <ResponseField name="destinationType" type="string">
      Type of withdrawal: `paypal` or `crypto`
    </ResponseField>

    <ResponseField name="destinationDetails" type="string">
      JSON string containing destination details
    </ResponseField>

    <ResponseField name="failureReason" type="string">
      Reason for failure (if status is `failed`)
    </ResponseField>

    <ResponseField name="processorTransactionId" type="string">
      External transaction identifier or hash
    </ResponseField>

    <ResponseField name="requestedAt" type="string">
      ISO 8601 creation timestamp
    </ResponseField>

    <ResponseField name="completedAt" type="string">
      ISO 8601 completion timestamp
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl https://api.swiftpay.cx/api/withdrawals/wd_abc123 \
    -H "Authorization: Bearer mp_live_your_api_key"
  ```

  ```javascript JavaScript theme={null}
  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;
  }
  ```

  ```python Python theme={null}
  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']}")
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "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"
    }
  }
  ```

  ```json 200 (Failed) theme={null}
  {
     "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
     }
  }
  ```

  ```json 404 theme={null}
  {
     "success": false,
     "error": {
        "type": "not_found",
        "message": "Withdrawal not found",
        "requestId": "req_abc123"
     }
  }
  ```
</ResponseExample>

<Tip>
  Use webhooks to get notified when withdrawal status changes rather than
  polling this endpoint.
</Tip>
