Skip to main content
PATCH
Disable Promotion
Promotions is enabled per organizationThis endpoint works only after Yuno enables Promotions for your organization. Until then it answers 404 PROMOTION_NOT_FOUND. Ask your Technical Account Manager or Key Account Manager. See Promotions.
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.
The promotion must belong to the account in the 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_APPLICABLE and the reason DISABLED. No payment is created.
  • A retry of an earlier payment is still priced. A payment that repeats the X-Idempotency-Key and 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.used keeps the count, and a use is never given back.

Authorizations

public-api-key
string
header
default:<Your public-api-key>
required
private-secret-key
string
header
default:<Your private-secret-key>
required

Headers

X-Account-Code
string
required

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

promotion_id
string<uuid>
required

The id of the promotion (UUID v4). A value that is not a UUID v4 returns 400 INVALID_PARAMETERS. A promotion of another account returns 404.

Body

application/json
status
enum<string>
required

Always DISABLED, in capitals. It is the only change a promotion accepts. A body with any other field returns 400 INVALID_REQUEST.

Available options:
DISABLED

Response

  1. The promotion, with status DISABLED and its disabled_at.

A promotion. Every member is present, with null for an absent value.

id
string<uuid>

The id of the promotion (UUID). Assigned by Yuno.

account_id
string<uuid>

The account the promotion belongs to.

name
string
description
string | null
schedule
object
redemption
object
discount
object
conditions
object

One key for each dimension, null when the promotion has no condition on it. A code promotion created with this API holds countries and amounts only.

limits
object | null

The cap of the code and the uses counted so far. null when the promotion has no cap.

status
enum<string>

Computed from schedule and from the disable at the moment you read the promotion.

Available options:
SCHEDULED,
ACTIVE,
EXPIRED,
DISABLED
created_at
string<date-time>
disabled_at
string<date-time> | null

null while the promotion is not disabled.