Get Ecommerce P&L
GET/api/ledger/reports/ecommerce-pnl
Ecommerce P&L workbook: income by month, income and COGS by sales channel by month down to gross profit and contribution margin, inventory, inventory in transit and vendor deposits at each month end, and the cost and count trust behind each month.
accounting:readGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Every month carries its basis in basis_by_month: ledger (SKU's journal), operational (order lines and the inventory subledger), history (before the inventory start date, from the history register) or estimate (estimated history, never posted). On ledger months pnl lists income and direct-cost accounts; on other months it lists net sales and product COGS.
Revenue by channel always comes from order lines. Unassigned channel is the month total minus the named channels, so the channel blocks always add up to pnl; tie_out.flagged_months lists months where it exceeds 0.5% of revenue.
Amounts are in the account currency; percent rows are already multiplied by 100; null means the figure does not apply to that month's basis.
Authentication: Requires Bearer token with the accounting scope and the accounting.index permission.
Request
Responses
- 200
- 401
- 403
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Unprocessable Content
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.