Coupon

Get a specific coupon

Retrieves details of a specific coupon by ID

get/api-offers/coupon/{couponId}

Request

Path parameters

couponIdstring required

ID of the coupon to be retrieved

Headers

x-site-contextstring required
Example:{"date": "2023-01-01T00:00:00.000Z", "channel": 12, "account": "1234abcd5678efgh9ijklmno","stage":"production"}

The x-site-context header is a JSON object that contains information about the source you wish to pull from. The mandatory account is the 24 character identifier found in Copilot. The channel (Sales channel ID), stage (environment name), and date attributes can be used to further narrow the scope of your data source.

Response

OK

_idstring

fabric internal unique id

promoIdnumber

System generated unique ID of promotion

promoCodesstring[]

A list of coupon codes that are applicable only for coupons. For coupons, the response includes promo codes associated with the coupon. For promotions, the response includes an empty array.

state'ACTIVE' | 'SCHEDULED' | 'DISABLED' | 'EXPIRED'

Promotion status. <br /> ACTIVE: Promotion is applied to the SKUs or items for which it is set as Active. Active promotions cannot be disabled.<br />SCHEDULED: Promotion is scheduled to be applied to the SKUs or items based on the start date. <br />DISABLED: Promotion is set as disabled and is not in use. Only Disabled promotions can be enabled.<br />EXPIRED: Promotion is stopped by setting the expiration date. That is, the start date and end date are the same as current date. Only those promotions that are not expired can be enabled.

isImplicitboolean

A flag indicating whether an offer is applied automatically. Set it to true for promotions, which should be applied automatically and false for coupons, which must be applied explicitly.

titlestring

Title of the promotion

buyOperator'AND' | 'OR'

It is used to define operator between different Buy conditions (different conditions as mentioned in the condition object)

startDatestring date-time

Start date of the promotion

endDatestring date-time

End date of the promotion

isExclusiveboolean

A flag indicating whether a coupon can be stacked with an existing promotion. Set it to true to prevent the coupon from being applied to items that already have promotions and false to allow coupon to be applied with existing promotions.

type'PRODUCT' | 'CART' | 'QUANTITY' | 'BOGO' | 'SHIPPING' | 'BUYGET' | 'SPEND_GET'

Promotion type.<br /> Product: SKU promotion. Promotion or discount on SKUs based on the value mentioned in discount object<br />CART: Cart promotion. Promotion or discount on minimum cart amount based on the ORDER_VALUE that is set in condition object<br />QUANTITY: Quantity promotion provides discounts based on the quantity requirement set in the promotion<br />BOGO: Buy One Get One promotion provides discounts based on the Buy conditions and Get discounts<br />SHIPPING: Shipping promotion provides discounts on the shipping cost<br />BUYGET: BuyGet promotion specifies the Buy conditions and Get discounts<br />SPEND_GET: SpendGet promotion can specify the requirement of cart order value and the corresponding Get discounts

stackingType'STACKABLE' | 'EXCLUSIVE' | 'TYPE_EXCLUSIVE' | 'UNIVERSAL'

Defines the rules for how a promotion can be combined with other promotions. This field determines whether a specific promotion can be applied in conjunction with other active promotions during a transaction or if it must be used exclusively. Possible values: - STACKABLE: This promotion can be combined with other stackable promotions, allowing multiple discounts to be applied together. The order in which stackable promotions are applied is determined by the level field, with promotions having a higher priority (lower numeric value) being applied before those with a lower priority.

  • EXCLUSIVE: This promotion cannot be combined with any other promotions. The level field is used to determine which exclusive promotion will be evaluated and applied first. Once an exclusive promotion is applied, no other promotions can be used in the same transaction.
  • TYPE_EXCLUSIVE: This promotion cannot be combined with other promotions of the same type. The level field is used to determine which promotion within the same type will be evaluated and applied first.
  • UNIVERSAL: This promotion can be combined with any other promotions without restrictions. Universal promotions will be evaluated last. We don't need to define level for this type.
levelinteger

The promotion execution order. Promotion types are assigned default execution orders. Initial evaluation begins with level 1 promotions. The result of level 1 is used as the base price for level 2. Similarly, the result of level 2 becomes the base price for level 3, and so on.

shipmentMethodIdsstring[]

Required for Shipping promo to provide eligible shipment methods

eligiblePriceListnumber[]

IDs of the price lists to which this promotion is applied

limitsobject[]

The array of limits that are applied to the coupon. It should be empty array for all promotions except for BuyGet and Product promotions. That is, if the type is mentioned as Product and BuyGet.

notestring

Promo note or description

createdAtstring date-time

Creation date of the record

updatedAtstring date-time

Last updated date of the record

Example response

{
  "_id": "abcdefg1ee7ce20123456789",
  "promoId": 100013,
  "promoCodes": [
    "SUMMER100",
    "SUMMER20"
  ],
  "state": "SCHEDULED",
  "title": "CREATE PROMO",
  "buyOperator": "OR",
  "promo": [
    {
      "discount": [
        {
          "unit": "%OFF",
          "value": 10,
          "ON": {
            "kind": "SKU",
            "value": "*",
            "quantity": 2,
            "includeOperator": "OR",
            "excludeOperator": "AND"
          }
        }
      ],
      "targetProducts": [
        {
          "kind": "SKU",
          "value": "*",
          "operator": "IN"
        }
      ],
      "condition": [
        {
          "includeOperator": "OR",
          "excludeOperator": "AND",
          "conditions": [
            {
              "key": "SKU",
              "value": "*",
              "operator": "IN"
            }
          ]
        }
      ]
    }
  ],
  "startDate": "2019-08-24T14:15:22Z",
  "endDate": "2019-08-25T14:15:22Z",
  "isExclusive": true,
  "type": "PRODUCT",
  "stackingType": "STACKABLE",
  "level": 1,
  "termsAndConditions": [
    {
      "title": "Terms Applied",
      "description": "Items cannot be exchanged"
    }
  ],
  "promotionMessages": [
    {
      "title": "Buy 1 get 1 free",
      "message": "Offer valid at participating stores through September 5, 2023.",
      "pages": [
        "PDP",
        "Cart"
      ],
      "locales": [
        "en-CA",
        "fr-CA"
      ]
    }
  ],
  "eligiblePriceList": [
    10000056
  ],
  "limits": [],
  "note": "Independence day sale!",
  "createdAt": "2019-08-20T14:15:22Z",
  "updatedAt": "2019-08-20T14:15:22Z"
}

Changes

No recorded changes to this operation across all 2 revisions of this API.