Use the Coupon Validation API to verify manually entered coupon codes before applying
discounts. Validating coupons upfront—rather than waiting until checkout—gives customers
immediate feedback on whether their code works. The API checks if the coupon exists, is active,
hasn't reached redemption limits, and if the cart is eligible for the promotion.
Required Editions
Available in: Lightning Experience
Available in: Enterprise, Unlimited,
and Developer Editions with Real-Time Offer Management
How Coupon Validation Works
Integrate the Coupon Validation API with systems such as shopping sites and point-of-sale
(POS) systems. To validate coupons, provide up to 1,000 manually entered coupon codes in the
couponsToValidate request property.
If the cart already contains coupon codes in its coupon fields, the API also discovers and
validates those codes. You don't need to copy those codes into
couponsToValidate. For coupons that pass the coupon-level checks, the API
evaluates promotion eligibility based on where each code is attached.
For a coupon attached to the cart header, the API evaluates the entire cart.
For a coupon attached to a cart line, the API evaluates only that line. The line must
participate in a promotion associated with the coupon.
For each coupon code, the response provides these details.
An aggregate status across the applicable scopes. The status is Valid when
the coupon passes validation for at least one applicable scope. Otherwise, the status is
Invalid.
For a valid coupon, the valid scope, the associated promotion ID, and, for a
Line scope, the applicable cart line item IDs.
For an invalid coupon, the reason that validation failed.
Did this article solve your issue?
Let us know so we can improve!
Loading
Salesforce Help | Article
Cookie Consent Manager
Cookie Consent Manager
General Information
Required Cookies
Functional Cookies
Advertising Cookies
General Information
We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required Cookies
Always Active
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional Cookies
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising Cookies
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.