Convert Product Lines to Revenue
POST//:domain/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.
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 in the global job tray.
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
- 422
OK
Response Headers
Content-Type
Unprocessable Content
Response Headers
Content-Type