Skip to content

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.

Path parameters

  • store_idstringrequired

    The store's ID, like store_01k8qs5s…. Apps get it with the install, in the OAuth redirect and the token response.

  • discount_idstringrequired

    The discount's ID, like disc_01k8qs5s….

Headers

  • If-Matchstring · or null

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

  • shop-api-versionYYYY-MM

    The version to answer in. Without it, your app’s pinned version, else the newest.

Body

  • titlestring · or null
  • title_translationsobject · or null

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

  • codestring · or null
  • effectobject | object | object | object | object | object · or null

    What a discount does.

  • requirementobject | object | object · or null

    What the cart must contain.

  • eligibilityobject | object | object | object · or null

    Who may use a discount.

  • combines_withobject · or null

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

  • availabilityobject · or null

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

Returns

200 Updated discount.

Errors

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