POST

Update Line Items


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Updates line items in a draft subscription contract.

You can update a line item's quantity, price, and catalog reference options. Returns the updated draft subscription contract with recalculated totals.

To remove a line item, set newQuantity to 0. A removed line item stays in the draft subscription contract with changeType set to REMOVED, so you can restore it. A line item that you added to the draft subscription contract is deleted instead. Removing a line item sets applied to false for the discounts and additional fees linked to it. Changing a line item's price or catalog reference options also sets applied to false for the discounts linked to it. Restoring a line item to its original quantity sets applied back to true.

When settings.specificItemsCouponBehavior is ITEM_SUBTOTAL_INCLUDES_DISCOUNT, a discount that applies to the whole order (GLOBAL) works differently. Removing a linked line item unlinks it, and the discount stays applied while it's still linked to another line item. Changing a linked line item's price or catalog reference options leaves the discount applied, and the totals recalculation reprices it.

Notes:

  • New catalog reference options replace the line item's product name, description lines, image, price, and other catalog details with the catalog item for the new options.
  • You can't change the catalog reference options of a custom line item.
  • You can't change the quantity of a line item linked to a discount, except to remove it or restore its original quantity.
  • You can't change the quantity, price, or catalog reference options of a line item linked to an additional fee. You can remove it or restore its original quantity.
  • You can't change the quantity or catalog reference options of a line item stocked at more than 1 location. You can remove it or update its price.
  • A removed line item can only be restored. Specify newQuantity to restore it, optionally with newPrice.
  • A site member can't update a line item's price.

You can update line items only in a draft subscription contract that you created.

Permission Scopes
Write draft subscription contracts
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/ecom/v1/draft-subscription-contracts/{draftSubscriptionContractId}/update-line-items

Errors
400Invalid Argument

There are 2 errors with this status code.

403Permission Denied

There is 1 error with this status code.

404Not Found

There are 3 errors with this status code.

428Failed Precondition

There are 8 errors with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

Event TriggersThis method triggers the following events:
Did this help?