# Integrate with third-party payment processors

Learn how to use Stripe subscriptions and invoices with third party payment processors.

To process payments for your Billing *subscriptions* (A Subscription represents the product details associated with the plan that your customer subscribes to. Allows you to charge the customer on a recurring basis) and *invoices* (Invoices are statements of amounts owed by a customer. They track the status of payments from draft through paid or otherwise finalized. Subscriptions automatically generate invoices, or you can manually create a one-off invoice) with a third-party processor, you have the following options:

# Use out-of-band invoices


When you submit payments for Stripe invoices to a third-party processor, your system records the invoices as `paid_out_of_band`. The remaining subscription service period continues normally. To use out-of-band invoices, you need to customize two key Stripe Billing workflows:

- Collecting customers’ payment method details
- Paying invoices

## Request flow

The following diagrams illustrate the high-level request flows of a multiprocessor integration.

### Collecting and storing customers’ payment method details

(See full diagram at https://docs.stripe.com/billing/subscriptions/third-party-payment-processing)

```text
[Customer] -- Start signup --> [Server]
[Server] -- Create customer and subscription --> [Stripe]
[Stripe] -- Stripe creates invoice --> [Stripe]
[Stripe] -- Retrieve amount --> [Server]
[Server] -- Start checkout flow --> [Customer]
[Customer] -- Collect payment method details --> [Third party]
[Third party] -- Retrieve payment method token --> [Server]
[Server] -- Store metadata on customer --> [Stripe]
```

### Paying invoices

(See full diagram at https://docs.stripe.com/billing/subscriptions/third-party-payment-processing)

```text
[Stripe] -- Stripe creates invoice automatically --> [Stripe]
[Stripe] -- Retrieve invoice details --> [Server]
[Server] -- Process payment --> [Third party]
[Third party] -- Listen for successful payment --> [Server]
[Server] -- Mark invoice as paid --> [Stripe]
```

## Configure Stripe 

To set up a multiprocessor integration, you must make some configuration changes to Stripe.

### Disable invoice emails 

To prevent customers from paying directly on Stripe, disable automatic emails for any customer who processes payments on a third-party processor. To disable automatic emails:

- From the [automatic billing settings](https://dashboard.stripe.com/settings/billing/automatic) in the Dashboard, disable **Send finalized invoices to customers** and **Send credit notes to customers**. After you change these settings, Stripe doesn’t email customers when you create credit notes or change any subscription with [collection_method](https://docs.stripe.com/api/subscriptions/object.md#subscription_object-collection_method) set to `send_invoice`. Only disable these settings if all of your emailed subscription invoices are paid with a third-party processor.

### Configure the customer portal

If you use the [customer portal](https://docs.stripe.com/customer-management.md#customer-portal-features), disable **Allow customers to view and update payment methods** in the [customer portal settings](https://dashboard.stripe.com/settings/billing/portal). You must also disable the **Customers can switch plans** setting. You need to build custom flows to allow users to self-serve updates to their payment method on a third-party processor.

## Sign up new customers

### Create a Stripe customer 

#### Accounts v2

First, create a customer-configured [Account](https://docs.stripe.com/api/v2/core/accounts.md) object on Stripe.

```curl
curl -X POST https://api.stripe.com/v2/core/accounts \
  -H "Authorization: Bearer <<YOUR_SECRET_KEY>>" \
  -H "Stripe-Version: 2026-10-28.preview" \
  --json '{
    "configuration": {
        "customer": {}
    }
  }'
```

#### Customers v1

First, create a blank [Customer](https://docs.stripe.com/api/customers.md) object on Stripe.

```curl
curl -X POST https://api.stripe.com/v1/customers \
  -u "<<YOUR_SECRET_KEY>>:"
```

### Create a subscription

Next, create a [Subscription](https://docs.stripe.com/api/subscription.md) and set the `collection_method` to `send_invoice`. This setting doesn’t require a Stripe payment method and generates [Invoices](https://docs.stripe.com/api/invoice.md) that must be paid directly instead. Set the `days_until_due` parameter to the number of days an unpaid invoice remains open before your [failed payment logic](https://dashboard.stripe.com/settings/billing/automatic) activates. You’re responsible for retrying failed payments on the third-party processor, and you must set a long enough time for `days_until_due` so that any recovery workflows you implement have time to complete.

#### Accounts v2

```curl
curl https://api.stripe.com/v1/subscriptions \
  -u "<<YOUR_SECRET_KEY>>:" \
  -d "items[0][price]={{PRICE_ID}}" \
  -d "customer_account={{CUSTOMERACCOUNT_ID}}" \
  -d collection_method=send_invoice \
  -d days_until_due=30
```

#### Customers v1

```curl
curl https://api.stripe.com/v1/subscriptions \
  -u "<<YOUR_SECRET_KEY>>:" \
  -d "items[0][price]={{PRICE_ID}}" \
  -d "customer={{CUSTOMER_ID}}" \
  -d collection_method=send_invoice \
  -d days_until_due=30
```

### Present the amount to the user for payment

Third-party payments don’t work with *Stripe Checkout* (A low-code payment integration that creates a customizable form for collecting payments. You can embed Checkout directly in your website, redirect customers to a Stripe-hosted payment page, or create a customized checkout page with Stripe Elements) or *Elements* (A set of UI components for building a web checkout flow. They adapt to your customer's locale, validate input, and use tokenization, keeping sensitive customer data from touching your server). You must build a checkout flow that uses the third party to create a valid payment method, but uses Stripe to determine billable amounts. To determine the amount to charge in the checkout flow, [retrieve the initial invoice](https://docs.stripe.com/api/invoices/retrieve.md) generated by the subscription.

### Collect payment method details (Third party)

Follow the instructions from the third-party processor to collect payment method details from customers. Make sure to set up payment methods for use in future or off-session transactions.

The output of this step varies by processor. Some third-party processors provide a payment method token that you use to generate payments on that processor.

### Update the Customer or Account object 

#### Accounts v2

Update the `Account` object created in the [first step](https://docs.stripe.com/billing/subscriptions/third-party-payment-processing.md#create-customer) of the subscription creation flow. For convenience, store non-sensitive third-party tokens as [metadata](https://docs.stripe.com/api/v2/core/accounts/object.md#v2_account_object-metadata) on the `Account` object.

Remember to disable the **Send finalized invoices to customers** and **Send credit notes to customers** options before setting the `email` property on the `Account`.

```curl
curl -X POST https://api.stripe.com/v2/core/accounts/{{CUSTOMERACCOUNT_ID}} \
  -H "Authorization: Bearer <<YOUR_SECRET_KEY>>" \
  -H "Stripe-Version: 2026-10-28.preview" \
  --json '{
    "metadata": {
        "description": "Third-party payment customer",
        "third_party_customer_id": "{{THIRD_PARTY_CUSTOMER_ID}}",
        "third_party_payment_method_id": "{{THIRD_PARTY_PAYMENT_METHOD_ID}}"
    }
  }'
```

#### Customers v1

Update the `Customer` object created in the [first step](https://docs.stripe.com/billing/subscriptions/third-party-payment-processing.md#create-customer) of the subscription creation flow. For convenience, store non-sensitive third-party tokens as [metadata](https://docs.stripe.com/api/customers/object.md#customer_object-metadata) on the `Customer` object.

Remember to disable the **Send finalized invoices to customers** and **Send credit notes to customers** options before setting the `email` property on the `Customer`.

```curl
curl https://api.stripe.com/v1/customers/{{CUSTOMER_ID}} \
  -u "<<YOUR_SECRET_KEY>>:" \
  -d "description=Third-party payment customer" \
  -d "metadata[third_party_customer_id]={{THIRD_PARTY_CUSTOMER_ID}}" \
  -d "metadata[third_party_payment_method_id]={{THIRD_PARTY_PAYMENT_METHOD_ID}}"
```

## Collect payment

### Listen for invoice.created webhook events

All invoices (including the first invoice created from a subscription) start in a draft status and trigger [invoice.created](https://docs.stripe.com/api/events/types.md#event_types-invoice.created) webhooks. Invoices created by a subscription are automatically finalized after 1 hour to allow time for integrations to modify the draft invoice. You can [finalize the invoice manually](https://docs.stripe.com/api/invoices/finalize.md) if you want to skip this delay.

Invoice finalization triggers an [invoice.finalized](https://docs.stripe.com/api/events/types.md#event_types-invoice.finalized) event, which you should [listen for](https://docs.stripe.com/billing/subscriptions/webhooks.md) to trigger payments on the third-party processor.

### Process payments (Third party)

Follow the instructions from the third-party processor to collect payments for the amounts represented on each invoice using the tokens stored on the associated Customer object. This might include listening to webhooks from the third party for notifications of successful payments.

### Mark the Stripe invoice as paid out-of-band

When payment on the third party processor is successful, mark the corresponding invoice as `paid_out_of_band`.

```curl
curl https://api.stripe.com/v1/invoices/{{INVOICE_ID}}/pay \
  -u "<<YOUR_SECRET_KEY>>:" \
  -d paid_out_of_band=true
```

Mark the invoice as `paid` before the subscription’s payment due date to keep the subscription operating normally. The Subscription object’s [days_until_due](https://docs.stripe.com/api/subscriptions/object.md#subscription_object-days_until_due) attribute defines the payment due date.

## Handle status changes

### Cancel subscriptions

#### Accounts v2

To cancel a subscription, remove the third-party payment method details from the Stripe `Account` object and your database. Listen for the [customer.subscription.deleted](https://docs.stripe.com/api/events/types.md#event_types-customer.subscription.deleted) event and delete any tokens related to the canceled subscription.

#### Customers v1

To cancel a subscription, remove the third-party payment method details from the Stripe `Customer` object and your database. Listen for the [customer.subscription.deleted](https://docs.stripe.com/api/events/types.md#event_types-customer.subscription.deleted) event and delete any tokens related to the canceled subscription.

### Third-party payment cancellation (Third party)

Some third-party processors allow end customers to cancel billing agreements directly. If the processor allows this, listen for any associated events and then [cancel the subscription](https://docs.stripe.com/api/subscriptions/cancel.md) on Stripe.

### Refunds and disputes (Third party)

You’re responsible for processing refunds and disputes originating from the third-party processor. To maintain accurate accounting data, log refunds on issued invoices by using [Credit Notes](https://docs.stripe.com/api/credit_notes/object.md) to adjust the invoice amounts. Create a Credit Note, and set the [out_of_band_amount](https://docs.stripe.com/api/credit_notes/create.md#create_credit_note-out_of_band_amount) to the refunded amount.

## Other considerations

### Switch between third-party payments and Stripe

To switch a customer from a third-party processor to Stripe:

1. Collect a new payment method for the customer by [setting up future payments](https://docs.stripe.com/payments/save-and-reuse.md?platform=checkout) or using the [customer portal](https://docs.stripe.com/no-code/customer-portal.md).
2. Update the subscription [collection_method](https://docs.stripe.com/api/subscriptions/update.md#update_subscription-collection_method) from `send_invoice` to `charge_automatically` and set the new payment method as the `default_payment_method`.
3. Delete any existing third-party payment method tokens.

### Retries

You must handle any recovery of failed third-party payments yourself. Stripe doesn’t have any visibility into the status of third-party payments until you mark an invoice as `paid`.

### Taxes

#### Accounts v2

Stripe Tax automatically adds the correct tax amounts to invoices as long as you set a billing postal code or IP address when updating the [Account](https://docs.stripe.com/billing/subscriptions/third-party-payment-processing.md#update-customer) object after checkout.

#### Customers v1

Stripe Tax automatically adds the correct tax amounts to invoices as long as you set a billing postal code or IP address when updating the [Customer](https://docs.stripe.com/billing/subscriptions/third-party-payment-processing.md#update-customer) object after checkout.

### Partial payments

We don’t support partial payments on `out_of_band` invoices. In the event of a partial payment, use a Credit Note to adjust the original invoice, and then manually generate a new invoice for any remaining balance.

