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

# Withdraw Onchain

> Initiate an on-chain withdrawal from your Daya Pro stablecoin balance

## Overview

Initiates an account-level on-chain withdrawal to a raw destination. The request is accepted synchronously and the withdrawal continues asynchronously on-chain.

Requires **Trade** scope.

<Warning>
  Trade-scoped API keys authorize fund movement. Keep these keys server-side and restrict access to systems that are allowed to initiate withdrawals from the account.
</Warning>

<Note>
  Requests are idempotent on `idempotency_key`. Replaying the same key returns the original transaction without creating a duplicate withdrawal.
</Note>

<Warning>
  This endpoint does not manage saved withdrawal addresses. Pass the destination directly in `to_address` for each request.
</Warning>

## Authentication

<ParamField header="X-Api-Key" type="string" required>
  Your API key with Trade scope
</ParamField>

## Request Body

<ParamField body="idempotency_key" type="string" required>
  Caller-supplied unique key. Reuse on retry to avoid duplicate withdrawals.

  **Example:** `onchain-wd-2026-06-05-001`
</ParamField>

<ParamField body="asset" type="string" required>
  Asset to withdraw. Asset symbols are normalized by Daya, so `usdt` and `USDT` resolve to the same partner-facing asset when supported.

  **Example:** `USDT`
</ParamField>

<ParamField body="amount" type="string" required>
  Withdrawal amount as a decimal string.

  **Example:** `25.505555`
</ParamField>

<ParamField body="blockchain" type="string" required>
  Canonical chain key from [List Onchain Withdrawal Options](/pro/api-reference/list-onchain-withdrawal-options).

  **Example:** `polygon`
</ParamField>

<ParamField body="to_address" type="string" required>
  Destination string for the selected blockchain. Daya forwards this value to the on-chain provider without Daya-side address-format validation, so provider-supported formats may be accepted and unsupported formats are rejected during initiation.

  **Example:** `0x1234567890abcdef1234567890abcdef12345678`
</ParamField>

## Request Example

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.pro.daya.co/public/v1/withdrawals/onchain \
    --header 'X-Api-Key: daya_sk_YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "idempotency_key": "onchain-wd-2026-06-05-001",
      "asset": "usdt",
      "amount": "25.505555",
      "blockchain": "polygon",
      "to_address": "0x1234567890abcdef1234567890abcdef12345678"
    }'
  ```
</CodeGroup>

## Response

<ResponseField name="data.transaction_id" type="string" required>
  Daya transaction UUID. Store this as the primary Daya reference for reconciliation and support.
</ResponseField>

<ResponseField name="data.status" type="string" required>
  Initial withdrawal status. Most accepted withdrawals return as `processing`.

  **Values:** `pending`, `processing`, `completed`, `failed`
</ResponseField>

<ResponseField name="data.amount" type="string" required>
  Accepted amount as a full-precision decimal string for the asset.
</ResponseField>

<ResponseField name="data.asset" type="string" required>
  Canonical partner-facing asset symbol.
</ResponseField>

<ResponseField name="data.fee" type="string" required>
  Withdrawal fee as a full-precision decimal string for the asset.
</ResponseField>

<ResponseField name="data.transaction_hash" type="string">
  On-chain transaction hash when available from initiation. This may be omitted if the provider has not returned a hash yet.
</ResponseField>

<ResponseField name="data.blockchain" type="string">
  Canonical chain key used for the withdrawal.
</ResponseField>

<ResponseField name="data.created_at" type="string" required>
  ISO 8601 timestamp when the withdrawal was accepted.
</ResponseField>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "success": true,
    "message": "Withdrawal confirmed and processing",
    "data": {
      "transaction_id": "33333333-3333-3333-3333-333333333333",
      "status": "processing",
      "amount": "25.505555",
      "asset": "USDT",
      "fee": "0.750000",
      "transaction_hash": "0xwithdrawaltx",
      "blockchain": "polygon",
      "created_at": "2026-06-05T11:00:00Z"
    }
  }
  ```
</ResponseExample>

## Error Responses

| Code  | Meaning                                                                                 |
| ----- | --------------------------------------------------------------------------------------- |
| `400` | Invalid asset, amount, blockchain, destination, or provider rejection during initiation |
| `401` | Missing or invalid API key                                                              |
| `402` | Insufficient balance                                                                    |
| `403` | Missing Trade scope or account restricted                                               |
| `409` | Same `idempotency_key` previously used with a different request body                    |

## Notes on settlement

The response confirms the withdrawal was accepted for processing. It does not mean the recipient has received funds on-chain.

Store the `transaction_id`, `idempotency_key`, initial `status`, and `transaction_hash` when returned. Use `transaction_hash` for on-chain monitoring, and use `transaction_id` when reconciling the withdrawal with Daya support.

The public API does not expose a withdrawal-status endpoint or withdrawal-status webhook. For now, review withdrawal history and status in your Daya Pro account.
