Enable or disable a promotion

Lets you toggle promotion status by enabling or disabling a promotion, not applicable to ACTIVE promotions.
Enable a promotion: Only disabled promotions can be enabled.
Disable a promotion: Only not expired promotions can be disabled.

SecurityAuthorizationToken
Request
path Parameters
promoId
required
string

ID of the promotion to be toggled

header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Request Body schema: application/json
enable
required
boolean

flag to enable or disable a promotion.
If set to true, this endpoint enables a disabled promotion.
If set to false, this endpoint disables an enabled promotion.

Responses
200

OK

404

Not Found

500

Internal Server Error

put/api-offers/promo/{promoId}/enable-disable
Request samples
application/json
{
  • "enable": false
}
Response samples
application/json
{
  • "_id": "abcdefg1ee7ce20123456789",
  • "promoId": 100013,
  • "promoCodes": [ ],
  • "state": "DISABLED",
  • "isImplicit": true,
  • "title": "CREATE PROMO",
  • "buyOperator": "OR",
  • "promo": [
    ],
  • "startDate": "2019-08-24T14:15:22Z",
  • "endDate": "2019-08-25T14:15:22Z",
  • "isExclusive": true,
  • "type": "PRODUCT",
  • "termsAndConditions": [
    ],
  • "shipmentMethodIds": [
    ],
  • "eligiblePriceList": [
    ],
  • "limits": [
    ],
  • "note": "Independence day sale!",
  • "createdAt": "2019-08-20T14:15:22Z",
  • "updatedAt": "2019-08-20T14:15:22Z"
}