Update a specific coupon

Updates a specific coupon by coupon ID

SecurityAuthorizationToken
Request
path Parameters
couponId
required
number

ID of the coupon to be updated

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
title
required
string [ 3 .. 120 ] characters

Promotion or coupon title

buyOperator
string
Default: "OR"

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

Enum: "AND" "OR"
required
Array of objects
startDate
required
string <date-time>

Start date of the promotion

endDate
required
string <date-time>

End date of the promotion

isExclusive
required
boolean

To define if a coupon can be stacked on promotions.
true: it is exclusively a coupon and coupon cannot be applied on items that already has promotions applied to them.
false: ccoupon can be applied on items that already has promotions applied to them.

type
required
string

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

Enum: "PRODUCT" "CART" "QUANTITY" "BOGO" "SHIPPING" "BUYGET" "SPEND_GET"
Array of objects (termsAndConditions)
shipmentMethodIds
Array of strings

Required for Shipping type promo to provide eligible shipment Methods

eligiblePriceList
Array of numbers

IDs of the price lists to which this promotion is applied

promoCodes
required
Array of strings

Returns an empty array for a promotion, but will contain promo codes for a coupon

Array of objects

Array of limits for the coupon to be applied

note
string

Promo note or description

Responses
200

OK

400

Bad request

404

Not Found

500

Internal Server Error

put/api-offers/coupon/update/{couponId}
Request samples
application/json
{
  • "title": "CREATE COUPON",
  • "buyOperator": "OR",
  • "promo": [
    ],
  • "startDate": "2019-08-24T14:15:22Z",
  • "endDate": "2019-08-25T14:15:22Z",
  • "isExclusive": true,
  • "type": "PRODUCT",
  • "termsAndConditions": [
    ],
  • "shipmentMethodIds": [
    ],
  • "eligiblePriceList": [
    ],
  • "promoCodes": [
    ],
  • "limits": [
    ],
  • "note": "Independence day sale!"
}
Response samples
application/json
{
  • "_id": "abcdefg1ee7ce20123456789",
  • "promoId": 100013,
  • "promoCodes": [
    ],
  • "state": "SCHEDULED",
  • "isImplicit": false,
  • "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"
}