Add Line Item
POST
/store/:storeCode/carts/:cartId/line-itemsAdd a line item to a cart.
Path Parameters
storeCoderequiredstringStore slug in the URL (first argument to every SDK store method).
cartIdrequiredstringThe cart's ID.
Query Parameters
fieldsstringComma-separated fields to include. Prefix with `*` to expand a relation (e.g. `id,*variants`).
Request Body
Schema
CopyHttpTypes.StoreAddCartLineItem
Properties
variant_idrequiredstringProduct variant ID.
quantityrequirednumberQuantity to add.
metadataRecord<string, unknown>Custom metadata for the line item.
Response
Status
200OK
Schema
CopyHttpTypes.StoreCartResponse
Properties
cartrequiredStoreCartThe cart with the new line item.