Update a discount (PATCH semantics)
PATCH
/admin/v1/discounts/{id}
const url = 'https://your-store.example.com/admin/v1/discounts/example';const options = { method: 'PATCH', headers: {'Content-Type': 'application/json'}, body: '{"name":"example","code":"example","type":"percentage","value":1,"currency":"example","minCartAmount":1,"appliesTo":"all","targetIds":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"],"customerSegment":"all","stackable":true,"usageLimitTotal":1,"usageLimitPerCustomer":1,"startsAt":"2026-04-15T12:00:00Z","endsAt":"2026-04-15T12:00:00Z","active":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://your-store.example.com/admin/v1/discounts/example \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "code": "example", "type": "percentage", "value": 1, "currency": "example", "minCartAmount": 1, "appliesTo": "all", "targetIds": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "customerSegment": "all", "stackable": true, "usageLimitTotal": 1, "usageLimitPerCustomer": 1, "startsAt": "2026-04-15T12:00:00Z", "endsAt": "2026-04-15T12:00:00Z", "active": true }'Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” id
required
string
Request Body required
Section titled “Request Body required ” Media type application/json
object
name
string
type
string
value
integer
appliesTo
string
targetIds
Any of:
Array<string>
null
stackable
boolean
active
boolean