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
- Upserts
marketplace_financial_evidence(source_kind=developer_api). - Projects settled rows to
order_financial_eventsusing the order’s platform andaccount_id(exact join, includingNULL). - Un-projects a previous developer-API ledger row when the same
sourceEventKeyis later sent as pending / reversed / voided. - Recomputes Payment received only when a formula exists for that marketplace (Zalora today: Item Price − ZAP − Commission).
paidPrice / unitPrice) are not rewritten. Use the Orders API for those.
Matching
Organization-scoped, exact:- marketplace → order platform (
zalora→agentic; other slugs matchorders.platform) externalOrderIdexternalOrderItemIdwhen more than one line existsaccountIdif provided
accountId never matches every store that reuses an external id.
Response
Top-levelsuccess is true only when every requested line succeeds. Partial failures stay in data.results in request order.
Zalora vs the assistant tool
This API replacesupdate_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.