DashForDevsDocs
DocsNewsAPI v1
dashfordevs.comSign in

© 2026 DashForDevs

DocsNewsdashfordevs.comLegalStatus
DocsDiscountsValidate Code
Introduction
Getting Started
Authentication
Products
Categories
Cart
Checkout
Blog
Reviews
Webhooks
Customers
Orders
Inventory
Shipping
Discounts
Discount CodesAffiliate CodesBulk PricingValidate Code
Affiliates
Email
Media & Files
Analytics & Tracking
Locations
Tax
Global Data
SEO
Error Handling
Geography
Finance
Automations
Page Types
Surveys
Billing & Subscriptions
Storefront Payments
SDK Reference
REST API
Storefront Architecture
Notifications
Security
Team & Permissions
Migrations & Import
Calendar & Appointments
Contact Forms
AI Bots
Dashboard API
Deployment
Changelog
Troubleshooting
Recipes
CLI & Deployment
Image Pipeline
White-label Platforms
Records Engine
Platform Modules
Platform Security
Site Keys & Client Sites
Use Cases
Operations

Validate Code

Check if a discount code is valid and get its details.

Updated March 29, 2026

On this page
  • Overview
  • REST API
  • Response
  • Invalid Code Response
  • Common Validation Failures
  • Next Steps

Overview

Validate a discount code before applying it to see if it's valid and what the discount will be.

REST API

shell
POST /storefront/discount/validate
X-API-Key: pk_live_your_key
Content-Type: application/json

{
  "code": "SAVE20",
  "subtotal": "99.99"
}

Response

json
{
  "valid": true,
  "code": "SAVE20",
  "is_percentage": true,
  "rate": "20",
  "discount_amount": "20.00"
}

Invalid Code Response

json
{
  "valid": false,
  "message": "This code has expired"
}

Common Validation Failures

  • Code not found — The code doesn't exist
  • Code expired — The code's expiration date has passed
  • Maximum uses reached — The code has been used too many times
  • Minimum order not met — The subtotal is below the minimum order amount

Next Steps

  • Apply Discount Code — Apply the validated code
  • Discount Codes — Overview of discount types
PreviousBulk PricingNextAffiliate Registration

On this page

  • Overview
  • REST API
  • Response
  • Invalid Code Response
  • Common Validation Failures
  • Next Steps