v1

latestOpenAPI 3.0.3raw.githubusercontent.com2024-10-2916802.4 MB
🛒 Ecommerce

Update coupon active status

The API endpoint allows an administrator role user to update the activity status of a coupon.

It expects a request with a path variable couponId indicating the specific coupon to update. In the request body, there should be a isActive key, which is a boolean value indicating the desired status of the coupon.

When this API is called, it toggles the active status of the coupon. This functionality allows the administrator to enable or disable the use of certain coupon codes in the application.

patch/ecommerce/coupons/status/{couponId}

Request body

isActiveboolean

Example request

{
  "isActive": true
}

Response

Update coupon active status

messagestring
statusCodenumber
successboolean

Example response

{
  "data": {
    "_id": "6488b8390023c81cf454a16c",
    "couponCode": "FIRST150",
    "createdAt": "2023-06-13T18:40:57.774Z",
    "discountValue": 150,
    "expiryDate": "2024-06-13T11:07:10.693Z",
    "minimumCartValue": 400,
    "name": "First order",
    "owner": "6488b7790023c81cf454a115",
    "startDate": "2023-02-13T11:07:10.693Z",
    "type": "FLAT",
    "updatedAt": "2023-06-14T06:20:28.746Z"
  },
  "message": "Coupon is inactive.",
  "statusCode": 200,
  "success": true
}