diff --git a/packages/twenty-server/src/engine/core-modules/billing/stripe/services/stripe-invoice.service.ts b/packages/twenty-server/src/engine/core-modules/billing/stripe/services/stripe-invoice.service.ts index f91b4807ac..76c29d4308 100644 --- a/packages/twenty-server/src/engine/core-modules/billing/stripe/services/stripe-invoice.service.ts +++ b/packages/twenty-server/src/engine/core-modules/billing/stripe/services/stripe-invoice.service.ts @@ -68,9 +68,22 @@ export class StripeInvoiceService { }); await this.stripe.invoices.finalizeInvoice(invoice.id, { - auto_advance: false, + auto_advance: true, }); - await this.stripe.invoices.pay(invoice.id); + try { + await this.stripe.invoices.pay(invoice.id); + } catch (error) { + // With auto_advance Stripe may already have collected payment by the time + // we explicitly request it. Only swallow that case, rethrow real failures. + if ( + !( + error instanceof this.stripe.errors.StripeInvalidRequestError && + error.code === 'invoice_already_paid' + ) + ) { + throw error; + } + } } }