paddle_preview_one_time_charge {paddleR} | R Documentation |
Preview a one-time charge for a subscription
Description
Previews a one-time charge for a subscription without billing it. Used to estimate the result of a charge for non-recurring items.
Usage
paddle_preview_one_time_charge(
id,
effective_from,
items,
on_payment_failure = NULL
)
Arguments
id |
Character. Required. The Paddle subscription ID (e.g. "sub_abc123"). |
effective_from |
Character. Required. When the one-time charge should be billed (RFC 3339 format). |
items |
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. |
on_payment_failure |
Character. Optional. Must be one of: '"prevent_change"', '"allow_change"'. |
Value
A list with preview of immediate and next transactions.
Examples
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))
)
[Package paddleR version 0.1.2 Index]