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

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

Update discount

PATCH/admin/v1/stores/{store_id}/discounts/{discount_id}
  • discounts:write

Partially update a discount. Send If-Match: "v{version}" to avoid overwriting someone else's changes.

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

  • store_idstringمطلوب

    معرّف من نوع store، مثل store_01k8qs5s…. يصل إلى التطبيق مع التثبيت، في رابط OAuth وفي رد رمز الوصول.

  • discount_idstringمطلوب

    معرّف من نوع disc، مثل disc_01k8qs5s….

الترويسات

  • If-Matchstring · أو null

    ETag from the last read, e.g. "v3"

  • shop-api-versionYYYY-MM

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

الجسم

  • titlestring · أو null
  • title_translationsobject · أو null

    Replaces the names in other languages; a blank name removes that language.

  • codestring · أو null
  • effectobject | object | object | object | object | object · أو null

    What a discount does.

  • requirementobject | object | object · أو null

    What the cart must contain.

  • eligibilityobject | object | object | object · أو null

    Who may use a discount.

  • combines_withobject · أو null

    The other kinds of discounts this one can be used together with.

  • availabilityobject · أو null

    Where and for whom a discount is offered, and what it never applies to.

ما يُرجعه

200 Updated discount.

الأخطاء

  • 404not_foundNo such discount.
  • 409Code taken or automatic discount limit reached.
  • 412precondition_failedThe discount changed since it was read.
  • 422validation_failedValidation failed.