> ## 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.

Use the `status` field to determine if the operation was successful or not. For cancelled or declined operations, use the `error` field to determine the reason.

Use the `end_user_reference` field to identify the customer who received the withdrawn funds.

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

    <CodeGroup>
      ```json title="Standard withdrawal" highlight={27} theme={null}
      {
        "id": 123,
        "foreign_id": "operation_987",
        "end_user_reference": "user_12345",
        "type": "withdrawal",
        "crypto_address": {
          "id": 123,
          "currency": "BTC",
          "address": "tb1qurv0m4ufsj8xqejvmn0y43kqew33kvqrrxswgm",
          "tag": null
        },
        "transactions": [
          {
            "id": 999,
            "currency": "BTC",
            "transaction_type": "blockchain",
            "type": "withdrawal",
            "address": "tb1qurv0m4ufsj8xqejvmn0y43kqew33kvqrrxswgm",
            "tag": null,
            "amount": "0.01000000",
            "txid": "bb040d895ef7141ea0b06b04227d8f5dd4ee12d5b890e6e5633f6439393a666b",
            "confirmations": "0"
          }
        ],
        "fees": [],
        "error": "",
        "status": "confirmed"
      }
      ```

      ```json title="Instant withdrawal" highlight={38} theme={null}
      {
        "id": 123,
        "foreign_id": "operation_987",
        "end_user_reference": "user_12345",
        "type": "withdrawal_instant",
        "crypto_address": {
          "id": 123,
          "currency": "BTC",
          "address": "tb1qurv0m4ufsj8xqejvmn0y43kqew33kvqrrxswgm",
          "tag": null
        },
        "transactions": [
          {
            "id": 999,
            "currency": "BTC",
            "transaction_type": "blockchain",
            "type": "withdrawal",
            "address": "tb1qurv0m4ufsj8xqejvmn0y43kqew33kvqrrxswgm",
            "tag": null,
            "amount": "0.01000000",
            "txid": "bb040d895ef7141ea0b06b04227d8f5dd4ee12d5b890e6e5633f6439393a666b",
            "confirmations": "0"
          }
        ],
        "fees": [
          {
            "type": "mining",
            "currency": "BTC",
            "amount": "0"
          },
          {
            "type": "fee_crypto_withdrawal_from_crypto",
            "currency": "BTC",
            "amount": "0.00028735"
          }
        ],
        "error": "",
        "status": "confirmed"
      }
      ```
    </CodeGroup>
  </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.

    <CodeGroup>
      ```json title="Standard withdrawal" highlight={44} theme={null}
      {
        "id": 123,
        "foreign_id": "operation_987",
        "end_user_reference": "user_12345",
        "type": "withdrawal_exchange",
        "crypto_address": {
          "id": 123,
          "currency": "BTC",
          "address": "tb1qurv0m4ufsj8xqejvmn0y43kqew33kvqrrxswgm",
          "tag": null
        },
        "currency_sent": {
          "currency": "EUR",
          "amount": "804.25693204"
        },
        "currency_received": {
          "currency": "BTC",
          "amount": "0.01000000"
        },
        "transactions": [
          {
            "id": 999,
            "currency": "BTC",
            "transaction_type": "blockchain",
            "type": "withdrawal",
            "address": "tb1qurv0m4ufsj8xqejvmn0y43kqew33kvqrrxswgm",
            "tag": null,
            "amount": "0.01000000",
            "txid": "bb040d895ef7141ea0b06b04227d8f5dd4ee12d5b890e6e5633f6439393a666b",
            "confirmations": "0"
          },
          {
            "id": 1000,
            "currency": "EUR",
            "currency_to": "BTC",
            "transaction_type": "exchange",
            "type": "exchange",
            "amount": "804.25693204",
            "amount_to": "0.01000000"
          }
        ],
        "fees": [
          {
            "type": "fee_crypto_withdrawal_from_fiat",
            "currency": "BTC",
            "amount": "0.00028735"
          }
        ],
        "error": "",
        "status": "confirmed"
      }
      ```

      ```json title="Instant withdrawal" highlight={55} theme={null}
      {
        "id": 123,
        "foreign_id": "operation_987",
        "end_user_reference": "user_12345",
        "type": "withdrawal_instant_exchange",
        "crypto_address": {
          "id": 123,
          "currency": "BTC",
          "address": "tb1qurv0m4ufsj8xqejvmn0y43kqew33kvqrrxswgm",
          "tag": null
        },
        "currency_sent": {
          "currency": "EUR",
          "amount": "804.25693204"
        },
        "currency_received": {
          "currency": "BTC",
          "amount": "0.01000000"
        },
        "transactions": [
          {
            "id": 999,
            "currency": "BTC",
            "transaction_type": "blockchain",
            "type": "withdrawal",
            "address": "tb1qurv0m4ufsj8xqejvmn0y43kqew33kvqrrxswgm",
            "tag": null,
            "amount": "0.01000000",
            "txid": "bb040d895ef7141ea0b06b04227d8f5dd4ee12d5b890e6e5633f6439393a666b",
            "confirmations": "0"
          },
          {
            "id": 1000,
            "currency": "EUR",
            "currency_to": "BTC",
            "transaction_type": "exchange",
            "type": "exchange",
            "amount": "804.25693204",
            "amount_to": "0.01000000"
          }
        ],
        "fees": [
          {
            "type": "mining",
            "currency": "BTC",
            "amount": "0"
          },
          {
            "type": "fee_crypto_withdrawal_from_fiat",
            "currency": "BTC",
            "amount": "0.00028735"
          }
        ],
        "error": "",
        "status": "confirmed"
      }
      ```
    </CodeGroup>
  </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.

    <CodeGroup>
      ```json title="Standard withdrawal" highlight={21,27} theme={null}
      {
        "id": 123,
        "foreign_id": "operation_987",
        "end_user_reference": "user_12345",
        "type": "withdrawal",
        "crypto_address": {
          "id": 123,
          "currency": "BTC",
          "address": "tb1qurv0m4ufsj8xqejvmn0y43kqew33kvqrrxswgm",
          "tag": null
        },
        "transactions": [
          {
            "id": 999,
            "currency": "BTC",
            "transaction_type": "blockchain",
            "type": "withdrawal",
            "address": "tb1qurv0m4ufsj8xqejvmn0y43kqew33kvqrrxswgm",
            "tag": null,
            "amount": "0.01000000",
            "txid": null,
            "confirmations": "0"
          }
        ],
        "fees": [],
        "error": "",
        "status": "pending"
      }
      ```

      ```json title="Instant withdrawal" highlight={21,27} theme={null}
      {
        "id": 123,
        "foreign_id": "operation_987",
        "end_user_reference": "user_12345",
        "type": "withdrawal_instant",
        "crypto_address": {
          "id": 123,
          "currency": "BTC",
          "address": "tb1qurv0m4ufsj8xqejvmn0y43kqew33kvqrrxswgm",
          "tag": null
        },
        "transactions": [
          {
            "id": 999,
            "currency": "BTC",
            "transaction_type": "blockchain",
            "type": "withdrawal",
            "address": "tb1qurv0m4ufsj8xqejvmn0y43kqew33kvqrrxswgm",
            "tag": null,
            "amount": "0.01000000",
            "txid": null,
            "confirmations": "0"
          }
        ],
        "fees": [],
        "error": "",
        "status": "pending"
      }
      ```
    </CodeGroup>
  </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).

    <CodeGroup>
      ```json title="Standard withdrawal" highlight={21,26-27} theme={null}
      {
        "id": 123,
        "foreign_id": "operation_987",
        "end_user_reference": "user_12345",
        "type": "withdrawal",
        "crypto_address": {
          "id": 123,
          "currency": "BTC",
          "address": "tb1qurv0m4ufsj8xqejvmn0y43kqew33kvqrrxswgm",
          "tag": null
        },
        "transactions": [
          {
            "id": 999,
            "currency": "BTC",
            "transaction_type": "blockchain",
            "type": "withdrawal",
            "address": "tb1qurv0m4ufsj8xqejvmn0y43kqew33kvqrrxswgm",
            "tag": null,
            "amount": "0.01000000",
            "txid": null,
            "confirmations": "0"
          }
        ],
        "fees": [],
        "error": "Declined by user ID:777",
        "status": "declined"
      }
      ```

      ```json title="Instant withdrawal" highlight={21,26-27} theme={null}
      {
        "id": 123,
        "foreign_id": "operation_987",
        "end_user_reference": "user_12345",
        "type": "withdrawal_instant",
        "crypto_address": {
          "id": 123,
          "currency": "BTC",
          "address": "tb1qurv0m4ufsj8xqejvmn0y43kqew33kvqrrxswgm",
          "tag": null
        },
        "transactions": [
          {
            "id": 999,
            "currency": "BTC",
            "transaction_type": "blockchain",
            "type": "withdrawal",
            "address": "tb1qurv0m4ufsj8xqejvmn0y43kqew33kvqrrxswgm",
            "tag": null,
            "amount": "0.01000000",
            "txid": null,
            "confirmations": "0"
          }
        ],
        "fees": [],
        "error": "Declined by user ID:777",
        "status": "declined"
      }
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Cancelled">
    Sent when a withdrawal is cancelled and will not be completed.

    <CodeGroup>
      ```json title="Standard withdrawal" highlight={21,26-27} theme={null}
      {
        "id": 123,
        "foreign_id": "operation_987",
        "end_user_reference": "user_12345",
        "type": "withdrawal",
        "crypto_address": {
          "id": 123,
          "currency": "BTC",
          "address": "tb1qurv0m4ufsj8xqejvmn0y43kqew33kvqrrxswgm",
          "tag": null
        },
        "transactions": [
          {
            "id": 999,
            "currency": "BTC",
            "transaction_type": "blockchain",
            "type": "withdrawal",
            "address": "tb1qurv0m4ufsj8xqejvmn0y43kqew33kvqrrxswgm",
            "tag": null,
            "amount": "0.01000000",
            "txid": null,
            "confirmations": "0"
          }
        ],
        "fees": [],
        "error": "Not enough money on balance",
        "status": "cancelled"
      }
      ```

      ```json title="Instant withdrawal" highlight={21,26-27} theme={null}
      {
        "id": 123,
        "foreign_id": "operation_987",
        "end_user_reference": "user_12345",
        "type": "withdrawal_instant",
        "crypto_address": {
          "id": 123,
          "currency": "BTC",
          "address": "tb1qurv0m4ufsj8xqejvmn0y43kqew33kvqrrxswgm",
          "tag": null
        },
        "transactions": [
          {
            "id": 999,
            "currency": "BTC",
            "transaction_type": "blockchain",
            "type": "withdrawal",
            "address": "tb1qurv0m4ufsj8xqejvmn0y43kqew33kvqrrxswgm",
            "tag": null,
            "amount": "0.01000000",
            "txid": null,
            "confirmations": "0"
          }
        ],
        "fees": [],
        "error": "Not enough money on balance",
        "status": "cancelled"
      }
      ```
    </CodeGroup>
  </Tab>
</Tabs>
