Apply Settlements
Apply marketplace-agnostic settlement lines to existing orders. Writes marketplace financial evidence, projects settled rows into the order finance ledger, and recomputes Payment received when a marketplace formula exists (Zalora today). Pending, reversed, and voided rows stay on evidence only and un-project any earlier developer-API ledger row for that sourceEventKey. This is not an order-price API: selling prices, COGS, and returns stay on POST/PATCH /api/v1/orders. Do not send paymentReceived. Requires orders:write. Match is organization + marketplace order platform + exact externalOrderId (and externalOrderItemId when the order has multiple lines). accountId is an exact store match, never a wildcard. marketplace=zalora matches orders imported from Zalora Seller Center (platform=zalora) as well as reconciliation-era agentic carts; ledger rows keep whichever platform the matched order has. If one externalOrderId exists under both, the line fails as ambiguous — pass accountId to disambiguate. Zalora ITR parity: send one lines[] entry per report row (transactionType such as Commission, Item Price Credit, ZAP Commitments, Payment Gateway Fee, shipping, penalties, credits — Omni maps fee types like the ITR parser). settlementStatus=settled is paid; pending is not. Payment received (Zalora) recomputes from Item Price Credit − ZAP − Commission ledger legs only; PG, shipping, and penalties still post to P&L when settled but are excluded from that formula, same as ITR. Item Price Credit here updates Payment received via the ledger without changing line paidPrice/unitPrice — PATCH /api/v1/orders/{orderId} when displayed prices must match. Does not replace ITR apply for: parsing spreadsheets, writing paidPrice/unitPrice, auto-marking returned/cancelled lines (and return inventory restock), SKU fallback matching, order currency/total rewrite, COGS currency rebase, or undo/redo. Do not apply the same fee lines through this API and the Zalora Item Transaction Report tool — source_event_key namespaces differ (developer_api:… vs zalora_report:…) and Payment received will double-count.
Authorizations
Bearer API key for server-to-server access. Session auth is also supported in first-party UI flows.
Body
Settlement source marketplace slug (zalora, shopee, lazada, tiktok, shopify, agentic, …). Used to match orders and pick a payment-received formula. zalora matches both Seller Center orders (platform=zalora) and reconciliation-era agentic carts.
2 - 32Settlement lines. Plural even for one target. Each line is one fee/credit/reversal, not a net paymentReceived.
1 - 200 elementsOptional for OAuth clients bound to one organization; required when the caller can access multiple organizations.
120Exact store/account id. Never a wildcard. Omit only when org + marketplace + externalOrderId already identifies one order.
160