Skip to main content
Use POST /api/v1/settlements to apply marketplace settlement lines to existing orders. This is not the Orders API. POST / PATCH /api/v1/orders still own selling prices, COGS, and returns. Settlements write financial evidence, project settled rows into the finance ledger, and recompute Payment received when a marketplace formula exists. Do not send paymentReceived. Omni computes it from settled ledger fee types.

Authentication

Session-authenticated calls must include organizationId in the JSON body.

Apply settlements

lines is always an array, even for one target. Maximum 200 lines.

Request fields

What Omni writes

  1. Upserts marketplace_financial_evidence (source_kind=developer_api).
  2. Projects settled rows to order_financial_events using the order’s platform and account_id (exact join, including NULL).
  3. Un-projects a previous developer-API ledger row when the same sourceEventKey is later sent as pending / reversed / voided.
  4. Recomputes Payment received only when a formula exists for that marketplace (Zalora today: Item Price − ZAP − Commission).
Selling prices (paidPrice / unitPrice) are not rewritten. Use the Orders API for those.

Matching

Organization-scoped, exact:
  • marketplace → order platform (zaloraagentic; other slugs match orders.platform)
  • externalOrderId
  • externalOrderItemId when more than one line exists
  • accountId if provided
A missing accountId never matches every store that reuses an external id.

Response

Top-level success is true only when every requested line succeeds. Partial failures stay in data.results in request order.

Zalora vs the assistant tool

This API replaces update_zalora_orders_from_transaction_file for structured settlement writes. Do not apply both for the same fee lines — that would double-count Payment received. Continue to use the Orders API for identity, USD COGS, and returns. Continue to use the Item Transaction Report tool only when you want Omni to parse the spreadsheet.