Skip to main content
PUT
Error

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

code
string
required

Body

application/json

Coupon amounts are explicit per policy. Checkout accepts one coupon for regular courses only, rejects combination with existing course discounts, rounds percentage discount down to whole IDR, and recalculates the tax-inclusive price snapshot.

code
string
required
Required string length: 3 - 64
Pattern: ^[A-Za-z0-9_-]+$
discount_type
enum<string>
required
Available options:
fixed,
percentage
minimum_purchase_idr
integer<int64>
required
Required range: x >= 0
global_usage_limit
integer<int64>
required
Required range: x >= 1
per_user_usage_limit
integer<int64>
required
Required range: x >= 1
eligible_product_types
enum<string>[]
required

MVP permits regular courses only; BNSP is excluded.

Minimum array length: 1
Available options:
regular
eligible_course_ids
string[]
required
eligible_all_regular_courses
boolean
required

When true eligible_course_ids must be empty; when false it must contain one or more course IDs.

valid_from
string<date-time>
required
valid_until
string<date-time>
required
status
enum<string>
required
Available options:
draft,
active,
disabled
discount_value_idr
integer<int64>

Required only for fixed discounts.

Required range: x >= 1
discount_basis_points
integer

Required only for percentage discounts; 100 basis points equals one percent.

Required range: 1 <= x <= 10000
max_discount_idr
integer<int64>

Required only for percentage discounts.

Required range: x >= 1

Response

Coupon updated; existing pending reservations remain bound to the previous policy version.