HowToUse

How To Use?

Coupon is a module that provides a discount for an order.

Coupons are defined by the system user.


Define a Coupon

URL : /v2.0/coupons/apps/

METHOD : POST

REQUEST :

{
  "code": "my1",
  "totalPrice": 100,
  "currency": "TRY",
  "expireDate": "2022-07-25T12:06:44.590Z",
  "totalNumber": 10,
  "type": "Percent",
  "value": 10,
  "description": "string"
}

RESPONSE :

{
  "success": true,
  "data": {
    "id": "62d3fb5d7d6498a1c03c6c66",
    "code": "my1",
    "totalPrice": 100,
    "currency": "TRY",
    "expireDate": "2022-07-25T12:06:44.59Z",
    "totalNumber": 10,
    "type": "Percent",
    "value": 10,
    "description": "string"
  }
}

Parameters Of Coupon

Code Total Price Currency Expire Date Total Number Type Value
Unique Coupon Code Minimum shopping cart amount Currency of discount Expire date of coupon number of coupon type of coupon (Percent, Fixed) Value of coupon

Apply Coupon to Shopping Cart

The current shopping cart scenario should not change.

Use ApplyCoupon endpoint.

URL : /v2.0/users//shopping-cart/coupons/

After, call GetCart endpoint.

{
  "success": true,
  "data": {
    "userId": "furkan",
    "appId": "11ed16c8-bfd9-48b8-bdb9-540896939fdf",
    "culture": "en",
    "couponId": "62d3fb5d7d6498a1c03c6c66",
    "items": [
      {
        "id": "62d001f3ab014c35d2e5381f",
        "productId": "62d001f3ab014c35d2e5381f",
        "displayName": "Product Name",
        "quantity": 4,
        "price": 30,
        "product": {
          "id": "62d001f3ab014c35d2e5381f",
          "appId": "11ed16c8-bfd9-48b8-bdb9-540896939fdf",
          "isUnLimitedStock": false,
          "title": "32",
          "images": [],
          "description": "<p>43</p>",
          "stock": 20,
          "stockCode": "fd",
          "price": 30,
          "currency": "TRY",
          "maxQuantityPerOrder": 33,
          "itemType": "PHYSICAL",
          "shippingPrice": 0,
          "orderIndex": 0,
          "isPublished": true,
          "isActive": true,
          "publishmentDate": "2022-07-14T11:45:55.178Z",
          "endDate": "2122-07-14T11:45:55.178Z",
          "createDate": "2022-07-14T11:45:55.178Z",
          "updateDate": "2022-07-14T11:45:55.178Z",
          "useFixPrice": false,
          "variantData": []
        },
        "messages": [
          {
            "key": "UpdatedProduct",
            "message": "UpdatedProduct",
            "type": "Warning"
          }
        ],
        "isValid": true,
        "createDate": "0001-01-01T00:00:00",
        "updateDate": "0001-01-01T00:00:00"
      }
    ],
    "invalidItems": [],
    "messages": [],
    "currency": "TRY",
    "subTotalPrice": 120,
    "totalPrice": 108,
    "couponPrice": 12,
    "shippingPrice": 0,
    "updateDate": "2022-07-17T14:45:12.747Z",
    "createDate": "2022-07-17T14:45:12.747Z"
  }
}

If CouponId and CouponPrice parameters not null coupon is used.