Skip to main content

Add item to a shopping cart

POST 

/api/cart/:id/item/add

Add an item to a shopping cart using its ID.

Request

Path Parameters

    id stringrequired

    The ID of the cart to which the item will be added

Body

required

    line_items

    object[]

  • Array [

  • product_id number

    ID of the product

    variant_id number

    ID of the variant (optional)

    quantity number

    price_data

    object

    unit_price number
    tax number
    currency string
    compare_at number
    shipping_id string
  • ]

Responses

Successful addition of item to the cart

Schema

    any

Loading...