Skip to main content
Off-session charges let you charge a customer’s saved payment method without sending them through checkout, for example for a credit top-up. You create a draft order, then finalize it to charge the customer.
Off-session charges are in preview. Paid plans have early access to all preview features. In sandbox, opt in to preview features from Settings → Billing.

Prerequisites

You can use off-session charges with one-time products only. Free, fixed-price and unit-based products are supported. The customer needs a billing address so Polar can calculate tax, and a saved payment method. The address needs at least a country, and also a state, postal code or city in countries that require them. Customers who went through an earlier checkout or have an active subscription already have both. Others can add a payment method in the Customer Portal, or on your site with the Embedded Payment Method.

Create a draft order

POST /v1/orders/ creates an order with status: "draft" and no invoice number. The customer isn’t charged.
Creating a draft sends the order.created webhook. The customer isn’t emailed.

Finalize the order

POST /v1/orders/{id}/finalize charges the customer and returns the result. It uses the customer’s default payment method, or the one you pass as payment_method_id.
If the charge succeeds, the order becomes paid and gets an invoice number. Polar grants the product’s benefits before responding, emails the customer a confirmation and sends order.paid. In the dashboard, the order shows under Sales → Orders as Draft until it’s finalized, then as Paid. Open it to see the Payment attempts for each try.

Handle failures

If the charge fails, the API returns an error and the order stays draft. Fix the cause and finalize the same order again. Failed attempts don’t use an invoice number.

Payment authentication

When a charge needs the customer to authenticate, for example with a 3D Secure challenge, the 402 error is PaymentActionRequired and the order stays draft. The customer completes the payment on the order’s pay page in the Customer Portal:
The customer signs in to the portal with an email code. After they pay, Polar grants the benefits and sends order.paid, the same as a successful finalize. If the customer is already signed in to your app, you can skip the email code. Create a customer session and add its token to the URL:
The token expires after one hour, so create the session when you redirect.

Learn more