View source: R/subscriptions.R
paddle_preview_one_time_charge | R Documentation |
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
)
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"'. |
A list with preview of immediate and next transactions.
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))
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.