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

# Withdrawal callbacks

Withdrawal callbacks are sent whenever the status of a withdrawal changes.

To identify the customer to whom the funds were withdrawn, use the `end_user_reference` field.

<Tabs>
  <Tab title="Confirmed">
    Sent when a withdrawal has been successfully completed and can be treated as final on your side.

    ```json highlight={46} theme={null}
    {
        "id": 1,
        "foreign_id": "1",
        "end_user_reference": "12345",
        "type": "withdrawal",
        "crypto_address": {
            "id": 1,
            "currency": "BTC",
            "address": "115Mn1jCjBh1CNqug7yAB21Hq2rw8PfmTA",
            "tag": null
        },
        "currency_sent": {
            "currency": "BTC",
            "amount": "0.02000000"
        },
        "currency_received": {
            "currency": "BTC",
            "amount": "0.02000000"
        },
        "transactions": [
            {
                "id": 1,
                "currency": "BTC",
                "transaction_type": "blockchain",
                "type": "withdrawal",
                "address": "115Mn1jCjBh1CNqug7yAB21Hq2rw8PfmTA",
                "tag": null,
                "amount": "0.02",
                "txid": "bb040d895ef7141ea0b06b04227d8f5dd4ee12d5b890e6e5633f6439393a666b",
                "confirmations": 3
            }
        ],
        "fees": [
            {
                "type": "mining",
                "currency": "BTC",
                "amount": "0.00007402"
            },
            {
                "type": "withdrawal",
                "currency": "BTC",
                "amount": "0.00002000"
            }
        ],
        "error": "",
        "status": "confirmed"
    }
    ```
  </Tab>

  <Tab title="Confirmed (with conversion)">
    Sent when a withdrawal with conversion has been successfully completed and can be treated as final on your side.

    ```json highlight={44} theme={null}
    {
      "id": 132506129,
      "foreign_id": "2",
      "end_user_reference": "12345",
      "type": "withdrawal_exchange",
      "crypto_address": {
        "id": 3776973,
        "currency": "ETH",
        "address": "0x071B2E45e2CD08011555755b93d5C76D2E62C4Cd",
        "tag": null
      },
      "currency_sent": {
        "currency": "BTC",
        "amount": "0.02000000"
      },
      "currency_received": {
        "currency": "ETH",
        "amount": "0.67715984"
      },
      "transactions": [
        {
          "id": 3745619,
          "currency": "ETH",
          "transaction_type": "blockchain",
          "type": "withdrawal",
          "address": "0x071B2E45e2CD08011555755b93d5C76D2E62C4Cd",
          "tag": null,
          "amount": "0.67715984",
          "txid": "0x12882dbbd810304bd0d9707472dbb40f8c2f7d9a1e6b3c4d5f60718293a4b5c6",
          "confirmations": "0"
        },
        {
          "id": 3745620,
          "currency": "BTC",
          "currency_to": "ETH",
          "transaction_type": "exchange",
          "type": "exchange",
          "amount": "0.02000000",
          "amount_to": "0.67715984"
        }
      ],
      "fees": [],
      "error": "",
      "status": "confirmed"
    }
    ```
  </Tab>

  <Tab title="Pending">
    Sent when a withdrawal exceeds the [configured withdrawals limits](/getting-started/change-withdrawal-limits) and is awaiting approval from a user with the **Owner** role.

    ```json highlight={28} theme={null}
    {
      "id": 123,
      "foreign_id": "3",
      "end_user_reference": "12345",
      "type": "withdrawal",
      "crypto_address": {
        "id": 111,
        "currency": "BTC",
        "address": "2NABXHSo83d61j9r4qGdn2x74UkVr6PdaPD",
        "tag": null
      },
      "transactions": [
        {
          "id": 999,
          "currency": "BTC",
          "transaction_type": "blockchain",
          "type": "withdrawal",
          "address": "2NABXHSo83d61j9r4qGdn2x74UkVr6PdaPD",
          "tag": null,
          "amount": "1",
          "txid": "bb040d895ef7141ea0b06b04227d8f5dd4ee12d5b890e6e5633f6439393a666b",
          "riskscore": null,
          "confirmations": "0"
        }
      ],
      "fees": [],
      "error": "",
      "status": "pending"
    }
    ```
  </Tab>

  <Tab title="Declined">
    Sent when a user with the **Owner** role declines a withdrawal that exceeds the [configured withdrawals limits](/getting-started/change-withdrawal-limits).

    ```json highlight={27-28} theme={null}
    {
      "id": 123,
      "foreign_id": "5",
      "end_user_reference": "12345",
      "type": "withdrawal",
      "crypto_address": {
        "id": 111,
        "currency": "BTC",
        "address": "2NABXHSo83d61j9r4qGdn2x74UkVr6PdaPD",
        "tag": null
      },
      "transactions": [
        {
          "id": 999,
          "currency": "BTC",
          "transaction_type": "blockchain",
          "type": "withdrawal",
          "address": "2NABXHSo83d61j9r4qGdn2x74UkVr6PdaPD",
          "tag": null,
          "amount": "2",
          "txid": "bb040d895ef7141ea0b06b04227d8f5dd4ee12d5b890e6e5633f6439393a666b",
          "riskscore": null,
          "confirmations": "0"
        }
      ],
      "fees": [],
      "error": "Declined by user ID:777",
      "status": "declined"
    }
    ```
  </Tab>

  <Tab title="Cancelled">
    Sent when a withdrawal is cancelled and will not be completed. Use the `error` field to determine the reason.

    ```json highlight={27-28} theme={null}
    {
      "id": 123,
      "foreign_id": "4",
      "end_user_reference": "12345",
      "type": "withdrawal",
      "crypto_address": {
        "id": 111,
        "currency": "BTC",
        "address": "2NABXHSo83d61j9r4qGdn2x74UkVr6PdaPD",
        "tag": null
      },
      "transactions": [
        {
          "id": 999,
          "currency": "BTC",
          "transaction_type": "blockchain",
          "type": "withdrawal",
          "address": "2NABXHSo83d61j9r4qGdn2x74UkVr6PdaPD",
          "tag": null,
          "amount": "10",
          "txid": "bb040d895ef7141ea0b06b04227d8f5dd4ee12d5b890e6e5633f6439393a666b",
          "riskscore": null,
          "confirmations": "0"
        }
      ],
      "fees": [],
      "error": "<error message>",
      "status": "cancelled"
    }
    ```
  </Tab>
</Tabs>
