Skip to content

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

MarketExample SymbolNotes
Hong Kong00700Tencent Holdings
US StocksAAPLApple Inc.
CryptoDODO-USDTCrypto Pair

Use these symbols for placing test orders.


📋 Order Scenarios and Expected Responses

1. Order Submitted (Pending)

✅ Expected: status = new

QuantityPriceExpected Result
100anyOrder submitted
1000anyOrder submitted
0.1anyOrder submitted,USEX only
0.01anyOrder submitted,USEX only

Example Test:

bash
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

QuantityPriceExpected Result
200anyPartially filled (1 record)
2000anyPartially filled (1 record)
0.2anyPartially filled (1 record),USEX only
0.02anyPartially filled (1 record),USEX only

3. Rejected (Invalid Order)

❌ Expected: status = rejected, error message included

QuantityPriceExpected Result
300anyRejected (Invalid Order)
3000anyRejected (Invalid Order)
0.3anyRejected (Invalid Order),USEX only
0.03anyRejected (Invalid Order),USEX only

4. Partial Fill (3 Fill Records)

✅ Expected: status = partially_filled, 3 fill records returned

QuantityPriceExpected Result
400anyPartially filled (3 records)
4000anyPartially filled (3 records)
0.4anyPartially filled (3 records),USEX only
0.04anyPartially filled (3 records),USEX only

5. Full Fill (3 Fill Records)

✅ Expected: status = filled, 3 fill records returned

QuantityPriceExpected Result
600anyFully filled (3 records)
6000anyFully filled (3 records)
0.6anyFully filled (3 records),USEX only
0.06anyFully filled (3 records),USEX only

🧪 Sample Test Matrix

MarketSymbolQuantityExpected Result
HK00700100Submitted
USAAPL2000Partial Fill (1 fill)
BinanceDODO-USDT3000Rejected
BinanceENJ-USDT4000Partial Fill (3 fills)
BinanceDODO-USDT6000Full Fill (3 fills)

🛠 Other Tips

  • Use unique reference_id for 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.