Skip to content

Add several variants at once

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

Add several variants at once, such as a look's pieces or a bundle a theme builds: all of them or, when one can't be bought, none. Each is added as POST /carts/{cart_id}/lines would; problems are reported under lines[<index>].

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

  • linesarray of objectsrequired

    1 to 25 lines.

Returns

200 The updated cart.

Errors

  • 404not_foundNo such cart.
  • 409A payment is in progress, or the cart is completed.
  • 422validation_failedAn unavailable product, an invalid quantity, or more than 25 lines.