Update one of your discount codes
const url = 'https://api-omni.linra.net/api/v1/scent/discount-codes/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"discountType":"Percent","value":1,"validFrom":"2026-04-15T12:00:00Z","validTo":"2026-04-15T12:00:00Z","isActive":true,"totalUsageCap":1,"perCustomerCap":1,"productScope":"All","scopedVariantIds":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"],"minOrderValue":1}'};
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://api-omni.linra.net/api/v1/scent/discount-codes/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "discountType": "Percent", "value": 1, "validFrom": "2026-04-15T12:00:00Z", "validTo": "2026-04-15T12:00:00Z", "isActive": true, "totalUsageCap": 1, "perCustomerCap": 1, "productScope": "All", "scopedVariantIds": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "minOrderValue": 1 }'A full replace of every field EXCEPT the code string itself (immutable — see the create operation’s description).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Every field from CreateDiscountCodeRequest EXCEPT code (immutable), plus isActive. A full replace — every field states its final value.
object
A percentage (0,100] off, or a flat SAR amount off.
Null, or exactly 1 — see CreateDiscountCodeRequest.
Applies to your whole catalog, or to an explicit variant list (see scopedVariantIds).
Responses
Section titled “Responses”The updated code.
object
object
object
A percentage (0,100] off, or a flat SAR amount off.
Applies to your whole catalog, or to an explicit variant list (see scopedVariantIds).
Running total of successful redemptions.
Example
{ "state": "SUCCESS", "payload": { "discountType": "Percent", "productScope": "All" }}Request validation failed.
The envelope every /api/v1 ERROR response uses. state carries the machine-readable error code (see the Errors guide).
object
Always null on an error response.
object
object
Example
{ "state": "NOT_FOUND_ORDER", "payload": null}Unknown code (or it belongs to another account).
The envelope every /api/v1 ERROR response uses. state carries the machine-readable error code (see the Errors guide).
object
Always null on an error response.
object
object
Example
{ "state": "NOT_FOUND_ORDER", "payload": null}Too many requests — see the Rate limits guide. Retry after the Retry-After header (seconds).
The envelope every /api/v1 ERROR response uses. state carries the machine-readable error code (see the Errors guide).
object
Always null on an error response.
object
object
Example
{ "state": "NOT_FOUND_ORDER", "payload": null}Headers
Section titled “Headers”Seconds to wait before retrying.