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

> Create a new onramp order for a user to buy tokens by depositing VND via bank transfer.

## Overview

Partner uses this API to create a new on-chain token transfer order. See [Onramp Flow](/guides/onramp-flow) for the full integration guide.

<ParamField body="amount" type="string" required>
  Amount to deposit in VND (or USD if `currency=usd`).
</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="recipient" type="string" required>
  User's wallet address to receive the tokens.
</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": "2575000",
    "currency": "vnd",
    "chain_id": 56,
    "token_address": "0x55d398326f99059ff775485246999027b3197955",
    "recipient": "0xUSER_WALLET_ADDRESS",
    "callback": "https://yourapp.com/api/webhooks/payment",
    "reference_no": "DEPOSIT-001",
    "buffer": 0.005
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "message": "success",
    "data": {
      "order": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "code": 100001,
        "order_type": 1,
        "state": 2,
        "processing_state": 10,
        "amount": "2575000",
        "outcome": "100",
        "currency": "vnd",
        "rate": "25750",
        "original_rate": "25500",
        "token_address": "0x55d398326f99059ff775485246999027b3197955",
        "chain_id": 56,
        "recipient": "0xUSER_WALLET_ADDRESS",
        "reference_no": "DEPOSIT-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": 5000, "min_fee": 2000 },
        "total_fee_vnd": 5000,
        "pay_data": {
          "bank_account_name": "CONG TY HOLDSTATION",
          "bank_account_number": "9876543210",
          "bank_bin_code": "970423",
          "bank_name": "Tien Phong Bank",
          "bank_short_code": "TPBank",
          "payment_link": "https://dl.vietqr.io/pay?...",
          "qr_code": "00020101021238...",
          "qr_image": "data:image/png;base64,...",
          "external_id": "hpay-ext-001"
        },
        "payment_info": null,
        "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>
