Sends a POST request to the Paddle API to create a new discount.
paddle_create_discount(
amount,
description,
type,
enabled_for_checkout = NULL,
code = NULL,
mode = NULL,
currency_code = NULL,
recur = NULL,
maximum_recurring_intervals = NULL,
usage_limit = NULL,
restrict_to = NULL,
expires_at = NULL,
custom_data = NULL
)
Character. Amount to discount by. Required.
Character. Internal description of the discount. Required.
Character. Type of discount (`"percentage"`, `"flat"`, or `"flat_per_seat"`). Required.
Logical. Can be used at checkout? Optional.
Character. Optional promo code (letters/numbers, max 32 characters).
Character. Filter discounts by mode (one of `"standard"`, `"custom"`). Optional.
Character. Required for `"flat"` or `"flat_per_seat"`. Optional.
Logical. Should it recur for subscriptions? Optional.
Integer. Number of times to recur. Optional.
Integer. Maximum redemptions. Optional.
Character vector of product or price IDs. Optional.
Character. RFC 3339 datetime string. Optional.
Named list. Custom metadata. Optional.
A list containing the created discount and metadata.
if (FALSE) { # paddle_has_token()
set_paddle_mode("sandbox")
result <- paddle_create_discount(
amount = "10.00",
description = "10% off",
type = "percentage")
}