Coupons
Create Coupon
Learn how to create coupons using the endpoint POST /stores//coupons.
POST
Create coupon
Endpoint
POST /stores/{storeId}/coupons
Creates a new coupon for products and/or categories.
Authentication
- Private route.
- Requires header
Authorizationwith your API key and active plan.
Route parameters
Body (JSON)
At least one of
productIds and categoryIds must be sent.
Request example
Standard snippet (cURL)
Use the cURL example from the Request example section above as the official snippet.Success response (201)
Possible errors
400 INVALID_DATA-> invalid body400 INVALID_DATA_CODE->codemissing or outside 3 to 32 characters400 INVALID_DATA_DISCOUNT->discountmissing or outside 1 to 100400 INVALID_DATA_USE_LIMIT->useLimitoutside -1 to 9999400 INVALID_DATA_RULES-> invalid or malformedrules400 INVALID_DATA_EXPIRED_AT-> invalidexpiredAtor not in the future400 INVALID_DATA_SCOPE_REQUIRED-> neitherproductIdsnorcategoryIdswas sent400 RELATION_NOT_FOUND-> invalid product/category401 API_KEY_NOT_PROVIDED->Authorizationheader not provided401 INVALID_API_KEY-> invalid API key401 UNAUTHENTICATED-> unauthenticated user403 USER_DISABLED-> user disabled403 NO_ACTIVE_SUBSCRIPTION-> no active plan403 COUPON_LIMIT_REACHED-> plan coupon limit reached404 STORE_NOT_FOUND-> store not found409 COUPON_ALREADY_EXISTS-> code already exists429 RATE_LIMIT_EXCEEDED-> per-minute rate limit exceeded500 INTERNAL_SERVER_ERROR-> internal error503 SERVICE_UNAVAILABLE-> service unavailable
Body
application/json
Coupon details (code, discount, expiration).