For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create order

[POST] /api/v2/order

Creates an order. Pass a quoteId to use the price you already showed the user; without one we price the order at creation time.

The response is where the transfer instructions come from — what the user has to do next, and which extra fields you need before you can confirm.

Request

fieldsToCreateOrder is the flat union of the two fieldsToCreateOrder arrays the quote returned. Send every field marked required: true on either leg, keyed by its key.

The key itself is optional on the wire and defaults to an empty object — which is only useful for the rare pair where neither leg asks for anything. Every fiat and crypto leg we run today asks for at least one field, so in practice you always send it; omitting it turns a clear "field X is required" into the same error with nothing to go on.

Request body example:

Response

The full Order shape — every field of deposit, payout and refund — is on the Types page, and Get order shows a completed one. Every order endpoint on this site returns the same object.

The three fields you act on straight away:

  • order._id — the orderId every later call takes.

  • order.status — deposit_awaiting on a fresh order. See Order statuses.

  • order.deposit.transferInstructions — how the user pays. Its type decides whether you show details, redirect, or trigger an STK push. See Transfer types explanation.

statusChangeLogs comes back empty: it records transitions, and creation is not one.

Response example (sandbox, bank manual transfer):

What to do next

  1. Show order.deposit.transferInstructions to the user.

  2. If the transfer type is stk_push or otp_stk_push, call Trigger order intermediate action.

  3. Once the user has paid, call Confirm order, including any transferInstructions.fieldsToConfirmOrder.

  4. Poll Get order, or wait for the webhook.

An order that is never paid moves to deposit_expired at expiresAt.

Last updated