Skip to main content

Watch the demo video

Integration setup

To set up the integration with Stripe through the user interface:
  1. In the side menu, select “Settings”;
  2. Select the “Integrations” tab;
  3. Click “Stripe” and add a new connection;
  4. Give this new connection a name and a code;
  5. Enter your Stripe API key (locate your API key); and
  6. Click “Connect to Stripe” to confirm.
By default, customers created in Lago are not automatically created in Stripe. If you want your Lago customers to be added to Stripe, you need to activate this option (learn more).

Redirect URL after checkout

After you connect Stripe, set a success URL where your end customer lands after completing the checkout. If you do not define one, your end customer is redirected to Stripe’s website. You can edit or delete the redirect URL. The change only applies to checkout URLs created afterwards.
The URL must begin with http:// or https://.
You can require your customers to accept your terms of service before paying on the Stripe checkout and payment pages that Lago generates. When this option is enabled, a mandatory “I agree to the Terms of Service” checkbox is shown on the page, and the customer cannot complete the payment until it is checked. This option is configured per Stripe connection and is turned off by default, so existing connections are not affected. To enable it, navigate to Settings > Integrations > Stripe, open your connection settings, and turn on Consent collection.
Before enabling this option, you must set a Terms of service URL in your Stripe account, under Settings > Business > Public details.If Consent collection is enabled while no Terms of service URL is set on the Stripe account, Stripe rejects the request and Lago is unable to generate the checkout or payment link. Your customer will not receive a working link until the URL is added, and Lago surfaces the Stripe error in the API response and through the related payment webhooks.
Once enabled, consent collection applies to every Stripe checkout page Lago generates: the payment-method checkout link, invoice payment links, and payment-request links.

Customer information

To collect payments automatically, the customer must exist in both the Lago and Stripe databases.

New customer

If the customer does not already exist in Stripe, you can first create them in Lago, either via the user interface or the API. When adding customer information, you must:
  1. Define Stripe as the default payment provider;
  2. Leave the field associated with the Stripe customer ID blank;
  3. Enable the option to automatically create the customer in Stripe; and
  4. Define payment method options for this customer. Possible values are card, link, sepa_debit, us_bank_account, bacs_debit, boleto, crypto or customer_balance.
Lago adds the customer to Stripe automatically. Stripe returns the customer ID, which Lago stores.
Customer creation form with Stripe set as the payment provider and the automatic creation option enabled

Creation of a new customer with Stripe

Existing customer

If the customer already exists in Stripe but not in Lago, you should create the customer record, either via the user interface or the API. When adding customer information, you must:
  1. Define Stripe as the default payment provider;
  2. Provide the Stripe customer ID;
  3. Disable the option to automatically create the customer in Stripe; and
  4. Define payment method options for this customer. Possible values are card, link, sepa_debit, us_bank_account, bacs_debit, boleto, crypto or customer_balance.
Customer form with the existing Stripe customer ID filled in and the automatic creation option disabled

Migration of an existing Stripe customer

Supported payment methods

Lago’s Stripe integration supports a variety of payment methods, both generic and region specific. The checkout URL provided by Lago handles several payment options at once.

General payment methods

Lago’s Stripe integration includes a universal card payment method that supports various currencies, for global transactions. This method is the default one, so Lago can process recurring charges for your customers.
Lago accepts invoice payments via Stripe bank transfers (customer balance). Supported methods include:
  • JPY: Japan
  • GBP: United Kingdom
  • EUR: Specific SEPA countries (see Stripe documentation)
  • MXN: Mexico
  • USD: United States, United Kingdom, and select SEPA countries
If you are using the customer_balance payment method in Lago, no other payment method can be selected.

Digital wallets

Apple Pay and Google Pay are wallets surfaced by Stripe Checkout on top of the card payment method. They do not require a separate value in provider_payment_methods. Enabling card in Lago is sufficient. They appear automatically on the Lago-generated checkout URL and on one-off invoice payment links when the customer is on a compatible device.
Apple Pay is offered to customers on supported Apple devices (Safari on macOS, iOS) when card is included in provider_payment_methods and Apple Pay is activated in your Stripe Dashboard. Stripe handles domain verification and wallet display.No additional value is needed in provider_payment_methods, the payload is identical to the Card payment method.
Apple Pay must be activated in your Stripe Dashboard. On unsupported devices, customers see the standard card form as a fallback.
Google Pay is offered to customers on supported devices (Chrome, Android) when card is included in provider_payment_methods and Google Pay is activated in your Stripe Dashboard. Stripe handles wallet display and tokenization.No additional value is needed in provider_payment_methods, the payload is identical to the Card payment method.
Google Pay must be activated in your Stripe Dashboard. On unsupported devices, customers see the standard card form as a fallback.

Localized payment methods

