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

# Core concepts

> Understand assets, networks, order types, statuses, and the request conventions used across the Stablecoin Account API.

[Stablecoin Account API Publisher Disclaimer](/stablecoin-account/v1.6/guide/stablecoin-account-api-publisher-disclaimer)

This page covers the vocabulary and request conventions that apply to every Stablecoin Account endpoint. Read it once before building — the rest of the guide assumes these concepts.

## Assets, networks, and balances

Four terms come up throughout the API:

| Term                                 | Meaning                                                                                                                                                | Example                                          |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------ |
| **Asset**                            | A currency you can hold or move — crypto or fiat. Each asset has an `asset_type` of `CRYPTO` or `FIAT`.                                                | `USDT`, `USDC`, `USD`                            |
| **Network**                          | The blockchain a crypto asset moves on. The same asset can be supported on several networks, each with its own limits and fees.                        | `ETH`, `TRX`, `BSC`                              |
| **Balance (wallet)**                 | Your holding of one currency, identified by `balance_id` and `balance_currency`. Created automatically the first time you receive that currency.       | A `USDC` wallet with `available_balance: "9100"` |
| **Wallet address (deposit address)** | The blockchain address UQPAY manages for you to receive crypto deposits. One address per asset–network pair — generated on first request, then reused. | The `USDT` address on `TRX`                      |

Each balance splits into three buckets:

* `available_balance` — funds you can withdraw, convert, or transfer now.
* `frozen_balance` — funds locked by in-flight orders or risk review.
* `margin_balance` — funds reserved as margin.

Query balances with [List Assets](/stablecoin-account/v1.6/api-reference/list-assets), and always check [List Supported Assets and Networks](/stablecoin-account/v1.6/api-reference/list-supported-assets) before offering an asset–network pair to your users: it tells you whether deposits and withdrawals are currently enabled, minimum amounts, precision, and estimated arrival times.

### Wallet addresses

A **wallet address** is not the same thing as a balance: the balance is what you hold, the wallet address is where senders send crypto to fund it. UQPAY generates and manages one address per asset–network pair — the first request creates it, and every later request returns the same address, so it is safe to fetch repeatedly. An address only accepts its own asset on its own network; funds sent as a different token, or over a different network, cannot be credited automatically.

Retrieve an address with [Deposit Wallet Address](/stablecoin-account/v1.6/api-reference/deposit-wallet-address) (see [Receive deposits](/stablecoin-account/v1.6/guide/receive-deposits) for the full flow), or look it up in the Merchant Portal — see [Wallet address - find your wallet address using merchant portal](/stablecoin-account/v1.6/guide/wallet-address).

## Order types and lifecycles

Every money movement creates an **order** with a long `order_id` (UUID) and a human-friendly `short_order_id` (for example `WD260124-N1PAAIXX`). Orders appear in the unified [asset transaction history](/stablecoin-account/v1.6/api-reference/list-asset-transactions) with one of these types:

| Order type                     | Created by                                                                    | What it does                                             |
| ------------------------------ | ----------------------------------------------------------------------------- | -------------------------------------------------------- |
| `Deposit`                      | Incoming crypto to your deposit address                                       | Credits a crypto balance                                 |
| `Withdraw`                     | [Create Withdraw](/stablecoin-account/v1.6/api-reference/create-withdraw)     | Sends crypto to an external address                      |
| `Sell` / `Buy` / `Swap`        | [Create Conversion](/stablecoin-account/v1.6/api-reference/create-conversion) | Converts between currencies                              |
| `Transfer In` / `Transfer Out` | [Create Transfer](/stablecoin-account/v1.6/api-reference/create-transfer)     | Moves fiat between Global Account and Stablecoin Account |

### Order statuses

| Status          | Meaning                                                            |
| --------------- | ------------------------------------------------------------------ |
| `Submitted`     | Order accepted and queued (conversions and transfers).             |
| `Pending`       | Order in progress — awaiting confirmations, settlement, or review. |
| `Success`       | Order completed; balances are final.                               |
| `Failed`        | Order failed after submission.                                     |
| `Submit Failed` | Order rejected at submission (conversions and transfers).          |

Deposits and withdrawals use the subset `Pending` → `Success` / `Failed`. Treat `Success` and the terminal `failed` webhook events as the only final states; `Pending` orders can remain in progress for some time depending on network congestion.

## Request conventions

### Base URLs

| Environment | Base URL                                |
| ----------- | --------------------------------------- |
| Sandbox     | `https://api-sandbox.uqpaytech.com/api` |
| Production  | `https://api.uqpay.com/api`             |

All Stablecoin Account endpoints live under `/v1/ramp/` and use the same paths in both environments.

### Authentication

Request an access token from the [Access Token](/account-center/v1.6/api-reference/access-token) endpoint using your `x-client-id` and `x-api-key` credentials, then send it on every call:

```bash theme={null}
curl "https://api-sandbox.uqpaytech.com/api/v1/ramp/asset?page_size=10&page_num=1" \
  -H "x-auth-token: YOUR_API_TOKEN"
```

### Acting on behalf of a sub-account

Pass the optional `x-on-behalf-of` header with a sub-account's `account_id` to execute a request for that sub-account. Omit it to act as the master account. See [Connected Accounts](/account-center/v1.6/guide/connected-accounts) for how sub-accounts work.

### Idempotency

Write endpoints that create orders — [Create Transfer](/stablecoin-account/v1.6/api-reference/create-transfer), [Create Conversion](/stablecoin-account/v1.6/api-reference/create-conversion), [Create Withdraw](/stablecoin-account/v1.6/api-reference/create-withdraw), [Create Address Book](/stablecoin-account/v1.6/api-reference/create-address-book), [Update Address Book](/stablecoin-account/v1.6/api-reference/update-address-book), and [Submit Deposit Sender Travel Rule](/stablecoin-account/v1.6/api-reference/create-deposit-sender) — accept an `x-idempotency-key` header (UUID). Retrying a request with the same key returns the original result instead of creating a duplicate order. Generate a fresh UUID per logical operation and reuse it on network retries:

```bash theme={null}
-H "x-idempotency-key: $(uuidgen | tr '[:upper:]' '[:lower:]')"
```

### Response envelope

Every response wraps its payload in the same envelope. `code` mirrors the HTTP status; `data` carries the result:

```json theme={null}
{
  "code": 200,
  "message": "Success",
  "data": { }
}
```

List endpoints paginate inside `data` with `total_pages` and `total_items`, controlled by the `page_num` and `page_size` query parameters. Amount fields are decimal strings (for example `"100.50"`) — parse them with a decimal type, not a float. See [Error codes](/stablecoin-account/v1.6/guide/error-codes) for non-2xx responses.

### Webhooks

Order status changes are pushed to your configured webhook endpoint as events named `ramp.<resource>.<status>` (for example `ramp.deposit.success`). Each event carries the order in `data` and the order ID in `source_id`. See the [Webhooks tab](/stablecoin-account/v1.6/webhooks/deposit) for payloads per event.

## Related

* [Quickstart](/stablecoin-account/v1.6/guide/quickstart) — run the deposit flow end to end
* [List Supported Assets and Networks API](/stablecoin-account/v1.6/api-reference/list-supported-assets)
* [Error codes](/stablecoin-account/v1.6/guide/error-codes)
