Updates an existing discount by ID via the Paddle API.
paddle_update_discount(
id,
status = NULL,
description = NULL,
enabled_for_checkout = NULL,
code = NULL,
type = NULL,
mode = NULL,
amount = NULL,
currency_code = NULL,
recur = NULL,
maximum_recurring_intervals = NULL,
usage_limit = NULL,
restrict_to = NULL,
expires_at = NULL,
custom_data = NULL
)
Character. The Paddle discount ID (e.g., "dsc_123"). Required.
Character vector of discount statuses (one of `"active"`, `"archived"`). Optional.
Character. Internal description. Optional.
Logical. Available for checkout? Optional.
Character. Discount code. Optional.
Character. Type of discount (`"percentage"`, `"flat"`, or `"flat_per_seat"`). Optional.
Character. Filter discounts by mode (one of `"standard"`, `"custom"`). Optional.
Character. Discount amount. Optional.
Character. Required for "flat"/"flat_per_seat". Optional.
Logical. Repeating discount? Optional.
Integer. Number of repeats. Optional.
Integer. Max redemptions. Optional.
Character vector. Product or price IDs. Optional.
Character. RFC 3339 datetime string. Optional.
Named list. Custom metadata. Optional.
A list containing the updated discount and metadata.
if (FALSE) { # paddle_has_token()
set_paddle_mode("sandbox")
result <- paddle_update_discount(
id = "dsc_123",
description = "Updated description")
}