لم يُكتب وصف هذه العملية بالعربية بعد، فأوصافها بالإنجليزية.
Generate codes
POST
/ admin/ v1/ stores/ {store_id}/ discounts/ {discount_id}/ codes/ batches- discounts:write
- يدعم Idempotency-Key
Starts making a batch of codes in the background.
معاملات المسار
store_idstringمطلوبمعرّف من نوع
store، مثلstore_01k8qs5s…. يصل إلى التطبيق مع التثبيت، في رابط OAuth وفي رد رمز الوصول.discount_idstringمطلوبمعرّف من نوع
disc، مثلdisc_01k8qs5s….
الترويسات
Idempotency-Keystringأرسل المفتاح نفسه لإعادة المحاولة بأمان: تُعاد الإجابة الأولى لمدة ٢٤ ساعة.
shop-api-versionYYYY-MMالإصدار الذي تُكتب به الإجابة. بدونه يُستخدم الإصدار المثبّت لتطبيقك، وإلا الأحدث.
الجسم
countintegerمطلوبHow many: 1 to 100,000.
prefixstring · أو nullWhat each code starts with, up to 16 letters, digits, dashes or underscores.
lengthinteger · أو nullRandom characters per code: 8 to 16, 10 by default.
ما يُرجعه
202 Making them.
الأخطاء
- 403
forbiddenMissing permission. - 404
not_foundNo such discount. - 409A batch is running, or there would be too many.
- 422
validation_failedInvalid count, prefix or length.