Re-map Unsynced Journal Entries
POST/api/product-account-rules/remap
After changing rules, move existing journal entries onto the accounts the rules now give. Only entries that are not synced to your accounting integration (QuickBooks Online / Xero) and not in a locked period are changed; each is re-derived from its source document and rewritten in place (same entry id and status). Lines with a manual account re-map are kept, and an entry whose manual re-map would be lost is skipped.
accounting:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Authentication: Requires Bearer token with the accounting:write scope.
Request body fields:
dry_run(boolean, required) —truereturns the counts only;falsestarts the re-map in the background.
Dry-run response (data): eligible (entries the re-map would change), skipped_synced (already synced — never changed), skipped_locked (in a locked period — never changed), skipped_other (mid-sync, failed, needing attention or batched — left alone), skipped_frozen (issued invoices — they keep the revenue and discount accounts they were issued with), skipped_unsupported (inventory assembly entries — their lines do not record which product they belong to, so they are not re-mapped). eligible is exact: each candidate entry is re-derived in memory through the same builder the re-map uses and compared with its stored lines. Up to 2,000 candidates are checked; past that estimated is true and eligible is a lower bound ("at least"). candidates (unsynced entries with a product line — every entry the run will visit) and evaluated (candidates checked) say how much was checked. The skipped counts are estimates.
Real run response (data): tracked_job_id — poll GET /api/tracked-job-logs/{trackedJobLog} for progress and the final counts.
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 Entity
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.