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

# Create Withdrawal

> Create a new offramp order for a user to sell tokens and receive VND via bank transfer.

## Overview

Partner uses this API to create a new withdrawal order. See [Offramp Flow](/guides/offramp-flow) for the full integration guide.

<ParamField body="amount" type="string" required>
  Amount to withdraw in USD (or VND if `currency=vnd`).
</ParamField>

<ParamField body="currency" type="string" required>
  Currency of the amount: `vnd` or `usd`.
</ParamField>

<ParamField body="chain_id" type="integer" required>
  Blockchain network ID. See [List Tokens](/api-reference/tokens/list-tokens).
</ParamField>

<ParamField body="token_address" type="string" required>
  Token contract address. See [List Tokens](/api-reference/tokens/list-tokens).
</ParamField>

<ParamField body="payment_info" type="object" required>
  User's bank account details to receive VND.

  <Expandable title="payment_info">
    <ParamField body="bank_id" type="integer" required>
      Bank ID. See [List Banks](/api-reference/banks/list-banks).
    </ParamField>

    <ParamField body="full_name" type="string" required>
      Full name of the account holder.
    </ParamField>

    <ParamField body="account_type" type="integer" required>
      `1` = Bank account number, `2` = ATM card number.
    </ParamField>

    <ParamField body="account_number" type="string" required>
      Bank account number.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="callback" type="string" required>
  HTTPS URL to receive order status webhook notifications.
</ParamField>

<ParamField body="reference_no" type="string">
  Optional. Use this to map the Holdstation Pay order to your internal order. Must be unique per partner.
</ParamField>

<ParamField body="buffer" type="number" required>
  Optional buffer rate override (fractional). Effective buffer = max(override, configured). Example: `0.005` = 0.5%.
</ParamField>

<RequestExample>
  ```json theme={null}
  {
    "amount": "100",
    "currency": "usd",
    "chain_id": 56,
    "token_address": "0x55d398326f99059ff775485246999027b3197955",
    "payment_info": {
      "bank_id": 42,
      "full_name": "NGUYEN VAN A",
      "account_type": 1,
      "account_number": "0123456789"
    },
    "callback": "https://yourapp.com/api/webhooks/payment",
    "reference_no": "WITHDRAW-001",
    "buffer": 0.005
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "message": "success",
    "data": {
      "order": {
        "id": "660e8400-e29b-41d4-a716-446655440001",
        "code": 100002,
        "order_type": 2,
        "state": 2,
        "processing_state": 20,
        "amount": "100",
        "outcome": "2575000",
        "currency": "usd",
        "rate": "25750",
        "original_rate": "25500",
        "token_address": "0x55d398326f99059ff775485246999027b3197955",
        "chain_id": 56,
        "recipient": "0xHPAY_WALLET_ADDRESS",
        "reference_no": "WITHDRAW-001",
        "external_id": "ext-001",
        "partner_id": "partner-xyz",
        "user_id": "user-abc",
        "provider": 1,
        "processing_time": 0,
        "client_ip": "127.0.0.1",
        "callback": "https://yourapp.com/api/webhooks/payment",
        "fees": { "service_fee": 0.01, "min_fee": 5000 },
        "total_fee_vnd": 25750,
        "pay_data": null,
        "payment_info": {
          "bank_id": 42,
          "full_name": "NGUYEN VAN A",
          "account_type": 1,
          "account_number": "0123456789"
        },
        "error": null,
        "created_at": { "seconds": 1700000000, "nanos": 0 },
        "updated_at": { "seconds": 1700000000, "nanos": 0 },
        "expired_at": { "seconds": 1700003600, "nanos": 0 }
      }
    }
  }
  ```

  ```json 400 theme={null}
  {
    "error": "invalid request",
    "error_code": "BAD_REQUEST",
    "message": "Invalid parameters"
  }
  ```

  ```json 401 theme={null}
  {
    "error": "unauthorized",
    "error_code": "UNAUTHORIZED",
    "message": "Invalid or missing API key"
  }
  ```
</ResponseExample>
