更新折扣
更新您账户中的折扣。
授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
路径参数
Discount Id
请求体
Request body for patching (updating) a discount.
All fields are optional and only update if provided.
If present, update the discount amount in basis points (e.g., 540 = 5.4%, 10000 = 100%).
Must be at least 1 if provided.
If present, update the discount code (uppercase).
If present, fully replaces the discount's currency options (replace-set
semantics, like restricted_to). Send an empty array to clear them.
If present, update who may redeem this discount. Plain field (not
double-option): the DB column is NOT NULL, so it can never be cleared
back to unset, only changed to another CustomerEligibility value.
any, first_time, existing, specific Additional metadata for the discount
If present, update the per-customer usage limit (double-option: send
null to clear it back to unlimited). Must be <= usage_limit (the
value in effect after this patch) when both are set.
Whether this discount should be preserved when a subscription changes plans. If not provided, the existing value is kept.
If present, replaces all restricted product IDs with this new set. To remove all restrictions, send empty array
If present, update starts_at (double-option: send null to clear it).
Number of subscription billing cycles this discount is valid for. If not provided, the discount will be applied indefinitely to all recurring payments related to the subscription.
If present, update the discount type (percentage or flat).
flat, percentage 响应
Updated discount
The discount amount in basis points (e.g., 540 => 5.4%).
The business this discount belongs to.
The discount code (up to 16 chars).
Timestamp when the discount is created
Who may redeem this discount code.
any, first_time, existing, specific The unique discount ID
Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
Whether this discount should be preserved when a subscription changes plans. Default: false (discount is removed on plan change)
List of product IDs to which this discount is restricted.
How many times this discount has been used.
The type of discount (percentage or flat).
flat, percentage Per-currency options (flat deduction / percentage cap + minimum subtotal). Empty for discounts without any configured currency options.
Optional date/time after which discount is expired.
Name for the Discount
Maximum number of times a single customer may redeem this discount, if any.
Optional date/time before which the discount is not yet active. NULL = active immediately.
Number of subscription billing cycles this discount is valid for. If not provided, the discount will be applied indefinitely to all recurring payments related to the subscription.
Usage limit for this discount, if any.