Skip to content

Add a variant

POST/store/v1/carts/{cart_id}/lines
  • Idempotency-Key supported

Add a variant, or more of it when it's already in the cart.

Path parameters

  • cart_idstringrequired

    The cart's ID, like cart_01k8qs5s….

Headers

  • X-Cart-Tokenstringrequired

    The cart's token

  • Idempotency-Keystring

    Send the same key to retry safely: the first answer is replayed for 24 hours.

  • shop-api-versionYYYY-MM

    The version to answer in. Without it, your app’s pinned version, else the newest.

Body

  • product_idstringrequired

    TypeID with the prod prefix.

  • variant_idstringrequired

    TypeID with the var prefix.

  • quantityintegerrequired
  • selling_plan_idstring · or null

    Subscribe with one of the product's selling plans; absent: bought once. Adding a variant the cart has sets its line's plan.

  • inputsobject

    Answers to the product's questions, by input ID. The same variant with other answers is a line of its own.

  • propertiesobject

    Free names and values the line keeps and shows in the cart, checkout and order, such as an engraving or a gift message: at most 10, names up to 60 characters, values up to 500. The same variant with other properties is a line of its own.

  • bookingobject · or null

    For a bookable service: the slot (one of its availability's), and who provides it (null: anyone free). quantity is the seats.

Returns

200 The updated cart.

Errors

  • 404not_foundNo such cart.
  • 409A payment is in progress, or the cart is completed.
  • 422validation_failedUnavailable product or invalid quantity.