Disable Promotion
Disables a promotion. The change is final: a disabled promotion is never enabled again.
PATCH
Disable Promotion
Disabling is the only change a promotion acceptsSend
{ "status": "DISABLED" }, with DISABLED in capitals. A body with any other field answers 400 INVALID_REQUEST, and a status that is missing or is not DISABLED answers 400 INVALID_PARAMETERS. To change a discount, a date, a condition or the code, disable the promotion and create a new one.X-Account-Code header. A promotion of another account, and an id that no promotion holds, answer 404 PROMOTION_NOT_FOUND.
Disabling is idempotent. A second call answers the promotion with the same disabled_at as the first.
What disabling does
- A code stops applying to new payments. A payment that carries the code afterwards is refused with
422 PROMOTION_NOT_APPLICABLEand the reasonDISABLED. No payment is created. - A retry of an earlier payment is still priced. A payment that repeats the
X-Idempotency-Keyand the code of an earlier use is priced from that use, even after you disable the promotion. - The code becomes free. A disabled promotion no longer holds its code, so you can create a new promotion with the same code.
- The uses stay.
limits.usedkeeps the count, and a use is never given back.
Authorizations
Headers
The account_id found in your Yuno Dashboard (UUID). Required. A promotion belongs to one account, and this header names it. Omitting it returns 400 INVALID_PARAMETERS ("x-account-code header is required.").
Path Parameters
Body
application/json
Response
- The promotion, with
statusDISABLEDand itsdisabled_at.
A promotion. Every member is present, with null for an absent value.