paddle_update_discount | R Documentation |
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
)
id |
Character. The Paddle discount ID (e.g., "dsc_123"). Required. |
status |
Character vector of discount statuses (one of '"active"', '"archived"'). Optional. |
description |
Character. Internal description. Optional. |
enabled_for_checkout |
Logical. Available for checkout? Optional. |
code |
Character. Discount code. Optional. |
type |
Character. Type of discount ('"percentage"', '"flat"', or '"flat_per_seat"'). Optional. |
mode |
Character. Filter discounts by mode (one of '"standard"', '"custom"'). Optional. |
amount |
Character. Discount amount. Optional. |
currency_code |
Character. Required for "flat"/"flat_per_seat". Optional. |
recur |
Logical. Repeating discount? Optional. |
maximum_recurring_intervals |
Integer. Number of repeats. Optional. |
usage_limit |
Integer. Max redemptions. Optional. |
restrict_to |
Character vector. Product or price IDs. Optional. |
expires_at |
Character. RFC 3339 datetime string. Optional. |
custom_data |
Named list. Custom metadata. Optional. |
A list containing the updated discount and metadata.
set_paddle_mode("sandbox")
result <- paddle_update_discount(
id = "dsc_123",
description = "Updated description")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.