Existing deployments may require a data migration to use this feature. To get access, please contact us.
- A
provider_customer_id, linking the Lago customer to their PSP record (for example,cus_abc123in Stripe) - A
provider_method_id, which identifies the specific payment instrument stored in the PSP
provider_customer_id and targets the appropriate provider_method_id. The PSP then processes the payment using the selected payment method.
How payment methods are created
There are four ways a payment method can be created and stored.1. Checkout URL
This is the primary path for new customers. When a customer is created in Lago with a payment provider assigned andsync_with_provider set to true, Lago:
- Creates a corresponding customer record in the PSP.
- Emits a
customer.checkout_url_generatedwebhook containing a checkout URL. - You redirect the customer to this URL.
- The customer completes the form. No funds are collected at this stage.
- Once confirmed, the PSP securely stores the payment method for future transactions.
2. Syncing an existing PSP customer
If the customer already exists in the PSP with a payment method on file, you can link them to Lago without going through the checkout flow. By settingsync_with_provider to false and providing the existing provider_customer_id, Lago retrieves the default payment method stored in the PSP and attaches it to the customer. No checkout URL is generated.
This is useful when migrating customers from another billing system, or when the customer and their mandate/card already exist in Adyen or GoCardless.
3. Generate a new checkout URL
Once the customer is connected to a PSP, you can generate a new checkout URL at any time to capture a new payment method:- Dashboard
- API
To generate a new checkout URL:
- Navigate to the customer’s information tab;
- In the Payment methods section, click Add a payment method;
- Click Generate link, so Lago requests a new checkout URL from the PSP;
- Copy the generated URL and share it with your customer.
4. Auto-capture from Payment link
When an invoice has apending or failed payment status, you can generate a one-off payment checkout link:
How payment methods are assigned to billing objects
You can define a payment method when creating:- A subscription
- A one-off invoice
- A wallet top-up (purchased or recurring)
Manual payment does not exempt an invoice from dunning. It only stops the automatic charge when the invoice is finalized. If that invoice later becomes overdue and the customer is enrolled in a dunning campaign, Lago can still attempt an automatic payment for the overdue balance through the customer’s payment provider. This also applies to a billing object that was switched to Manual payment because its payment method became inactive. See automatic dunning to learn how to exclude a customer from these attempts.