> ## Documentation Index
> Fetch the complete documentation index at: https://docs.minestorecms.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Apply Coupon & Giftcard

> Validates and applies a coupon or gift card to the user's cart if eligible. Provides appropriate messages based on the coupon or gift card status.



## OpenAPI

````yaml POST /cart/acceptCoupon
openapi: 3.0.0
info:
  title: MineStoreCMS REST API
  description: Documentation for MineStoreCMS Frontend REST API.
  version: 3.8.7
servers:
  - url: https://v3.minestorecms.com/api
    description: Example URL of Demo Server
security: []
tags: []
paths:
  /cart/acceptCoupon:
    post:
      tags:
        - cart
      summary: Apply a coupon or gift card to the user's cart
      description: >-
        Validates and applies a coupon or gift card to the user's cart if
        eligible. Provides appropriate messages based on the coupon or gift card
        status.
      requestBody:
        content:
          application/json:
            schema:
              required:
                - coupon
              properties:
                coupon:
                  type: string
                  maxLength: 40
                  description: The code for the coupon or gift card to apply.
      responses:
        '200':
          description: Successfully applied the coupon or gift card.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: >-
                      Indicates if the coupon or gift card was successfully
                      applied.
                  message:
                    type: string
                    description: >-
                      A message indicating the result of applying the coupon or
                      gift card.
                  percent:
                    type: number
                    format: float
                    description: Discount percentage if a coupon was applied.
                  amount:
                    type: number
                    format: float
                    description: Discount amount if a coupon was applied.
                  sum:
                    type: number
                    format: float
                    description: The amount of the gift card used.
                  type:
                    type: string
                    description: The type of the applied code, either 'coupon' or 'gift'.
        '400':
          description: >-
            Bad Request - Various cases where the coupon or gift card is not
            valid for the cart.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates the operation was unsuccessful.
                  message:
                    type: string
                    description: >-
                      Details about why the coupon or gift card could not be
                      applied (e.g., expired, limit reached).
        '401':
          description: Unauthorized - Invalid or missing Access Token.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates the operation was unsuccessful.
                  message:
                    type: string
                    description: Details about the unauthorized access or error.
        '404':
          description: Not Found - The coupon or gift card does not exist.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates the operation was unsuccessful.
                  message:
                    type: string
                    description: >-
                      Details about why the coupon or gift card could not be
                      found.
      deprecated: false
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````