Skip to main content

Creating an Order

POST /api/v1/auth/orders
  • offer_id - Required; must reference an existing offer for the chosen vendor.
  • pricing_profile_id and fx_rate_quote_id - Required for commercial enforcement; must match order_type, asset (USDT), fiat_currency, and network implied by wallet_address (Tron-style T... vs Ethereum 0x...) for pricing validation.
  • order_type - ON_RAMP_BUY (default) or OFF_RAMP_SELL.
  • Off-Ramp: provide payout_phone; escrow and network detection use the customer’s validated wallet_address.

Off-Ramp vs On-Ramp

On-RampOff-Ramp
order_typeON_RAMP_BUYOFF_RAMP_SELL
Typical statuspending → pay fiatawaiting_crypto → customer sends USDT to escrow
wallet_addressDelivery walletUsed to detect TRON vs Ethereum for pricing + escrow

Payment Screen (In-app Wallet Send)

MethodPurpose
POST /api/v1/auth/orders/{order_id}/estimate-feeEstimate network fee; body includes wallet_id and network (must match order network).
POST /api/v1/auth/orders/{order_id}/send-paymentSend USDT from the user’s platform wallet to escrow (off-ramp) or destination (on-ramp pattern); requires { "wallet_id", "confirm": true }.
GET /api/v1/auth/orders/{order_id}/qr-codeQR / URI payload for display.

Fiat Payment (M-Pesa)

POST /api/v1/auth/orders/payment - STK push with order_id and phone_number.

Pricing on the Order

GET /api/v1/auth/order/id/{id}/pricing returns the stored snapshot (rates, fees, net amounts) when present.

Callbacks (Server-to-Server)

  • POST /api/v1/payment/callback - M-Pesa; configured for Daraja validation.
  • POST /api/v1/mpesa/b2c/result and .../queue - B2C payout callbacks.
These endpoints are not authenticated with a user JWT. Secure them at the network and payload-validation layer.