Preview charge totals before billing one-time charges to a subscription
Present charge totals to a customer before billing a one-time charge to a subscription using the new preview a one-time charge for a subscription operation.
What's new?
We added the preview a one-time charge for a subscription operation to the Paddle API. You can use it to preview charge totals for a one-time charge before billing it.
How it works
You can use the create a one-time charge for a subscription operation to bill non-recurring prices to a subscription. It's typically used for one-off items, like setup or onboarding fees or support incident charges. You can choose to bill one-time charges now, or bill for them on the next renewal.
Send a request to the new /subscriptions/{id}/charge/preview
endpoint to preview billing a one-time charge to a subscription. It works similarly to the preview an update to a subscription operation, accepting an array of objects where each object contains a price ID and quantity.
The response contains immediate_transaction
and next_transaction
objects that you can use to get charging information to present to a customer in your frontend.
When you're ready, send the same request that you used to preview to the /subscriptions/{id}/charge
endpoint to bill for it.
Next steps
This change is available in version 1
of the Paddle API.
It's a non-breaking change, meaning it doesn't impact existing integrations.
Check out the preview a one-time charge for a subscription operation docs to get started.