Authorization
Request Body
Discount coupon expiration date. When omitted, the discount and its coupon do
not expire (
expiredAt is stored as null).List of eligible products (maximum 2). Leave empty to apply the discount to all
products. Each item can be either a product
id string or an object with an
id field you own — both forms are accepted:"products": ["c9aa143a-53f9-44e7-a9c6-83229ad7199b"]"products": [{ "id": "c9aa143a-53f9-44e7-a9c6-83229ad7199b" }]
discount Structure (Object)
Discount type:
- monetary
- percentage
percentage, a value greater than 99 is automatically capped at 99.Available coupon quota (must be positive). For
onetime coupons, a maximum of
50 codes are generated per request.coupon Structure (Object)
Discount coupon code. Optional — when omitted, a random code is generated. Only
used for
reusable coupons; onetime coupons always receive generated codes.products Structure (Array Of Object)
Response
Successful ResponseMain Structure (Root)
data Structure (Object)
Discount product scope:
all when no products are attached, selected when one
or more products are provided.Expiration date in ISO 8601 format, or
null when the discount does not expire.coupons Structure (Array Of Object)
products Structure (Array Of Object)
Errors
Returned with
messages: "Validation Error" when the request body fails
validation (e.g. missing or malformed name, discount, or coupon fields).Returned with
messages: "Product Tidak Bisa Ditambahkan" when an attached
product is not owned by the authenticated account.