انتقل إلى المحتوى

لم يُكتب وصف هذه العملية بالعربية بعد، فأوصافها بالإنجليزية.

Add a variant

POST/store/v1/carts/{cart_id}/lines
  • يدعم Idempotency-Key

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

معاملات المسار

  • cart_idstringمطلوب

    معرّف من نوع cart، مثل cart_01k8qs5s….

الترويسات

  • X-Cart-Tokenstringمطلوب

    The cart's token

  • Idempotency-Keystring

    أرسل المفتاح نفسه لإعادة المحاولة بأمان: تُعاد الإجابة الأولى لمدة ٢٤ ساعة.

  • shop-api-versionYYYY-MM

    الإصدار الذي تُكتب به الإجابة. بدونه يُستخدم الإصدار المثبّت لتطبيقك، وإلا الأحدث.

الجسم

  • product_idstringمطلوب

    TypeID with the prod prefix.

  • variant_idstringمطلوب

    TypeID with the var prefix.

  • quantityintegerمطلوب
  • selling_plan_idstring · أو 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 · أو null

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

ما يُرجعه

200 The updated cart.

الأخطاء

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