Convert Product Lines to Revenue
POST/api/shopify/:integrationInstance/products/:product/revenue-conversion
Flag this product as a revenue line and retroactively convert its historical sales-order lines (scoped to this Shopify integration instance) into revenue financial lines via a tracked background job.
Any valid API token can call this endpoint — no specific scope required. Manage tokens.
The job creates an equivalent revenue financial line for each affected sales-order line, deletes the line (reversing fulfillment/allocations/inventory/credits via the model cascade), then rebuilds the line + daily financial caches and the accounting batch summaries (and any linked QBO journals).
Request body:
financial_line_type_id(integer, required) — must be a REVENUE-classified financial line type. The product'sdefault_financial_line_type_idis set to this value.date_from(date, optional, Y-m-d) — only convert orders on/after this date.date_to(date, optional, Y-m-d) — only convert orders on/before this date.sales_order_ids(int[], optional) — convert ONLY these sales orders (the 'pick specific orders' mode). Omit to convert all matching.confirm(boolean, required) — must betrue.
Returns the tracked_job_log_id so progress can be followed via the tracked job log endpoints.
Requires Bearer token.
Errors:
- 403: product does not belong to the given integration instance
- 422: product is not mapped to a SKU product, or
financial_line_type_idis not a revenue type, orconfirmnot accepted
Request
Responses
- 200
- 401
- 403
- 404
- 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.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
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.