Skip to content

Update one of your discount codes

PATCH
/api/v1/scent/discount-codes/{id}
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).

id
required
string format: uuid
Media typeapplication/json

Every field from CreateDiscountCodeRequest EXCEPT code (immutable), plus isActive. A full replace — every field states its final value.

object
discountType
required

A percentage (0,100] off, or a flat SAR amount off.

string
Allowed values: Percent FixedAmount
value
required
number format: decimal
validFrom
string format: date-time
nullable
validTo
string format: date-time
nullable
isActive
required
boolean
totalUsageCap
integer
nullable
perCustomerCap

Null, or exactly 1 — see CreateDiscountCodeRequest.

integer
nullable
productScope
required

Applies to your whole catalog, or to an explicit variant list (see scopedVariantIds).

string
Allowed values: All VariantList
scopedVariantIds
Array<string>
nullable
minOrderValue
number format: decimal
nullable

The updated code.

Media typeapplication/json
object
state
required
string
payload
required
details
object
payload
required
object
id
string format: uuid
partnerId
string format: uuid
code
string
discountType

A percentage (0,100] off, or a flat SAR amount off.

string
Allowed values: Percent FixedAmount
value
number format: decimal
validFrom
string format: date-time
nullable
validTo
string format: date-time
nullable
isActive
boolean
totalUsageCap
integer
nullable
perCustomerCap
integer
nullable
productScope

Applies to your whole catalog, or to an explicit variant list (see scopedVariantIds).

string
Allowed values: All VariantList
scopedVariantIds
Array<string>
minOrderValue
number format: decimal
nullable
usageCount

Running total of successful redemptions.

integer
createdAt
string format: date-time
nullable
lastModifiedAt
string format: date-time
nullable
Example
{
"state": "SUCCESS",
"payload": {
"discountType": "Percent",
"productScope": "All"
}
}

Request validation failed.

Media typeapplication/json

The envelope every /api/v1 ERROR response uses. state carries the machine-readable error code (see the Errors guide).

object
state
required
string
payload
required

Always null on an error response.

object
details
object
Example
{
"state": "NOT_FOUND_ORDER",
"payload": null
}

Unknown code (or it belongs to another account).

Media typeapplication/json

The envelope every /api/v1 ERROR response uses. state carries the machine-readable error code (see the Errors guide).

object
state
required
string
payload
required

Always null on an error response.

object
details
object
Example
{
"state": "NOT_FOUND_ORDER",
"payload": null
}

Too many requests — see the Rate limits guide. Retry after the Retry-After header (seconds).

Media typeapplication/json

The envelope every /api/v1 ERROR response uses. state carries the machine-readable error code (see the Errors guide).

object
state
required
string
payload
required

Always null on an error response.

object
details
object
Example
{
"state": "NOT_FOUND_ORDER",
"payload": null
}
Retry-After
integer

Seconds to wait before retrying.