Skip to main content
POST
/
shops
/
{shopId}
/
applydiscount
/
cart
/
{cartId}
Apply Discount to Cart
curl --request POST \
  --url http://staging.qshop.ng/apiv2/shops/{shopId}/applydiscount/cart/{cartId} \
  --header 'Content-Type: application/json' \
  --data '
{
  "code": "<string>"
}
'
{
  "msg": "<string>",
  "data": {
    "entityId": "<string>",
    "shop": "<string>",
    "email": "<unknown>",
    "items": [
      {
        "setAttributesForVariants": true,
        "_id": "<string>",
        "name": "<string>",
        "shop": "<string>",
        "tags": [
          {
            "_id": "<string>",
            "name": "<string>",
            "tempId": "<string>",
            "shop": "<string>",
            "__v": 123,
            "slug": "<string>",
            "productCount": 123,
            "imageUrl": "<string>"
          }
        ],
        "costPrice": 123,
        "price": 123,
        "sku": "<string>",
        "sale_price": 123,
        "stock": 123,
        "alwaysInStock": true,
        "media": "<string>",
        "media_type": "<string>",
        "digital": true,
        "draft": true,
        "type": "<string>",
        "variantsInheritPrice": true,
        "slug": "<string>",
        "__v": 123,
        "qty": 123,
        "originalPrice": 123,
        "finalPrice": 123,
        "subTotal": 123,
        "downloadCount": 123,
        "downloadLimit": "<unknown>",
        "cartItemId": "<string>"
      }
    ],
    "subTotal": 123,
    "total": 123,
    "created": "<string>",
    "_id": "<string>",
    "discountsApplied": [
      {
        "usageRestriction": {
          "roles": {
            "exclude": "<array>",
            "accept": "<array>"
          },
          "users": {
            "condition": "<string>",
            "contains": "<array>"
          },
          "tags": {
            "condition": "<string>",
            "contains": "<array>"
          },
          "products": {
            "condition": "<string>",
            "contains": "<array>"
          },
          "categories": {
            "condition": "<string>",
            "contains": "<array>"
          }
        },
        "usageLimit": {
          "useIfNumberOfOrders": {
            "count": "<unknown>"
          },
          "maxNumberOfUses": 123,
          "canUseWithOtherCoupons": true,
          "maxNumberOfUsesPerUser": "<unknown>"
        },
        "_id": "<string>",
        "shop": "<string>",
        "code_type": "<string>",
        "amount": 123,
        "min_order": "<unknown>",
        "max_order": "<unknown>",
        "starts": "<string>",
        "expires": "<unknown>",
        "code": "<string>",
        "description": "<string>",
        "usageCount": 123,
        "applyOn": "<string>",
        "applyAutomatically": true,
        "created": "<string>",
        "isActive": true,
        "uuid": "<string>",
        "mediaType": "<string>",
        "url": "<string>",
        "isPublic": true,
        "__v": 123,
        "worth": 123
      }
    ],
    "discountAmount": 123,
    "shipping": 123,
    "shippingRate": {},
    "user": "<string>",
    "exclusiveDiscount": true,
    "order": "<unknown>"
  },
  "success": true
}

Path Parameters

shopId
string
required
cartId
string
required

Body

application/json
code
string
required

Response

200 - application/json
msg
string
required
data
object
required
success
boolean
required