UAT Testing Guide
This User Acceptance Testing (UAT) phase is designed to validate the core functionalities of the Habittrade Trade API in a controlled, sandbox environment (api-uat.habittrade.com). The objective is to ensure that the trade order lifecycle — including order placement, partial and full fills, rejections, and retrieval — functions as expected across different markets (Crypto, US Stocks, Hong Kong Stocks).
The simulated matching engine uses predefined rules to return consistent responses based on input quantity values. This allows testers to verify behavior across various order states, such as:
- New / Pending
- Partially Filled
- Fully Filled
- Rejected
Test cases include:
- Order creation (
POST /trade/v1/orders) - Order cancellation
- Querying active and historical orders
- Estimating buy/sell availability
- Signature validation and error handling
Authentication is enforced using API Key, Timestamp, and HMAC Signature headers. All endpoints follow RESTful principles with clear versioning and are available for integration via cURL, Postman, or SDKs.
This UAT cycle ensures the system is stable, predictable, and ready for production deployment, enabling developers, partners, and QA teams to simulate real-world trading behaviors with confidence.
✅ Market Identifiers
| Market | Example Symbol | Notes |
|---|---|---|
| Hong Kong | 00700 | Tencent Holdings |
| US Stocks | AAPL | Apple Inc. |
| Crypto | DODO-USDT | Crypto Pair |
Use these symbols for placing test orders.
📋 Order Scenarios and Expected Responses
1. Order Submitted (Pending)
✅ Expected:
status = new
| Quantity | Price | Expected Result |
|---|---|---|
| 100 | any | Order submitted |
| 1000 | any | Order submitted |
| 0.1 | any | Order submitted,USEX only |
| 0.01 | any | Order submitted,USEX only |
Example Test:
curl --location --request POST 'https://api-uat.habittrade.com/trade/v1/orders' \
--header 'X-API-Key: YOUR_API_KEY' \
--header 'X-API-Signature: YOUR_GENERATED_SIGNATURE' \
--header 'X-API-Timestamp: 1746774142' \
--header 'Content-Type: application/json' \
--data-raw '{
"market": "hkex",
"order_type": "enhanced_limit_order",
"symbol": "00700",
"order_side": "buy",
"price": 423.83,
"qty": 1000
}'2. Partial Fill (1 Fill Record)
✅ Expected:
status = partially_filled, 1 fill detail in response
| Quantity | Price | Expected Result |
|---|---|---|
| 200 | any | Partially filled (1 record) |
| 2000 | any | Partially filled (1 record) |
| 0.2 | any | Partially filled (1 record),USEX only |
| 0.02 | any | Partially filled (1 record),USEX only |
3. Rejected (Invalid Order)
❌ Expected:
status = rejected, error message included
| Quantity | Price | Expected Result |
|---|---|---|
| 300 | any | Rejected (Invalid Order) |
| 3000 | any | Rejected (Invalid Order) |
| 0.3 | any | Rejected (Invalid Order),USEX only |
| 0.03 | any | Rejected (Invalid Order),USEX only |
4. Partial Fill (3 Fill Records)
✅ Expected:
status = partially_filled, 3 fill records returned
| Quantity | Price | Expected Result |
|---|---|---|
| 400 | any | Partially filled (3 records) |
| 4000 | any | Partially filled (3 records) |
| 0.4 | any | Partially filled (3 records),USEX only |
| 0.04 | any | Partially filled (3 records),USEX only |
5. Full Fill (3 Fill Records)
✅ Expected:
status = filled, 3 fill records returned
| Quantity | Price | Expected Result |
|---|---|---|
| 600 | any | Fully filled (3 records) |
| 6000 | any | Fully filled (3 records) |
| 0.6 | any | Fully filled (3 records),USEX only |
| 0.06 | any | Fully filled (3 records),USEX only |
🧪 Sample Test Matrix
| Market | Symbol | Quantity | Expected Result |
|---|---|---|---|
| HK | 00700 | 100 | Submitted |
| US | AAPL | 2000 | Partial Fill (1 fill) |
| Binance | DODO-USDT | 3000 | Rejected |
| Binance | ENJ-USDT | 4000 | Partial Fill (3 fills) |
| Binance | DODO-USDT | 6000 | Full Fill (3 fills) |
🛠 Other Tips
Use unique
reference_idfor each test to track them.Orders can be queried via:
GET /trade/v1/orders/{order_no}GET /trade/v1/orders
For WebSocket verification, subscribe to the private user channel for real-time updates.

