لم يُكتب وصف هذه العملية بالعربية بعد، فأوصافها بالإنجليزية.
Add discount code
POST
/ store/ v1/ carts/ {cart_id}/ discount-codes- يدعم Idempotency-Key
Apply a discount code. Unknown codes are refused; codes that don't apply yet stay on the cart with the reason in discount_codes.
معاملات المسار
cart_idstringمطلوبمعرّف من نوع
cart، مثلcart_01k8qs5s….
الترويسات
X-Cart-TokenstringمطلوبThe cart's token
Idempotency-Keystringأرسل المفتاح نفسه لإعادة المحاولة بأمان: تُعاد الإجابة الأولى لمدة ٢٤ ساعة.
shop-api-versionYYYY-MMالإصدار الذي تُكتب به الإجابة. بدونه يُستخدم الإصدار المثبّت لتطبيقك، وإلا الأحدث.
الجسم
codestringمطلوب
ما يُرجعه
200 The updated cart.
الأخطاء
- 404
not_foundNo such cart. - 409A payment is in progress, or the cart is completed.
- 422
validation_failedInvalid code, or too many codes. - 429
rate_limitedToo many wrong codes from this cart or address: try again later.