Fetches a paginated list of discounts from the Paddle API. By default, only active discounts are returned.

paddle_list_discounts(
  id = NULL,
  code = NULL,
  status = NULL,
  mode = NULL,
  after = NULL,
  order_by = NULL,
  per_page = NULL
)

Arguments

id

Character vector of discount IDs (e.g., `"dsc_xxx"`). Optional.

code

Character vector of discount codes. Optional.

status

Character vector of discount statuses (one of `"active"`, `"archived"`). Optional.

mode

Character. Filter discounts by mode (one of `"standard"`, `"custom"`). Optional.

after

Character. Return entities after the specified Paddle ID (used for pagination). Optional.

order_by

Character. Ordering string (e.g., `"id[ASC]"` or `"created_at[DESC]"`). Optional.

per_page

Integer. Number of results per page (max 200). Optional, defaults to 50.

Value

A list containing discount data and pagination metadata.

Examples

if (FALSE) { # paddle_has_token()
set_paddle_mode("sandbox")
result <- paddle_list_discounts()
}