Verify coupon
Coupons
Verify coupon
Validate a coupon code and calculate the discount amount before applying it to an order.
POST
Verify coupon
Request
Headers
| Header | Type | Description |
|---|---|---|
Content-Type | string | Always set to application/json. |
x-shop-id | string | Shop identifier to associate the user with your store. |
Authorization | string | Optional Bearer token for authenticated requests. |
This endpoint supports both authenticated and unauthenticated requests.
Authentication is optional but recommended to validate user-specific coupon
usage limits.
Body parameters
| Field | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Coupon code to verify (case-insensitive). |
orderId | string | No | Order ID to validate coupon against order total. |
Successful response
Response fields
| Field | Type | Description |
|---|---|---|
_id | string | Unique coupon identifier. |
code | string | Coupon code. |
type | string | Coupon type: fixed or percentage. |
discount | number | Discount value (fixed amount or percentage). |
discountAmount | number | Calculated discount amount based on order subtotal. |
minimumOrderAmount | number | Minimum order amount required to use the coupon. |
startDate | string | Date when the coupon becomes active. |
endDate | string | Date when the coupon expires. |
title | string | Human-readable description of the coupon discount offer. |
Validation checks
The endpoint performs the following validations:Coupon exists and is active
Coupon belongs to the specified shop
Coupon is within valid date range (between start and end dates)
Global usage limit has not been exceeded
Per-user usage limit has not been exceeded (for authenticated users)
Order meets minimum amount requirement (if orderId provided)
Error responses
Invalid coupon code
Coupon expired
Minimum order not met
Usage limit reached
Headers
Optional identifier that scopes responses to a specific storefront when the referer cannot be inferred.
Body
application/json

