Apply Financial Line Backfill
POST/api/faire/instances/:integrationInstance/financial-line-overrides/backfill
Re-key past Faire-imported FinancialLine rows to the override types that are already persisted on the integration instance. No request body — the overrides are read off integration_settings.financial_line_type_overrides, which is set via the Update Faire Instance endpoint.
Branches covered:
commission, payout_fee, payout_protection_fee, damaged_and_missing_items (all cost), covered_shipping (revenue).
Behavior per row:
- Updates
financial_line_type_idto the override's ID. - Copies the override's
nominal_code_idonto the row (so accounting export reflects the new mapping). - Does not change line
amount,currency, or any other monetary field. - Branches with no override configured (or set to
null) are skipped entirely — those past rows keep their existing default Faire types.
Typical flow:
- User changes overrides in the Faire settings UI.
- UI calls
PUT /api/faire/instances/{id}with the newfinancial_line_type_overrides(this also passes the classification guard). - UI calls
POST .../financial-line-overrides/preview-backfillto show the count to the user. - If the user confirms, UI calls this endpoint to apply the change to historical rows.
Response:
Returns a { commission, payout_fee, payout_protection_fee, damaged_and_missing_items, covered_shipping, total } object where each number is the count of rows actually updated (i.e., rows whose existing type differed from the override). total is the sum across branches.
Request
Responses
- 200
Successful response