Skip to main content
PATCH
Update a coupon

Authorizations

Authorization
string
header
required

YuvexPay API key. Include as Authorization: Bearer ypk_<env>_<kid>_<secret> where <env> is test (sandbox) or live (production). Create and manage keys in the dashboard under Settings > API Keys.

Path Parameters

couponId
string<uuid>
required

The coupon ID.

Body

application/json

Send only the fields to change. null clears a nullable field. Changing type without the value of the new type returns 400 COUPON_VALUE_INVALID, since the value of the old type is cleared.

code
string

3 to 32 characters from A-Z, 0-9, _ and -, after trimming. Stored uppercase, so black10 is saved as BLACK10. Unique among the coupons of your account in this environment that are not deleted (409 COUPON_CODE_TAKEN).

type
enum<string>
Available options:
PERCENT,
FIXED
percentBp
integer | null
Required range: 1 <= x <= 10000
amount
number | null
Required range: x <= 1000000
validFrom
string<date-time> | null
validUntil
string<date-time> | null
maxRedemptions
integer | null
Required range: 1 <= x <= 1000000
maxRedemptionsPerBuyer
integer | null
Required range: 1 <= x <= 1000000
productIds
string<uuid>[]

Replaces the whole list.

Maximum array length: 100
active
boolean

Response

Coupon updated.

coupon
object
required