Skip to main content

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's default_financial_line_type_id is 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 be true.

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_id is not a revenue type, or confirm not accepted

Request

Responses

OK

Response Headers
    Content-Type