Skip to content

Open a trade ​

http
POST /api/trades

Trader

Takes an order and locks the seller's XLM in a new escrow account. The request waits for the Stellar transaction (typically 2–5 seconds).

Body ​

FieldTypeRules
orderIdstringAn active, unexpired order you don't own
paymentMethodenumMust be accepted by the order

Sequence ​

  1. Validate order, method, active-trade limit (5), seller payout account, seller status and balance (amount + 2 XLM).
  2. Atomically claim the order (ACTIVE → FILLED) and broadcast order:removed.
  3. Create the trade in PENDING_ESCROW with a pre-generated escrow address.
  4. Submit the escrow lock.
  5. Set ESCROW_LOCKED, restart the payment window, write the ledger entry and system message, emit trade:created.

If Stellar rejects the lock, the trade is cancelled (ESCROW_FAILED) and the order reactivated. If the outcome is unknown, the trade stays PENDING_ESCROW and is reconciled.

Response 201 ​

The full trade details.

Errors ​

StatusCodeCause
400BAD_REQUESTOwn order, or method not accepted
403EMAIL_NOT_VERIFIED, KYC_REQUIRED
404NOT_FOUNDOrder not available
409CONFLICTAnother trader took the order first
422TOO_MANY_TRADES
422PAYMENT_ACCOUNT_REQUIREDSeller has no account for the method
422COUNTERPARTY_INACTIVESeller restricted
422INSUFFICIENT_BALANCE
502STELLAR_TX_FAILEDLock rejected; trade cancelled
503HORIZON_UNAVAILABLELock outcome unknown; check my trades

Nexlm is a peer-to-peer facilitator and never holds customer Naira.