Update a discount code
PATCH /rest/v1/storefront/discounts/{id}
Changes only the fields sent (e.g. {value: 15} keeps the type). Each invalid field answers 422 with its param; 409 code_exists when the new code is taken.
Required scope: storefront:write.
Authorization
apiKey Authorization: Bearer nbl_live_... (or nbl_test_... for test mode). Test-mode writes are validated and simulated but never persisted and never touch channels; simulated results are marked simulated.
In: header
Path Parameters
Header Parameters
Unique client-generated key (max 255 chars), stored 24h.
length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X PATCH "https://example.com/storefront/discounts/string" \ -H "Content-Type: application/json" \ -d '{}'{ "id": "disc_66f0a1", "object": "discount", "code": "SUMMER10", "type": "percentage", "value": 0, "min_subtotal": 0, "usage_limit": 0, "used": 0, "ends_at": "2019-08-24T14:15:22Z", "active": true, "created_at": "2019-08-24T14:15:22Z", "simulated": true}Last updated on October 18, 2026
Need help?
Email us and a human replies, usually within one business day.