Cart / Order Line Items

You can enable a mini cart view in the following requests to show changes to the cart immediately. Find out more in the Views for Cart modifying operations

Prerequisites

Add Line Item to a Cart

Parameters

  • catalogId from Catalogs

  • priceGroupId from Price Groups (string)

  • cultureCode, e.g. en-US (string)

  • sku (string)

  • quantity (integer)

Optional Parameters

  • addToExistingOrderline (default: true).

    • If false, a new order line will be added even if the SKU is already in the Cart. (boolean)

  • variantSku used alongside sku to identify a product variant. (string)

  • customProperties a list of key (string) and value (string) pairs

  • price custom unit price for the line item (decimal)

Request

Custom Price

By default, Ucommerce calculates the price of the order line based on the product's price. To use a custom price instead, this can be specified in the price parameter.

Delete Line Item from a Cart

A Line Item can be removed by either ID or SKU (and Variant SKU in case of a variant).

Parameters

  • priceGroupId from the Cart or from Price Groups

  • cultureCode, e.g. en-US (string)

  • sku (string) or lineId (string)

Optional Parameters

  • variantSku, if the product being removed is a variant (string)

Request

Update Line Item on a Cart

The following properties can be updated on a Line Item during checkout:

  • Quantity

  • Price

  • TaxRate

Note: When modifying the price or the tax rate, your access_token needs the scope transactions:custom:price. If you modify the price and tax rate, Ucommerce will not edit those values in the future.

Parameters

  • lineId (string)

  • priceGroupId Price Groups

  • cultureCode, e.g. en-US (string)

Optional Parameters

  • quantity (integer)

  • price (decimal)

  • taxRate (decimal)

Error Handling

Error
Description

BadRequest (400)

The product does not exist; Price Group does not exist; Order Line does not exist; Mismatch between Cart and Price Group's currency; pipeline execution fails.

Unauthorized (401)

The token is expired.

Forbidden (403)

The token does not have access to this endpoint.

NotFound (404)

Cart does not exist.

Error Response Example

Error Handling

Last updated

Was this helpful?