Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.dubupay.com/llms.txt

Use this file to discover all available pages before exploring further.

The Dubu Pay trading API gives you access to a live crypto/fiat order book where you can place, cancel, and monitor orders on NGN-paired markets. Trading is particularly useful when you want to convert accumulated USDT earnings back to NGN, take a position on exchange rate movements, or execute programmatic hedging strategies. All trading activity is scoped to your merchant account.

Supported trading pairs

Dubu Pay currently offers three trading pairs:
PairBase assetQuote assetDescription
USDT-NGNUSDTNGNTrade Tether against the Nigerian Naira
USDC-NGNUSDCNGNTrade USD Coin against the Nigerian Naira
USD-NGNUSDNGNTrade US Dollar against the Nigerian Naira
To list all currently available pairs and their metadata programmatically:
curl https://api.dubupay.com/api/v1/trading/market/pairs \
  -H "X-Api-Key: dubu_sk_live_..."

Balances

Before placing an order, check your per-asset balance. The balances endpoint returns how much of each currency you hold in the trading account.
curl https://api.dubupay.com/api/v1/trading/balances \
  -H "X-Api-Key: dubu_sk_live_..."
Your trading balance is separate from your payments merchant balance. To move USDT from the payments system into trading, call POST /payments/merchant/balance/transfer first. See Payments, deposits, and withdrawals for details.

Order types

Dubu Pay supports two order types:
TypeDescription
limitExecute at a specific price or better. Your order sits on the book until matched or cancelled.
marketExecute immediately at the best available price. No price guarantee.
For limit orders, price is required. For market orders, omit price.

Placing an order

Call POST /trading/orders with your chosen symbol, side, type, and quantity. All quantities are strings to avoid floating-point precision issues.
curl -X POST https://api.dubupay.com/api/v1/trading/orders \
  -H "X-Api-Key: dubu_sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "symbol": "USDT-NGN",
    "side": "sell",
    "type": "limit",
    "quantity": "100.00",
    "price": "1620.00"
  }'
Order fields:
FieldTypeRequiredDescription
symbolstringYesTrading pair, e.g. USDT-NGN.
sidestringYesbuy or sell.
typestringYeslimit or market.
quantitystringYesAmount of the base asset to trade.
pricestringFor limit ordersLimit price in quote currency (NGN).

Order lifecycle

An order moves through states from the moment it is placed until it is fully resolved.
StatusDescription
openOrder is on the book, waiting to be matched.
partially_filledSome of the quantity has been matched; the remainder is still open.
filledThe full quantity has been matched. The order is complete.
cancelledThe order was cancelled before it was fully filled. Any unfilled quantity is released.
For time-sensitive conversions, use a market order rather than a limit order. Limit orders can remain open indefinitely if the market does not reach your price.

Managing orders

curl https://api.dubupay.com/api/v1/trading/orders/{id} \
  -H "X-Api-Key: dubu_sk_live_..."
You can filter listed orders by symbol, status, side, page, and limit (max 100).

Trade history

Each matched order produces one or more trades — individual fill records. Retrieve your full trade history:
curl https://api.dubupay.com/api/v1/trading/trades \
  -H "X-Api-Key: dubu_sk_live_..."
Trade records include the matched price, quantity, and timestamp for each fill. If a single order is partially filled across multiple matches, each match appears as a separate trade.

Market data

Dubu Pay exposes three market data endpoints you can call without placing any orders.
The order book shows the current bid and ask sides of a market, sorted by price. Use depth to control how many price levels are returned.
curl "https://api.dubupay.com/api/v1/trading/market/orderbook?symbol=USDT-NGN&depth=20" \
  -H "X-Api-Key: dubu_sk_live_..."
ParameterRequiredDescription
symbolYesTrading pair, e.g. USDT-NGN.
depthNoNumber of price levels to return per side.
The ticker gives you a real-time snapshot of the last traded price, 24-hour volume, and price change for all pairs.
curl https://api.dubupay.com/api/v1/trading/market/ticker \
  -H "X-Api-Key: dubu_sk_live_..."
Klines return OHLCV (open, high, low, close, volume) candlestick data for a symbol over a time range. This is useful for charting or calculating technical indicators.
curl "https://api.dubupay.com/api/v1/trading/market/klines?symbol=USDT-NGN&interval=1h&limit=100" \
  -H "X-Api-Key: dubu_sk_live_..."
ParameterRequiredDescription
symbolYesTrading pair.
intervalYesCandle interval, e.g. 1m, 5m, 1h, 1d.
limitNoNumber of candles to return.
startNoUnix timestamp (ms) for the start of the range.
endNoUnix timestamp (ms) for the end of the range.

Use cases

After accumulating USDT from customer deposits, you can sell it for NGN:
1

Check your trading balance

Call GET /trading/balances to confirm the available USDT balance in the trading account.
2

Fetch the order book or ticker

Call GET /trading/market/ticker to see the current USDT-NGN market price and decide whether a limit or market order is appropriate.
3

Place a sell order

Submit POST /trading/orders with side: "sell", symbol: "USDT-NGN", and your chosen type and quantity.
4

Monitor until filled

Poll GET /trading/orders/{id} or subscribe to webhooks to detect when the order status changes to filled.
Trading involves market risk. Limit orders are not guaranteed to fill, and market orders execute at the prevailing price which may differ from the last quoted price. Test your order logic in sandbox mode before going live.

Endpoint overview

MethodPathDescription
GET/trading/balancesGet per-asset balances in the trading account
POST/trading/ordersPlace a new order
GET/trading/ordersList orders (filterable by symbol, status, side)
GET/trading/orders/:idGet a specific order
DELETE/trading/orders/:idCancel an open order
GET/trading/tradesList trade history
GET/trading/market/pairsList all available trading pairs
GET/trading/market/orderbookGet the live order book for a symbol
GET/trading/market/tickerGet 24-hour ticker data for all pairs
GET/trading/market/klinesGet OHLCV candlestick data