R/subscriptions.R
paddle_preview_one_time_charge.Rd
Previews a one-time charge for a subscription without billing it. Used to estimate the result of a charge for non-recurring items.
paddle_preview_one_time_charge(
id,
effective_from,
items,
on_payment_failure = NULL
)
Character. Required. The Paddle subscription ID (e.g. "sub_abc123").
Character. Required. When the one-time charge should be billed (RFC 3339 format).
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. Optional. Must be one of: `"prevent_change"`, `"allow_change"`.
A list with preview of immediate and next transactions.
if (FALSE) { # paddle_has_token()
set_paddle_mode("sandbox")
result <- paddle_preview_one_time_charge(
id = "sub_123",
effective_from = "2025-07-01T00:00:00Z",
items = list(list(price_id = "pri_123", quantity = 1))
)
}