anyshop docs homeStatusOpen the dashboard

API reference Coupons Archive a coupon

API referenceCoupons

Archive a coupon

POST methodhttps://api.anyshop.io/v1/coupons/{id}/archive

Retires the coupon: buyers can no longer use it, its code is free for a new coupon, and its uses stay on record. Archiving an archived coupon changes nothing. Needs a live key.

  • Scope coupons:write
  • Live keys only
  • Idempotent with Idempotency-Key
  • 403 store_suspended while suspended

Path parameters

  • idstring required

Headers

  • Idempotency-Keystring Up to 255 characters. A retry with the same key and request gets the first answer, without running twice (24 hours).

Returns

The coupon object.

Errors

Status and error.type
  • 400invalid_requestThe request is not valid; error.param names the field
  • 401authenticationNo API key, or it is not valid
  • 403permissionThe key does not have the scope this needs, or the store is suspended (store_suspended)
  • 404not_foundNot found in the key's store and mode
  • 409conflictConflicts with the object's state (type conflict), or an Idempotency-Key reused for another request (type idempotency, code idempotency_key_reused)
  • 429rate_limitedToo many requests; see Retry-After