Skip to main content

Preview Channel Settlement Revenue Switch

GET 

/api/ledger/settings/channel-sync/:integrationInstance/settlement-revenue/preview

Previews what switching a sales channel between Per order and Per payout revenue booking would do to its open orders, before you save the switch. Read-only: nothing is changed.

Required scope: accounting:read

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Authentication: Requires Bearer token with the Manage accounting settings permission.

Query parameters:

  • accounting_sync_mode (required): per_order or per_payout.
  • payout_accounting_start_date (optional, Y-m-d or empty): the start date the switch would set. Left out = the current one.
  • per_order_revenue_entries_off_from (optional, Y-m-d or empty): the cut-over the same save would set. It is kept as given, so switch_date and invoices_stop_from follow it. Left out = derived as the save derives it.
  • payout_processors[] (optional, Storefront stores only): the processors (stripe, paypal) the store would book by payouts. Left out = its saved selection; empty = none. Only orders a payout can carry (paid through one of them, or already snapshotted as payout-settled) are counted.

Straddling orders are open orders (not cancelled, not drafts, imported from the channel) sold in the lookback_days (60) before switch_date that no payout or settlement line names yet, so their settlement arrives after the switch.

Response fields:

  • current_mode / accounting_sync_mode / mode_changes: the channel's mode now, the proposed one, and whether they differ.
  • switch_date: entering Per payout, the first sale day the settlements book (the start date, else the switch day); leaving it, today.
  • lookback_from, lookback_days: the earliest sale day counted.
  • awaiting_settlement (count, total = net sales in your home currency): the straddling orders. awaiting_booked_by says what keeps booking their revenue: invoices (entering Per payout: their invoices stay, their settlement lines go to the clearing account) or settlements (leaving Per payout: their settlements book them on arrival, their invoices stay unposted).
  • claimed_by_settlements (entering Per payout with a start date in the past, else null): orders sold from switch_date up to now that the settlements take over; their invoices and credits stop posting from invoices_stop_from.
  • clearing_account_mapped: whether the account the payout lines of invoice-booked orders post to instead of revenue is set; null when the channel has none.
  • payout_term: what the channel calls its payout documents: settlement (Amazon, Walmart) or payout (eBay, Shopify, TikTok Shop). messages use the same word.
  • messages: plain-language sentences describing the effect.

Errors: 422 when the mode is missing or invalid, the date is malformed, or the channel has no payouts or settlements that book revenue; 404 when the channel does not exist.

Request​

Responses​

OK

Response Headers
    Content-Type