Export Ledgers
GET/api/amazon/unified/ledgers/export
Export Amazon inventory ledgers as a CSV (all report columns, plus two reconciliation-only columns the table does not show: 'FIFO Layer Date' and 'Effective At' — the instants the Inventory Value Change report windows rows by; arrivals by their layer's date, consumptions by their effective instant, and a consumption only counts when its consumed layer's date falls on or before the window end. Use them to re-window an export onto the report's valuation basis instead of the ledger's calendar date). Small exports return a ready download_url immediately. Large exports run as a background job and return a tracked_job_log_id — poll the job status, then download the finished file via its download link. Use scope=selected with ids to export specific rows. Requires a Bearer token. COGS / Extended COGS restate the accounting atom the Inventory Valuation / Value Change reports book: whole cents per row at the FIFO layer's live unit cost (an arrival is ROUND(layer quantity x layer cost, 2); a consumption sums ROUND(row quantity x its layer's cost, 2) per consumption row), so a re-windowed export ties to the reports rather than to the stored four-decimal snapshot product. A final 'Row Source' column distinguishes real Amazon ledger rows from DERIVED subledger rows: when the export's date filter pins a full window (between/is on date), the file also carries the recognitions the valuation reports count that have no Amazon ledger row — summary true-ups, initial-inventory layers, unlinked consumptions, and closure-rounding flushes (IDs prefixed L-/C-/F-) — so a filtered export sums to the reports' change without leaving the file.
This endpoint currently requires session authentication; Personal Access Token scope support is in progress.
Request
Responses
- 200
- 401
- 403
- 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.
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.