# Disable Promotion

<Warning>
**Promotions is enabled per organization**

This endpoint works only after WHITELABEL enables Promotions for your organization. Ask your Technical Account Manager or Key Account Manager. See [Promotions](/docs/payment-features/promotions#enable-promotions-for-your-organization).
</Warning>

<Warning>
**Disabling is final**

A disabled promotion can't be enabled again, and there's no delete endpoint. To run the offer again, create a new promotion.
</Warning>

What disabling does and doesn't do:

* It stops **new quotes** from that moment.
* A quote issued before you disabled the promotion is still honoured until it expires. The customer already saw that price.
* Payments already charged, their discount line and their `discount_amount`, don't change.

The body accepts `status` only. Any other field returns `400 INVALID_REQUEST`.

**PATCH** `/promotions/{promotion_id}`

Base URL: `https://api-sandbox.whitelabel.com/v1`

The only change a promotion accepts. Disabling stops new quotes; it is final. Promotions must be enabled for your organization by WHITELABEL before you can use this endpoint. See [Promotions](/docs/payment-features/promotions#enable-promotions-for-your-organization).

## Authorization

- public-api-key (apiKey in header)
- private-secret-key (apiKey in header)

## Header parameters

- `X-Idempotency-Key` (string, required)
  A unique key (UUID) for the request. Sending the same key again within 24 hours returns the original response and stores nothing new.

## Path parameters

- `promotion_id` (string, required)
  The unique identifier of the promotion.

## Body

Content type: `application/json`

- `status` ("DISABLED", required)
  `DISABLED` is the only accepted value. Any other field in the body returns `400`.

Example:

```json
{
  "status": "DISABLED"
}
```

## Responses

### 200

200

- `id` (string)
  The unique identifier of the promotion (UUID).
- `account_id` (string)
  The account the promotion belongs to (UUID, found in your [WHITELABEL Dashboard](https://dashboard.whitelabel.com/developers)). One promotion applies to one account. If you run the same campaign on several accounts, create it once per account.
- `name` (string)
  The promotion name (MAX 255; MIN 3). The checkout uses it when it announces the discount.
- `description` (string)
  Shown with the name on the quote. Optional, up to 1000 characters.
- `schedule` (object)
  The window in which the promotion runs. UTC.
  - `starts_at` (string<date-time>, required)
    When the promotion starts (ISO 8601, UTC). Now or in the future.
  - `ends_at` (string,null<date-time>)
    When the promotion ends (ISO 8601, UTC). `null` means no end date.
- `redemption` (object)
  How the promotion is redeemed. `code` is required when `mode` is `CODE`.
  - `mode` ("AUTOMATIC" | "CODE", required)
    `AUTOMATIC` = applies by itself to every payment that meets the conditions. `CODE` = applies only when the payment's quote carries the promotion `code`. Not available yet: today every promotion is `AUTOMATIC`; codes are coming in a later release.
  - `code` (string,null)
    `CODE` only; `null` for an automatic promotion. 3 to 32 characters: `A-Z`, `0-9`, `_` and `-`. Unique per account among the promotions that can still apply; reusable once the earlier promotion with that code is disabled or its schedule has ended.
- `discount` (object)
  What the customer saves. For `FIXED`, when the promotion also has an `amounts` condition, `discount.amounts` and `conditions.amounts.values` must list the same currencies or the request returns `400`.
  - `type` ("PERCENTAGE" | "FIXED", required)
  - `value` (number,null)
    `PERCENTAGE` only. Greater than 0 and up to 100, with up to two decimals (for example `10.5`). `null` for a fixed discount.
  - `amounts` (array,null)
    `FIXED` only. One entry per currency, each above zero. A fixed promotion applies only to payments in the currencies it lists, and the discount is capped at the payment amount. `null` for a percentage discount.
- `conditions` (object)
  Conditions a payment must meet. AND across keys, OR inside each key's values list. Omit a key or send `null` for no condition on that dimension; an empty `values` list returns `400`.
  - `bins` (object)
    Card BIN condition. A card matches when its BIN equals a prefix in `values` or falls in a `ranges` entry. At least one of `values` or `ranges` when `bins` is present.
    - `values` (string[])
      BIN prefixes (6 to 8 digits each).
    - `ranges` (object[])
      Inclusive BIN ranges (8-digit bounds).
      - `start` (string, required)
        First BIN of the range (8 digits).
      - `end` (string, required)
        Last BIN of the range (8 digits), inclusive.
  - `payment_methods` (object)
    - `values` (string[])
      Payment method types, for example `CARD`. See [Payment type list](/reference/payment-type-list).
  - `card_types` (object)
    - `values` ("CREDIT" | "DEBIT"[])
      Card types. A card whose type is unknown never meets this condition.
  - `countries` (object)
    - `values` (string[])
      Payment countries ([ISO 3166-1](/reference/country-reference)).
  - `amounts` (object)
    - `values` (object[])
      Amount bounds per currency (`min` and `max` inclusive).
      - `currency` (string, required)
        MAX 3; MIN 3; [ISO 4217](/reference/country-reference).
      - `min` (number,null<float>)
        Inclusive minimum in this currency. `null` with `max` also `null` filters by currency only.
      - `max` (number,null<float>)
        Inclusive maximum in this currency. `null` means no ceiling.
- `status` ("SCHEDULED" | "ACTIVE" | "EXPIRED" | "DISABLED")
  Computed from `schedule` when you read the promotion. `DISABLED` is final.
- `created_at` (string<date-time>)
- `disabled_at` (string,null<date-time>)
  When you disabled the promotion (ISO 8601, UTC). `null` while not disabled.

Example:

```json
{
  "id": "string",
  "account_id": "string",
  "name": "string",
  "description": "string",
  "schedule": {
    "starts_at": "1970-01-01T00:00:00.000Z",
    "ends_at": null
  },
  "redemption": {
    "mode": "AUTOMATIC",
    "code": null
  },
  "discount": {
    "type": "PERCENTAGE",
    "value": null,
    "amounts": null
  },
  "conditions": {
    "bins": {
      "values": [
        "string"
      ],
      "ranges": [
        {
          "start": "string",
          "end": "string"
        }
      ]
    },
    "payment_methods": {
      "values": [
        "string"
      ]
    },
    "card_types": {
      "values": [
        "CREDIT"
      ]
    },
    "countries": {
      "values": [
        "string"
      ]
    },
    "amounts": {
      "values": [
        {
          "currency": "string",
          "min": null,
          "max": null
        }
      ]
    }
  },
  "status": "SCHEDULED",
  "created_at": "1970-01-01T00:00:00.000Z",
  "disabled_at": null
}
```

### 400

400

- `code` (string)
- `messages` (string[])

Example:

```json
{
  "code": "INVALID_REQUEST",
  "messages": [
    "string"
  ]
}
```

### 404

404

- `code` (string)
- `messages` (string[])

Example:

```json
{
  "code": "PROMOTION_NOT_FOUND",
  "messages": [
    "string"
  ]
}
```