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

# Coupon Verify

> This callback endpoint is used to verify whether a coupon is allowed and how to apply it. When a customer enters a coupon code on the checkout page, this API endpoint will be used to validate the coupon code. Coupons are of three types: **`LIMITED_PERIOD`**, **`ONETIME`**, and **`FOREVER`**. They can be used to give a discount based on a percentage or a fixed amount. Please check examples for the same.

For percentage-based **`discountPcnt`** is required, for fixed amount-based **`discountQuoteAmount`** is required. Also for the limited period-based coupons, **`period`** and **`periodUnit`** both are required.



## OpenAPI

````yaml /api-reference/webhooks/webhooks.json post /coupon_verify/merchant_defined_callbackurl
openapi: 3.0.3
info:
  title: Webhooks
  description: API's to add and get webhook information.
  version: 1.0.0
servers:
  - url: https://webhook.site
    description: Merchant defined callback URL for testing purposes
security:
  - ApiKeyAuth: []
    SignatureAuth: []
paths:
  /coupon_verify/merchant_defined_callbackurl:
    post:
      tags:
        - Webhook
      summary: Coupon Verify
      description: >-
        This callback endpoint is used to verify whether a coupon is allowed and
        how to apply it. When a customer enters a coupon code on the checkout
        page, this API endpoint will be used to validate the coupon code.
        Coupons are of three types: **`LIMITED_PERIOD`**, **`ONETIME`**, and
        **`FOREVER`**. They can be used to give a discount based on a percentage
        or a fixed amount. Please check examples for the same.


        For percentage-based **`discountPcnt`** is required, for fixed
        amount-based **`discountQuoteAmount`** is required. Also for the limited
        period-based coupons, **`period`** and **`periodUnit`** both are
        required.
      operationId: couponVerifyWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                coupon:
                  type: string
                  example: CUSTOMER_COUPON_INPUT_FROM_CHECKOUT
                subscriptionId:
                  type: string
                  example: 66ec038b4115ed3a42fe76fa
      responses:
        '200':
          description: Webhook received successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  coupon:
                    type: string
                    example: cpn_123456789
                  applicable:
                    type: boolean
                    example: true
                  discountType:
                    type: string
                    example: PCNT
                  discountPcnt:
                    type: string
                    example: '20'
                  durationType:
                    type: string
                    example: LIMITED_PERIOD
                  periodUnit:
                    type: string
                    example: MONTH
                  period:
                    type: integer
                    example: 3
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Merchant API Key
    SignatureAuth:
      type: apiKey
      in: header
      name: x-signature
      description: Generated request signature

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.