# Create destination charges

Create charges on your platform account, collect fees, and immediately transfer the remaining funds to your connected accounts.

Create *destination charges* when customers transact with your platform for products or services provided by your connected accounts and you immediately transfer funds to your connected accounts. With this charge type:

- You create a charge on your platform’s account.
- You determine whether some or all of those funds are transferred to the connected account.
- Your account balance is debited for the cost of the Stripe fees, refunds, and chargebacks.

This charge type works best for marketplaces such as Airbnb, a home rental marketplace or Lyft, a ridesharing app.

With [certain exceptions](https://docs.stripe.com/connect/account-capabilities.md#transfers-cross-border), if your platform and a connected account aren’t in the same region, you must specify the connected account as the [settlement merchant](https://docs.stripe.com/connect/destination-charges.md#settlement-merchant) using the `on_behalf_of` parameter on the [Payment Intent](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-on_behalf_of)&nbsp; or `payment_intent_data.on_behalf_of` on the [Checkout Session](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-payment_intent_data-on_behalf_of).

We recommend using destination charges for connected accounts that don’t have access to the full Stripe Dashboard.

Redirect to a Stripe-hosted payment page using [Stripe Checkout](https://docs.stripe.com/payments/checkout.md). See how this integration [compares to Stripe’s other integration types](https://docs.stripe.com/payments/online-payments.md#compare-features-and-availability).

#### Integration effort
Complexity: 2/5
#### Integration type

Redirect to Stripe-hosted payment page

#### UI customization
Limited customization
- 20 preset fonts
- 3 preset border radius
- Custom background and border color
- Custom logo

[Try it out](https://checkout.stripe.dev/)

First, [register](https://dashboard.stripe.com/register) for a Stripe account.

Use our official libraries to access the Stripe API from your application:

#### Ruby

```bash
# Available as a gem
sudo gem install stripe
```

```ruby
# If you use bundler, you can add this line to your Gemfile
gem 'stripe'
```

## Create a Checkout Session [Client-side] [Server-side]

A [Checkout Session](https://docs.stripe.com/api/checkout/sessions.md) controls what your customer sees in the payment form such as line items, the order amount and currency, and acceptable payment methods. Add a checkout button to your website that calls a server-side endpoint to create a Checkout Session.

```html
<html>
  <head>
    <title>Checkout</title>
  </head>
  <body>
    <form action="/create-checkout-session" method="POST">
      <button type="submit">Checkout</button>
    </form>
  </body>
</html>
```

#### Destination

On your server, create a Checkout Session and redirect your customer to the [URL](https://docs.stripe.com/api/checkout/sessions/object.md#checkout_session_object-url) returned in the response.

```curl
curl https://api.stripe.com/v1/checkout/sessions \
  -u "<<YOUR_SECRET_KEY>>:" \
  -d "line_items[0][price_data][currency]=usd" \
  -d "line_items[0][price_data][product_data][name]=T-shirt" \
  -d "line_items[0][price_data][unit_amount]=1000" \
  -d "line_items[0][quantity]=1" \
  -d "payment_intent_data[application_fee_amount]=123" \
  -d "payment_intent_data[transfer_data][destination]={{CONNECTEDACCOUNT_ID}}" \
  -d mode=payment \
  --data-urlencode "success_url=https://example.com/success?session_id={CHECKOUT_SESSION_ID}"
```

| Parameter | Description |
| --- | --- |
| [payment_intent_data[transfer_data][destination]](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-payment_intent_data-transfer_data-destination) | Indicates that this is a destination charge. A destination charge means the charge is processed on the platform and then the funds are immediately and automatically transferred to the connected account’s pending balance. |
| [line_items](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-line_items) | The items the customer is purchasing. The items are displayed in the embedded payment form. |
| [success_url](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-success_url) | The URL where the customer is redirected after they complete a payment. Use the value of `{CHECKOUT_SESSION_ID}` to retrieve the Checkout Session and inspect its status to decide what to show your customer. You can also append [custom query parameters](https://docs.stripe.com/payments/checkout/custom-success-page.md), which persist through the redirect process. |
| [payment_intent_data[application_fee_amount]](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-payment_intent_data-application_fee_amount) | The amount your platform plans to take from the transaction. The full charge amount is immediately transferred from the platform to the connected account that’s specified by `transfer_data[destination]` after the charge is captured. The `application_fee_amount` is then transferred back to the platform, and the Stripe fee is deducted from the platform’s amount. |

(See full diagram at https://docs.stripe.com/connect/destination-charges)

```text
[customer] --> [10 USD Charge]
[10 USD Charge] --> [10 USD Transfer]
[10 USD Transfer] --> [10 USD Payment]
[10 USD Payment] --> [(1.23 USD) Application fee]
[(1.23 USD) Application fee] --> [8.77 USD net]
[(1.23 USD) Application fee] --> [1.23 USD Application fee]
[1.23 USD Application fee] --> [(0.59 USD) Stripe fees]
[(0.59 USD) Stripe fees] --> [stripe]
[(0.59 USD) Stripe fees] --> [0.64 USD net]
[platform]
[account]
```

When processing destination charges, Checkout uses the brand settings of your platform account. See [customize branding](https://docs.stripe.com/connect/destination-charges.md#branding) for more information.

#### On behalf of

Create a destination charge with the `on_behalf_of` parameter set to the connected account ID. The `on_behalf_of` parameter determines the [settlement merchant](https://docs.stripe.com/connect/destination-charges.md#settlement-merchant), which defaults to your platform account. This affects:

- Whose statement descriptor the customer sees
- Whose address and phone number the customer sees
- The settlement currency of the charge
- The [Checkout page branding](https://docs.stripe.com/connect/destination-charges.md#branding) the customer sees

On your server, create a Checkout Session and redirect your customer to the [URL](https://docs.stripe.com/api/checkout/sessions/object.md#checkout_session_object-url) returned in the response.

```curl
curl https://api.stripe.com/v1/checkout/sessions \
  -u "<<YOUR_SECRET_KEY>>:" \
  -d "line_items[0][price_data][currency]=usd" \
  -d "line_items[0][price_data][product_data][name]=T-shirt" \
  -d "line_items[0][price_data][unit_amount]=1000" \
  -d "line_items[0][quantity]=1" \
  -d "payment_intent_data[application_fee_amount]=123" \
  -d "payment_intent_data[on_behalf_of]={{CONNECTEDACCOUNT_ID}}" \
  -d "payment_intent_data[transfer_data][destination]={{CONNECTEDACCOUNT_ID}}" \
  -d mode=payment \
  --data-urlencode "success_url=https://example.com/success?session_id={CHECKOUT_SESSION_ID}"
```

| Parameter | Description |
| --- | --- |
| [payment_intent_data[on_behalf_of]](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-payment_intent_data-on_behalf_of) | The settlement merchant. Defaults to the platform if the parameter isn’t present. |
| [payment_intent_data[transfer_data][destination]](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-payment_intent_data-transfer_data-destination) | Indicates that this is a destination charge. A destination charge means the charge is processed on the platform and then the funds are immediately and automatically transferred to the connected account’s pending balance. |
| [line_items](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-line_items) | The items the customer is purchasing. The items are displayed in the Stripe-hosted checkout page. |
| [success_url](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-success_url) | The URL where the customer is redirected after they complete a payment. Use the value of `{CHECKOUT_SESSION_ID}` to retrieve the Checkout Session and inspect its status to decide what to show your customer. You can also append [custom query parameters](https://docs.stripe.com/payments/checkout/custom-success-page.md), which persist through the redirect process. |
| [payment_intent_data[application_fee_amount]](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-payment_intent_data-application_fee_amount) | The amount your platform plans to take from the transaction. The full charge amount is immediately transferred from the platform to the connected account that’s specified by `transfer_data[destination]` after the charge is captured. The `application_fee_amount` is then transferred back to the platform, and the Stripe fee is deducted from the platform’s amount. |

(See full diagram at https://docs.stripe.com/connect/destination-charges)

```text
[customer] --> [10 USD Charge]
[10 USD Charge] --> [10 USD Transfer]
[10 USD Transfer] --> [10 USD Payment]
[10 USD Payment] --> [(1.23 USD) Application fee]
[(1.23 USD) Application fee] --> [8.77 USD net]
[(1.23 USD) Application fee] --> [1.23 USD Application fee]
[1.23 USD Application fee] --> [(0.59 USD) Stripe fees]
[(0.59 USD) Stripe fees] --> [stripe]
[(0.59 USD) Stripe fees] --> [0.64 USD net]
[platform]
[account]
```

## Handle post-payment events [Server-side]

Stripe sends a [checkout.session.completed](https://docs.stripe.com/api/events/types.md#event_types-checkout.session.completed) event when the payment completes. [Use a webhook to receive these events](https://docs.stripe.com/webhooks/quickstart.md) and run actions, like sending an order confirmation email to your customer, logging the sale in a database, or starting a shipping workflow.

Listen for these events rather than waiting on a callback from the client. On the client, the customer could close the browser window or quit the app before the callback executes. Some payment methods also take 2-14 days for payment confirmation. Setting up your integration to listen for asynchronous events enables you to accept multiple [payment methods](https://stripe.com/payments/payment-methods-guide) with a single integration.

Stripe recommends handling all of the following events when collecting payments with Checkout:

| Event | Description | Next steps |
| --- | --- | --- |
| [checkout.session.completed](https://docs.stripe.com/api/events/types.md#event_types-checkout.session.completed) | The customer has successfully authorized the payment by submitting the Checkout form. | Wait for the payment to succeed or fail. |
| [checkout.session.async_payment_succeeded](https://docs.stripe.com/api/events/types.md#event_types-checkout.session.async_payment_succeeded) | The customer’s payment succeeded. | Fulfill the purchased goods or services. |
| [checkout.session.async_payment_failed](https://docs.stripe.com/api/events/types.md#event_types-checkout.session.async_payment_failed) | The payment was declined, or failed for some other reason. | Contact the customer through email and request that they place a new order. |

These events all include the [Checkout Session](https://docs.stripe.com/api/checkout/sessions.md) object. After the payment succeeds, the underlying *PaymentIntent* (The Payment Intents API tracks the lifecycle of a customer checkout flow and triggers additional authentication steps when required by regulatory mandates, custom Radar fraud rules, or redirect-based payment methods) [status](https://docs.stripe.com/payments/paymentintents/lifecycle.md) changes from `processing` to `succeeded` or a failure status.

## Test the integration

#### Cards

| Card number | Scenario | How to test |
| --- | --- | --- |
| 4242424242424242 | The card payment succeeds and doesn’t require authentication. | Fill out the credit card form using the credit card number with any expiration, CVC, and postal code. |
| 4000002500003155 | The card payment requires *authentication* (Strong Customer Authentication (SCA) is a regulatory requirement in effect as of September 14, 2019, that impacts many European online payments. It requires customers to use two-factor authentication like 3D Secure to verify their purchase). | Fill out the credit card form using the credit card number with any expiration, CVC, and postal code. |
| 4000000000009995 | The card is declined with a decline code like `insufficient_funds`. | Fill out the credit card form using the credit card number with any expiration, CVC, and postal code. |
| 6205500000000000004 | The UnionPay card has a variable length of 13-19 digits. | Fill out the credit card form using the credit card number with any expiration, CVC, and postal code. |

#### Wallets

| Payment method | Scenario | How to test |
| --- | --- | --- |
| Alipay | Your customer successfully pays with a redirect-based and [immediate notification](https://docs.stripe.com/payments/payment-methods.md#payment-notification) payment method. | Choose any redirect-based payment method, fill out the required details, and confirm the payment. Then click **Complete test payment** on the redirect page. |

#### Bank redirects

| Payment method | Scenario | How to test |
| --- | --- | --- |
| Bancontact, EPS, iDEAL, and Przelewy24 | Your customer fails to authenticate on the redirect page for a redirect-based and immediate notification payment method. | Choose any redirect-based payment method, fill out the required details, and confirm the payment. Then click **Fail test payment** on the redirect page. |
| Pay by Bank | Your customer successfully pays with a redirect-based and [delayed notification](https://docs.stripe.com/payments/payment-methods.md#payment-notification) payment method. | Choose the payment method, fill out the required details, and confirm the payment. Then click **Complete test payment** on the redirect page. |
| Pay by Bank | Your customer fails to authenticate on the redirect page for a redirect-based and delayed notification payment method. | Choose the payment method, fill out the required details, and confirm the payment. Then click **Fail test payment** on the redirect page. |
| BLIK | BLIK payments fail in a variety of ways—immediate failures (for example, the code is expired or invalid), delayed errors (the bank declines) or timeouts (the customer didn’t respond in time). | Use email patterns to [simulate the different failures.](https://docs.stripe.com/payments/blik/accept-a-payment.md#simulate-failures) |

#### Bank debits

| Payment method | Scenario | How to test |
| --- | --- | --- |
| BECS Direct Debit | Your customer successfully pays with BECS Direct Debit. | Fill out the form using the account number `900123456` and BSB `000000`. The confirmed PaymentIntent initially transitions to `processing`, then transitions to the `succeeded` status 3 minutes later. |
| BECS Direct Debit | Your customer’s payment fails with an `account_closed` error code. | Fill out the form using the account number `111111113` and BSB `000000`. |
| SEPA Direct Debit | Your customer successfully pays with SEPA Direct Debit. | Fill out the form using the account number `AT321904300235473204`. The confirmed PaymentIntent initially transitions to processing, then transitions to the succeeded status three minutes later. |
| SEPA Direct Debit | Your customer’s payment intent status transitions from `processing` to `requires_payment_method`. | Fill out the form using the account number `AT861904300235473202`. |

#### Vouchers

| Payment method | Scenario | How to test |
| --- | --- | --- |
| Boleto, OXXO | Your customer pays with a Boleto or OXXO voucher. | Select Boleto or OXXO as the payment method and submit the payment. Close the dialog after it appears. |

See [Testing](https://docs.stripe.com/testing.md) for additional information to test your integration.

## Collect fees

When a payment is processed, rather than transfer the full amount of the transaction to a connected account, your platform can decide to take a portion of the transaction amount in the form of fees. You can set fee pricing in two different ways:

- Use the [Platform Pricing Tool](https://docs.stripe.com/connect/platform-pricing-tools.md) to set and test application fee pricing rules. This no-code feature in the Stripe Dashboard is currently only available for platforms responsible for paying Stripe fees.

- Set your pricing rules in-house, specifying fees directly in a [PaymentIntent](https://docs.stripe.com/api/payment_intents/object.md) using either the [application_fee_amount](https://docs.stripe.com/api/payment_intents/object.md#payment_intent_object-application_fee_amount) or [transfer_data[amount]](https://docs.stripe.com/api/payment_intents/object.md#payment_intent_object-transfer_data-amount) parameter. Fees set with this method override the pricing logic specified in the Platform Pricing Tool.

#### application_fee_amount

When creating charges with an `application_fee_amount`, the full charge amount is immediately transferred from the platform to the `transfer_data[destination]` account after the charge is captured. The `application_fee_amount` (capped at the full amount of the charge) is then transferred back to the platform.

```curl
curl https://api.stripe.com/v1/checkout/sessions \
  -u "<<YOUR_SECRET_KEY>>:" \
  -d "line_items[0][price_data][currency]=usd" \
  -d "line_items[0][price_data][product_data][name]=T-shirt" \
  -d "line_items[0][price_data][unit_amount]=1000" \
  -d "line_items[0][quantity]=1" \
  -d "payment_intent_data[application_fee_amount]=123" \
  -d "payment_intent_data[transfer_data][destination]={{CONNECTEDACCOUNT_ID}}" \
  -d mode=payment \
  --data-urlencode "success_url=https://example.com/success"
```

After the application fee is collected, an [Application Fee](https://docs.stripe.com/api/application_fees/object.md) object is created. You can view a list of application fees in the [Dashboard](https://dashboard.stripe.com/connect/application_fees), with the [application fees](https://docs.stripe.com/api/application_fees/list.md), or in [Sigma](https://docs.stripe.com/data/how-sigma-works.md). You can also use the `amount` property on the application fee object for itemized fee reporting.

When using an `application_fee_amount`, know that:

- The `application_fee_amount` is capped at the total transaction amount.
- The `application_fee_amount` is always computed in the same currency as the transaction.
- The application fee *settles* (When funds are available in your Stripe balance) in the same currency as the connected account’s settlement currency. For cross-border destination charges, this might [differ from your platform’s settlement currency](https://docs.stripe.com/connect/currencies/fx-quotes-api.md#destination-charges-without-on-behalf-of).
- Your platform pays the Stripe fee after the `application_fee_amount` is transferred to your account.
- No additional Stripe fees are applied to the amount.
- Your platform can use built-in application fee reporting to reconcile [fees collected](https://dashboard.stripe.com/connect/application_fees).
- In Stripe-hosted dashboards or components such as the [Payment details component](https://docs.stripe.com/connect/supported-embedded-components/payment-details.md), your connected account can view both the total amount and the application fee amount.

### Flow of funds with destination charges 

With the above code, the full charge amount (10.00 USD) is added to the connected account’s pending balance. The `application_fee_amount` (1.23 USD) is subtracted from the charge amount and is transferred to your platform. Stripe fees (0.59 USD) are subtracted from your platform account’s balance. The application fee amount minus the Stripe fees (1.23 USD - 0.59 USD = 0.64 USD) remains in your platform account’s balance.
![Flow of funds for destination charges](https://b.stripecdn.com/docs-statics-srv/assets/destination_charge_app_fee.c9ef81298155b38f986df02d0efa9167.png)

The `application_fee_amount` becomes available on the platform account’s normal transfer schedule, just like funds from regular Stripe charges.

#### transfer_data[amount]

The `transfer_data[amount]` is a positive integer reflecting the amount of the charge to be transferred to the `transfer_data[destination]`. You subtract your platform’s fees from the charge amount, then pass the result of this calculation as the `transfer_data[amount]`.

```curl
curl https://api.stripe.com/v1/checkout/sessions \
  -u "<<YOUR_SECRET_KEY>>:" \
  -d "line_items[0][price_data][currency]=usd" \
  -d "line_items[0][price_data][product_data][name]=T-shirt" \
  -d "line_items[0][price_data][unit_amount]=1000" \
  -d "line_items[0][quantity]=1" \
  -d "payment_intent_data[transfer_data][amount]=877" \
  -d "payment_intent_data[transfer_data][destination]={{CONNECTEDACCOUNT_ID}}" \
  -d mode=payment \
  --data-urlencode "success_url=https://example.com/success"
```

When using `transfer_data[amount]`, the following applies:

- The amount is capped at the total transaction amount.
- The amount is always computed in the same currency as the transaction.
- The amount *settles* (When funds are available in your Stripe balance) in [the same currency as your platform’s settlement currency](https://docs.stripe.com/connect/currencies/fx-quotes-api.md#destination-charges-without-on-behalf-of).
- In Stripe-hosted dashboards or components such as the Stripe Dashboard or Express Dashboard, your connected account can’t view the total amount of the charge. They only see the amount transferred.
- Your platform separately pays the Stripe fees on the charge.
- No additional Stripe fees are applied to the amount.
- To [calculate fees](https://docs.stripe.com/data/query-all-fees-data.md#fees-paid-by-connected-accounts) after a payment is created, such as for reporting purposes, [retrieve the PaymentIntent](https://docs.stripe.com/api/payment_intents/retrieve.md) and subtract the `transfer_data[amount]` from the `amount` on the PaymentIntent.

Consider using the [application fee amount](https://docs.stripe.com/connect/destination-charges.md#application-fee) to simplify reporting by creating explicit application fees which are linked to the charge.

### Flow of funds 

With the above code, charge `amount` (10.00 USD) is added to the platform account’s balance. The `transfer_data[amount]` (8.77 USD) is subtracted from the platform account’s balance and added to the connected account’s pending balance. The charge `amount` (10.00 USD) less the `transfer_data[amount]` (8.77 USD) less the Stripe fees (on charge `amount`), for a net amount of 0.64 USD, remains in the platform account’s pending balance.
![](https://b.stripecdn.com/docs-statics-srv/assets/destination_charge_amount.46cd59f6496607d68020b546aa1af85f.png)

The `transfer_data[amount]` becomes available on the connected account’s normal transfer schedule, just like funds from regular Stripe charges.

Platforms can track how much they retain from `transfer_data[amount]` charges by looking at the Destination Platform Fee column in the Balance history export.

## Customize branding 

Your platform and connected accounts can use the [Branding settings](https://dashboard.stripe.com/account/branding) in the Dashboard to customize branding on the payments page. For direct charges, Checkout uses the brand settings of the connected account.

You can also use the API to [update branding settings](https://docs.stripe.com/api/accounts/update.md#update_account-settings-branding):

- `icon` - Displayed next to the business name in the header of the Checkout page.
- `logo` - Used in place of the icon and business name in the header of the Checkout page.
- `primary_color` - Used as the background color on the Checkout page.
- `secondary_color` - Used as the button color on the Checkout page.

```curl
curl https://api.stripe.com/v1/accounts/{{CONNECTEDACCOUNT_ID}} \
  -u "<<YOUR_SECRET_KEY>>:" \
  -d "settings[branding][icon]={{FILE_ID}}" \
  -d "settings[branding][logo]={{FILE_ID}}" \
  --data-urlencode "settings[branding][primary_color]=#663399" \
  --data-urlencode "settings[branding][secondary_color]=#4BB543"
```

## Specify the settlement merchant 

The settlement merchant is dependent on the [capabilities](https://docs.stripe.com/connect/account-capabilities.md) set on an account and how a charge is created. The settlement merchant determines whose information is used to make the charge. This includes the statement descriptor (either the platform’s or the connected account’s) that’s displayed on the customer’s credit card or bank statement for that charge.

Specifying the settlement merchant allows you to be more explicit about who to create charges for. For example, some platforms prefer to be the settlement merchant because the end customer interacts directly with their platform (such as on-demand platforms). However, some platforms have connected accounts that interact directly with end customers instead (such as a storefront on an e-commerce platform). In these scenarios, it might make more sense for the connected account to be the settlement merchant.

You can set the `on_behalf_of` parameter to the ID of a connected account to make that account the settlement merchant for the payment. When using `on_behalf_of`:

- Charges *settle* (When funds are available in your Stripe balance) in the connected account’s country and *settlement currency* (The settlement currency is the currency your bank account uses).
- The fee structure for the connected account’s country is used.
- The connected account’s statement descriptor is displayed on the customer’s credit card statement.
- If the connected account is in a different country than the platform, the connected account’s address and phone number are displayed on the customer’s credit card statement.
- The number of days that a [pending balance](https://docs.stripe.com/connect/account-balances.md) is held before being paid out depends on the [delay_days](https://docs.stripe.com/api/accounts/create.md#create_account-settings-payouts-schedule-delay_days) setting on the connected account.

> #### Accounts v2 API
> 
> You can’t use the Accounts v2 API to manage payout settings. Use the Accounts v1 API.

If `on_behalf_of` is omitted, the platform is the business of record for the payment.

> The `on_behalf_of` parameter is supported only for connected accounts with a payments capability such as [card_payments](https://docs.stripe.com/connect/account-capabilities.md#card-payments). Accounts under the [recipient service agreement](https://docs.stripe.com/connect/service-agreement-types.md#recipient) can’t request `card_payments` or other payments capabilities.

## Issue refunds 

If you’re using the Payment Intents API, refunds should be issued against [the most recent charge that is created](https://docs.stripe.com/payments/payment-intents/verifying-status.md#identifying-charges).

Charges created on the platform account can be refunded using the platform account’s secret key. When refunding a charge that has a `transfer_data[destination]`, by default the destination account keeps the funds that were transferred to it, leaving the platform account to cover the negative balance from the refund. To pull back the funds from the connected account to cover the refund, set the `reverse_transfer` parameter to `true` when creating the refund:

```curl
curl https://api.stripe.com/v1/refunds \
  -u "<<YOUR_SECRET_KEY>>:" \
  -d "charge={{CHARGE_ID}}" \
  -d reverse_transfer=true
```

By default, the entire charge is refunded, but you can create a partial refund by setting an `amount` value as a positive integer.

If the refund results in the entire charge being refunded, the entire transfer is reversed. Otherwise, a proportional amount of the transfer is reversed.

### Refund application fees 

When refunding a charge with an application fee, by default the platform account keeps the funds from the application fee. To push the application fee funds back to the connected account, set the [refund_application_fee](https://docs.stripe.com/api/refunds/create.md#create_refund-refund_application_fee) parameter to `true` when creating the refund:

```curl
curl https://api.stripe.com/v1/refunds \
  -u "<<YOUR_SECRET_KEY>>:" \
  -d "charge={{CHARGE_ID}}" \
  -d reverse_transfer=true \
  -d refund_application_fee=true
```

If you refund the application fee for a destination charge, you must also reverse the transfer. If the refund results in the entire charge being refunded, the refund also includes the entire application fee. Otherwise, you refund a proportional amount of the application fee.

Alternatively, you can provide a `refund_application_fee` value of **false** and refund the application fee separately [through the API](https://docs.stripe.com/api.md#create_fee_refund).

### Failed refunds

If a refund fails, or you [cancel it](https://docs.stripe.com/refunds.md#cancel-refund), the amount of the failed refund returns to your platform account’s Stripe balance. Create a [Transfer](https://docs.stripe.com/connect/separate-charges-and-transfers.md#create-transfer) to move the funds to the connected account, as needed.

## Handle disputes 

For destination charges, with or without `on_behalf_of`, Stripe debits dispute amounts and fees from your platform account.

We recommend setting up [a webhook](https://docs.stripe.com/webhooks.md) to listen to [dispute created events](https://docs.stripe.com/api/events/types.md#event_types-charge.dispute.created). When that happens, you can attempt to recover funds from the connected account by reversing the transfer through the [Dashboard](https://dashboard.stripe.com/test/transfers) or by [creating a transfer reversal](https://docs.stripe.com/api/transfer_reversals/create.md).

If the connected account has a negative balance, Stripe attempts to [debit its external account](https://docs.stripe.com/connect/account-balances.md#automatically-debit-connected-accounts) if `debit_negative_balances` is set to `true`.

If you challenge the dispute and win, you can transfer the funds that you previously reversed back to the connected account. If your platform has an insufficient balance, the transfer fails. Prevent insufficient balance errors by [adding funds to your Stripe balance](https://docs.stripe.com/get-started/account/add-funds.md).

> Retransferring a previous reversal is subject to [cross-border transfer restrictions](https://docs.stripe.com/connect/account-capabilities.md#transfers-cross-border), meaning you might have no means to repay your connected account. Instead, wait to recover disputed cross-border payment transfers for destination charges with `on_behalf_of` until after a dispute is lost.

## Asynchronous payment failures 

For destination charges using asynchronous payment methods (such as ACH Debit or SEPA Debit), there’s a delay between when the payment is initiated and when the funds are confirmed. During this time, both the charge and the transfer to the connected account’s pending balance are in a pending state.

If the async payment fails, Stripe automatically reverses the transfer. No funds are permanently moved to the connected account.

## Skipped transfers due to account status 

For payments using asynchronous payment methods (such as ACH or SEPA Debit), there is a delay between when the payment is authorized and when the funds become available. During this time, if the destination account loses the required [transfer capability](https://docs.stripe.com/connect/account-capabilities.md#supported-capabilities) or is closed, Stripe can’t complete the transfer as originally requested.

When Stripe attempts to create a transfer but can’t do so because of capability loss or account deletion, we skip the transfer and the funds remain in your platform’s balance.

To detect skipped transfers, listen for the `charge.updated` webhook event. If the value of [transfer_data](https://docs.stripe.com/api/charges/object.md#charge_object-transfer_data) on the Charge object is `null`, this indicates a skipped transfer.

When you detect a skipped transfer, you can create a transfer after resolving the problem.

## Connect embedded components

Destination charges are supported by [Connect embedded components](https://docs.stripe.com/connect/get-started-connect-embedded-components.md). By using the [payments embedded component](https://docs.stripe.com/connect/supported-embedded-components/payments.md), you can enable your connected accounts to view payment information from within your site. For destination charges with `on_behalf_of`, you can use the [destination_on_behalf_of_charge_management](https://docs.stripe.com/api/account_sessions/create.md#create_account_session-components-payments-features-destination_on_behalf_of_charge_management) feature to allow your connected accounts to view additional details, manage refunds, disputes, and allow capturing payments.

Note: The following is a preview/demo component that behaves differently than live mode usage with real connected accounts. The actual component has more functionality than what might appear in this demo component. For example, for connected accounts without Stripe dashboard access (custom accounts), no user authentication is required in production.

The following components display information for destination charges:

- [Payments component](https://docs.stripe.com/connect/supported-embedded-components/payments.md): Displays all of an account’s payments and disputes.

- [Payments details](https://docs.stripe.com/connect/supported-embedded-components/payment-details.md): Displays all of an account’s payments and disputes.

- [Disputes list component](https://docs.stripe.com/connect/supported-embedded-components/disputes-list.md): Displays all of an account’s disputes.

- [Disputes for a payment component](https://docs.stripe.com/connect/supported-embedded-components/disputes-for-a-payment.md): Displays the disputes for a single specified payment. You can use it to include dispute management functionality on a page with your payments UI.

## See also

- [Working with multiple currencies](https://docs.stripe.com/connect/currencies.md)
- [Statement descriptors with Connect](https://docs.stripe.com/connect/statement-descriptors.md)