For European customers, Lago supports Stripe SEPA Debit (Single Euro Payments Area). Accepting a mandate through this method authorizes you to debit your customers’ accounts for recurring payments via Lago. The payment method for SEPA transactions in Lago is sepa_debit. This payment option only works for invoices in EUR.
For US-based transactions, Lago integrates Stripe ACH Debit, leveraging the Automated Clearing House for electronic bank-to-bank payments. Upon accepting a mandate, you gain authorization to execute recurring debits from your customers’ accounts through Lago. The payment method for ACH transactions in Lago is us_bank_account. This payment option only works for invoices in USD.
For UK transactions, Lago integrates Stripe BACS Debit, utilizing the UK’s BACS system for direct bank-to-bank payments. By accepting a mandate with this method, you’re authorized to initiate recurring debits from your customers’ accounts through Lago. The payment method for BACS transactions in Lago is bacs_debit. This payment option only works for invoices in GBP.
For transactions in Brazil, you can process payments using Boleto vouchers. In Lago, this payment method is identified as boleto. Note that Boleto is only valid for invoices denominated in Brazilian Real (BRL). Additionally, Boleto payments cannot be refunded and are unlikely to be successfully disputed.
Lago invoices can be paid via Stripe Crypto for USD-denominated invoices only. Payments must be made using stablecoins, such as USDC or USDP.

Shared Payment Token

For agent-initiated purchases, where an AI agent pays on the customer’s behalf and there is no checkout page, Stripe issues a Shared Payment Token that Lago can collect against automatically. See the Shared Payment Token guide.

Stripe Checkout: storing customer’s payment method information

The checkout page shows only the payment methods selected for the customer.
When Lago automatically creates a customer in Stripe, Lago returns a checkout link that your customer uses to store their payment method information. Lago generates this link only when at least one payment method of the customer can be saved from a checkout page: card, link, sepa_debit, us_bank_account, bacs_debit or boleto. A customer set to crypto or customer_balance alone gets no checkout link, and the regenerate endpoint answers with a validation error. The payload sent by Lago has the following structure, with the checkout link stored under checkout_url:
The checkout link expires after 24 hours.
With this checkout link, your customers can perform a pre-authorization payment. The pre-authorization does not collect any funds from the customer. Once it is confirmed, Lago sends the payment method details to Stripe, which stores them for future transactions. If your end customer has not completed the checkout, or wants to change their saved payment information, generate a new checkout link with the dedicated endpoint.
The new checkout link is returned in the endpoint response, not through a webhook message. It inherits the same expiration setting as the original one. If the customer is not associated with any payment provider, the response contains an error message.

Default payment method

When you add a new payment method in Stripe, Lago automatically sets it as the default. This guarantees that Lago uses the latest payment method for a customer. However, if you manually designate one of multiple payment methods as the default, Lago will use it for payments instead of the most recent one.

Payment intents

Once Stripe is connected and the customer exists in both databases, you can start collecting payments.

Succeeded payments

Each time Lago generates a new invoice with an amount greater than zero, a payment intent is created automatically. Stripe records the invoice ID and processes the payment. If the payment succeeds, its status switches from pending to succeeded.

Failed payments

If the payment fails, its status switches from pending to failed and Lago sends an invoice.payment_failure webhook.

Payments requiring validation

When a payment requires multi-step authentication, such as 3D Secure (3DS), Lago triggers a payment.requires_action webhook. This webhook provides the details for completing the 3DS process. Depending on your integration, you’ll get a Stripe Checkout URL or details to use in your integration (like with Stripe Link). Lago marks the invoice pending and the payment processing until the 3DS process is completed. Payments in Europe can request 3DS because of SCA regulations, and most payments in India require 3DS authentication because of RBI regulations.

Minimum payment amount

If the new invoice amount falls below the minimum amount supported by Stripe, the payment status stays pending.
A valid payment method for the customer must be defined in Stripe for the payment intent to succeed (learn how to save payment details).

Metadata on Stripe objects

When Lago creates objects in Stripe, it attaches metadata that identifies the corresponding Lago records. You can rely on these keys to reconcile Stripe activity against Lago, for example to separate Lago-managed transactions from everything else in your Stripe account.

PaymentIntents

PaymentIntents created to collect overdue balances (dunning) settle several invoices at once, so they carry a lago_payable_type of PaymentRequest and do not include lago_invoice_id. Use lago_customer_id or lago_organization_id when you need a marker that is present on every Lago payment.

Refunds

Customers

These metadata keys are a supported part of the Stripe integration. Any change to them is treated as a breaking change and communicated in advance.

Payment disputes

When a payment dispute is lost in Stripe, Lago marks the relevant invoice as disputed lost. It fills the dispute_lost_at field with the timestamp of the lost dispute. After that update:
  • The invoice becomes non-voidable;
  • Generating a credit note is possible; however, refunding the payment back to the original payment method is not permitted; and
  • The invoice cannot be resent for collection.

Restricted Stripe API key

If you use Lago Cloud and want to limit the scope of the Stripe API key you share with Lago, you can create a restricted Stripe API key. Grant it at least the following resource permissions, otherwise the Stripe integration does not work properly:
  • Core
    • Charges - Write (to create refunds when creating credit notes)
    • Customers - Write
    • Events - Read (to receive webhooks with event details)
    • Funding Instructions - Write (to create and read bank details)
    • Payment Intents - Write (to create payments)
    • Payment Methods - Write (to update customer’s payment methods)
  • Checkout
    • Checkout Sessions - Write (to generate checkout URLs)
  • Webhook
    • Webhook Endpoints - Write (to create and update webhooks)