Place an order paid from the wallet

Requires orders:write. Spends real money from the prepaid wallet. All or nothing: the order, the wallet debit and the brief are written in one transaction, and nothing is bought if any outlet is unavailable (422 items_unavailable), the price changed (409 price_changed) or the balance is too low (402 insufficient_funds). Idempotency: the same Idempotency-Key with the same body replays the stored response with the header Idempotent-Replayed: true; the same key with a different body is 422 idempotency_key_reused; a concurrent duplicate with the same body is 409 idempotency_in_progress (until it finishes, at most 15 minutes; retry with the same key). A request refused before an order is paid releases the key. If anything fails after the order was paid, the key is kept: the response is 201 with the order, or 500 internal_error with order_may_exist true, and you retry with the SAME key to get the order back. Keys are kept for 24 hours. Always quote first and pass the quoted total as expected_total_usd.

post/api/agent/v1/orders

Request

  • Base URL: https://essentras.com
  • URL: https://essentras.com/api/agent/v1/orders
  • Auth: HTTP bearer

Headers

Idempotency-Keystring required

A unique value per intended order, for example a UUID.

Request body

expected_total_usdnumber

The total from your quote. If the server total differs by a cent or more, nothing is bought.

client_referencestring

Your own reference for this order.

Response

Order placed, or a replay of an earlier identical request (then the Idempotent-Replayed: true header is set)

object'order'
idstring

Order id for the API (the public id).

numberinteger nullable
statusstring
payment_statusstring
fulfillment'awaiting_payment' | 'awaiting_brief' | 'in_progress' | 'partially_published' | 'published' | 'cancelled' | 'refunded'
channel'api' | 'reseller_portal' | 'website'
created_atstring date-time
paid_atstring date-time nullable
currency'USD'
pricing_basis'list' | 'reseller'
subtotalnumber
discountnumber
discount_reasonstring nullable
totalnumber
paid_from_walletnumber
client_referencestring nullable
dashboard_urlstring uri
next_stepstring

Changes

No recorded changes to this operation across all 1 revision of this API.