v1

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

Update coupon

The API allows an ADMIN role user to update a coupon by sending the required data in the request body and specifying the couponId in the path variable.

This endpoint grants authorized users the ability to modify existing coupon details, such as its code, discount amount, expiration date, or any other relevant attributes.

patch/ecommerce/coupons/{couponId}

Request body

couponCodestring
discountValuenumber
namestring

Example request

{
  "couponCode": "First350",
  "discountValue": 350,
  "name": "First 350 code"
}

Response

Update coupon

messagestring
statusCodenumber
successboolean

Example response

{
  "data": {
    "_id": "648850c3718cdeb85439aefc",
    "couponCode": "FIRST350",
    "createdAt": "2023-06-13T11:19:31.227Z",
    "discountValue": 350,
    "expiryDate": "2024-06-13T11:07:10.693Z",
    "minimumCartValue": 400,
    "name": "First 350 code",
    "owner": "648849ef0d88524a26bad487",
    "startDate": "2023-12-13T11:07:10.693Z",
    "type": "FLAT",
    "updatedAt": "2023-06-13T11:42:56.421Z"
  },
  "message": "Coupon updated successfully",
  "statusCode": 201,
  "success": true
}