Skip to main content
POST
Update Line Items

Overview

Update financial fields on line items (report data) and cost of goods records. Supports updating specific line items by ID or bulk-updating all line items matching a SKU. The endpoint accepts two mutually exclusive modes:
  • Items mode — update specific line items by Shopify line item ID and order ID
  • By SKU mode — update all line items matching a SKU

Items Mode

Target specific line items by Shopify line item ID and order ID.
array
required
Array of line item update objects (max 100 per request).

Example


By SKU Mode

Update all line items matching a SKU value for your shop.
string
required
The SKU value to match.
object
Fields to update. Required when recalculate is not true. See Updatable Fields below.
boolean
Set to true to trigger recalculation for all matching line items.

Example


Updatable Fields

Only the following fields are accepted. Unknown fields will be rejected.

Recalculate Mode

You can trigger the recalculation pipeline by setting recalculate: true. This re-runs the full commission and payout calculations using current shop settings. Recalculation is asynchronous — the response confirms it has been queued, not completed. You can combine fields with recalculate: true to update fields first, then recalculate. This is useful when you want to set a new cost of goods and immediately recalculate the payout based on that value.

Response

Success

Possible status values: "updated", "recalculate_queued", "updated_and_recalculate_queued".
200

Partial Failure

When some items succeed and others fail, the response includes both results and errors.
200

Validation Error

422

Important Notes

Frozen line items are automatically skipped and reported in the errors array.
When costOfItem is included in fields, the SKU cost of goods record is automatically updated (or created if it does not exist). This ensures future recalculations use the correct COGS value.
  • Shop isolation: All updates are scoped to your authenticated shop. You cannot update line items belonging to other shops.
  • Max 100 items per request when using items mode.
  • Mutually exclusive modes: Provide either items or bySku, not both.

Examples

Update cost of goods by SKU

Update specific line items

Trigger recalculation by SKU