v1

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

Remove coupon code

The API for removing an applied coupon allows a logged-in user to remove a coupon code that was previously applied to their cart.

Once the coupon is removed, the API recalculates the total value of the cart without considering the discount amount, resulting in a non-discounted cart value.

This API essentially resets the cart to its original value before the coupon was applied, removing any discounts that were previously applied.

post/ecommerce/coupons/c/remove

Request body

couponCodestring

Example request

{
  "couponCode": "must be unique like 'CORRUPTI845'"
}

Response

Remove coupon code

messagestring
statusCodenumber
successboolean

Example response

{
  "data": {
    "_id": "6488b7c50023c81cf454a139",
    "cartTotal": 5060,
    "discountedTotal": 5060,
    "items": [
      {
        "_id": "6488b7c50023c81cf454a139",
        "coupon": null,
        "product": {
          "__v": 0,
          "_id": "6488b7ba0023c81cf454a12f",
          "category": "6488b7980023c81cf454a11f",
          "createdAt": "2023-06-13T18:38:50.413Z",
          "description": "New description number 2",
          "mainImage": {
            "_id": "6488b7ba0023c81cf454a130",
            "localPath": "public/images/christmas_card.png-168668153030924254640.png",
            "url": "http://localhost:8080/images/christmas_card.png-168668153030924254640.png"
          },
          "name": "Kids product",
          "owner": "6488b7790023c81cf454a115",
          "price": 230,
          "stock": 23,
          "subImages": [
            {
              "_id": "6488b7ba0023c81cf454a131",
              "localPath": "public/images/diagram-export-05_06_2023,-17_10_50.png-168668153031198888310.png",
              "url": "http://localhost:8080/images/diagram-export-05_06_2023,-17_10_50.png-168668153031198888310.png"
            }
          ],
          "updatedAt": "2023-06-13T19:19:17.437Z"
        },
        "quantity": 22
      }
    ]
  },
  "message": "Coupon removed successfully",
  "statusCode": 200,
  "success": true
}