Place an order

Places an asynchronous purchase and reserves its total from the wallet. Name the purchase in exactly one of two ways: item prices it now and orders it at that price in the same call, optionally refusing a total above maximumTotal; quoteId orders against a quote you created. Requires the orders.create scope and an Idempotency-Key header. The key space is the workspace's and a key that placed an order is spent for good: a retry under it is answered 202 with the order it placed, as it stands now, and nothing is priced, reserved or charged again — with quoteId when the quote, clientReference and purchaseInput are the same; with item when the request it repeats is the same (productId, variantId, value or its absence, quantity, currency, clientReference, purchaseInput) and its maximumTotal, when given, is not below the order's total. When the key's order kept no record of the request — one placed before Xegora began recording it, or one placed from a quoteId, which is not an item request — an item retry is judged from the order itself instead: one line, the same productId, variantId, quantity, settlement currency, clientReference and purchaseInput, for the amount named (an omitted value being the product's default face value, as a fresh quote would read it), within the retry's maximumTotal. Such a key therefore answers a matching one-call purchase rather than conflicting. Anything else under a spent key is 409 idempotency_conflict; a quoteId request never answers for an item order, since a one-call purchase quotes for itself and its quote id is never presented again. On a 409 idempotency_conflict, look the order up by clientReference before using a new key — a new key for a purchase already placed buys it twice. A refused request places nothing and leaves the key unused. Fulfillment proceeds in the background; follow the status via GET /api/v1/orders/{orderId} or webhooks.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

Send item or quoteId, never both; maximumTotal only with item. A body member not listed here is refused (400 invalid_request, named in errors) — a misspelt maximumTotal never orders without its ceiling.

item
object

What to buy, exactly as a quote request names it — the same members and rules.

number | null

With item only: the most you accept to pay. A higher total orders nothing and returns 409 price_above_maximum with the quoted total. A retry under a spent key must accept the total the key's order was placed at.

uuid | null

An unexpired, unused quote your workspace made through the API.

string
required
length ≤ 200

Your own correlation identifier (no control characters; surrounding spaces are trimmed); echoed on the order and webhooks, and searchable with the clientReference filter.

purchaseInput
object | null
Headers
string
required
length between 1 and 128

Caller-generated retry token (1–128 printable characters; surrounding spaces are trimmed). Derive it from your own operation identity and persist it. For an order, the key space is the workspace's and a spent key never expires; for a reveal, the key belongs to the API key that sends it and replays for 15 minutes. A key already bound to a different order or reveal is 409 idempotency_conflict, and nothing is done under it a second time.

string
length ≤ 128
^[A-Za-z0-9._:-]{1,128}$

Your own correlation id, carried through Xegora's logs and audit records and returned in correlationId. Kept when it is 1–128 characters of ASCII letters, digits, ., _, : and -; anything else is replaced by an id of Xegora's.

string
enum

The language an error's message, title and detail are written in; without it, Accept-Language decides, then English. Successful responses are not translated.

string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
application/problem+json