Updates a subscription using its ID. Required for changes like billing date, items, or proration.
paddle_update_subscription(
id,
customer_id = NULL,
address_id = NULL,
business_id = NULL,
currency_code = NULL,
next_billed_at = NULL,
discount = NULL,
collection_mode = NULL,
billing_details = NULL,
items = NULL,
proration_billing_mode = NULL,
on_payment_failure = NULL,
custom_data = NULL,
scheduled_change = NULL
)
Character. Required. The ID of the subscription (e.g. "sub_abc123").
Character. Optional. Paddle customer ID.
Character. Optional. Paddle address ID.
Character or NULL. Optional.
Character. Optional. Supported: "USD", "EUR", "GBP" (for manual collection).
Character. Optional. RFC 3339 datetime string.
List or NULL. Optional. Must include `id` (string) and `effective_from` (string, must be one of `"immediately"` or `"next_billing_period`), or NULL to remove.
Character. Optional. One of: `"automatic"`, `"manual"`.
List or NULL. Required if `collection_mode` is "manual", NULL if changing collection_mode to automatic. Must include `enable_checkout` (boolean), `purchase_order_number` (string), `payment_terms` (list with `interval` (`day`, `week`, `month` or `year`) and `frequency` (integer)) and optional `additional_information` (string)
List of item lists. Optional. Each must include `price_id` (string) and `quantity` (numeric). If updating an existing item and not changing the quantity, you may omit quantity.
Character. Required when making changes that impact billing. Must be one of: `"prorated_immediately"`, `"prorated_next_billing_period"`, `"full_immediately"`, `"full_next_billing_period"` and `"do_not_bill"`.
Character. Optional. Must be one of: `"prevent_change"`, `"allow_change"`.
Named list or NULL. Optional.
NULL. Set to NULL to remove a scheduled change.
A list with updated subscription entity and metadata.
if (FALSE) { # paddle_has_token()
set_paddle_mode("sandbox")
result <- paddle_update_subscription(
id = "sub_123",
custom_data = list(purpose = "example")
)
}