POST /v2/discounts/validate is the public endpoint a checkout SPA (or a
partner-built custom checkout) calls to pre-validate a customer-entered coupon code against
the cart they are about to submit. It returns whether the code is eligible plus the
discount amount the customer would see at redemption time.
It is a precondition for redemption — the actual write (incrementing the code’s usage
counter and applying the discount to the order) happens server-side at the
checkout-intent resolver chokepoint when
the FE submits the cart with the validated discountCode field set.
Merchants create and configure their discount codes in the shop-builder admin (CRUD UI for
expiry / min-purchase / per-customer caps / scope). The shop-builder admin discount-creation
guide is coming — link will land once that page ships.
When to use
Call this once when a customer enters a code in the checkout UI, before enabling the “Apply” CTA or before posting the cart to checkout-intent. The endpoint never mutates state — calling it repeatedly is safe and rate-limited per IP. Partner integrators building a custom storefront on top of droplinked’s catalog and checkout backbone should call this endpoint immediately beforePOST /v2/checkout/intent so the customer sees the post-discount total in the cart
summary that matches what redemption will actually charge.
This endpoint does not redeem. It does not decrement remaining uses, does not mark a
code as consumed, and does not bind the code to a customer. Redemption (incrementing usage
count, applying the line-item discount, recording the redemption event) happens at
POST /v2/checkout/intent when the discountCode field is provided.POST /v2/discounts/validate
Authentication
None — public endpoint. Rate-limited per IP (60 req/min).Request body
Example request
Response — 200 OK, code valid
Response — 200 OK, code invalid
valid). The endpoint only
returns non-200 for malformed input (400) or rate-limit (429).
Reason codes
Whenvalid: false, the reason field carries a stable enum the FE maps to a
human-readable message.
The enum is stable — new reason codes will only be added, never renamed. FE clients should
default to a generic “This code can’t be applied” string when an unknown reason arrives.
Error responses
JavaScript example
For partner integrators
Partners building custom checkouts on top of droplinked’s catalog and checkout backbone should callPOST /v2/discounts/validate immediately before submitting the cart to
POST /v2/checkout/intent. The pattern is:
- Customer enters a code in your checkout UI
- Your storefront calls
POST /v2/discounts/validatewith the current cart shape - If
valid: true, render the post-discount cart total in the summary and pass the validated code through as thediscountCodefield onPOST /v2/checkout/intent - The checkout-intent resolver redeems the code as part of the same transaction that creates the order
Related
- Checkout payment-intent resolver — the chokepoint where validated discount codes are redeemed.
- Merchants overview — the merchant-facing view of how discounts fit into the order lifecycle.
- Shop-builder admin discount-creation guide — coming (lands once the admin docs page ships).