Weiter zum Inhalt
Konto erstellen
oder
anmelden
Das Logo der Stripe-Dokumentation
/
KI fragen
Konto erstellen
Anmelden
Jetzt starten
Zahlungen
Finanzautomatisierung
Plattformen und Marktplätze
Geldmanagement
Entwickler-Tools
Jetzt starten
Zahlungen
Finanzautomatisierung
Jetzt starten
Zahlungen
Finanzautomatisierung
Plattformen und Marktplätze
Geldmanagement
Übersicht
Mit Connect loslegen
Integrationsgrundlagen
Musterintegrationen
Onboarding von Konten
Konto-Dashboards konfigurieren
Zahlungen weltweit akzeptieren
    Zahlung erstellen
      Direct Charges
        Gebührenkonfiguration für Ihre verbundenen Konten
        Berichte für Direct-Charge-Zahlungsgebühren
        Gemeinsame Nutzung von Zahlungsmethoden für mehrere Konten
      Destination Charges
      Separate Gebühren und Überweisungen
    Zahlungsbeschreibungen in der Abrechnung festlegen
    MCCs einrichten
    Umgang mit mehreren Währungen
    Mit Connect Zahlungslinks erstellen
    Radar mit Connect verwenden
    Angefochtene Zahlungen bei Connect
    Abos erstellen
    Rechnungen erstellen
    Mehrere Konfigurationen der Zahlungsmethoden
    Komponente für die Zahlungsmethodeneinstellungen einbetten
    Kontostand
Verbundene Konten auszahlen
Ihre Connect-Plattform verwalten
Steuerformulare für Ihre Connect-Plattform
Mit verbundenen Kontotypen zusammenarbeiten
StartseitePlattformen und MarktplätzeAccept paymentsCreate a charge

Notiz

Bis jetzt ist diese Seite noch nicht in dieser Sprache verfügbar. Wir arbeiten aber verstärkt daran, unsere Dokumentation in weiteren Sprachen bereitzustellen, und werden die Übersetzung sofort anzeigen, sobald diese verfügbar ist.

Create direct charges

Create charges directly on the connected account and collect fees.

Seite kopieren

Create direct charges when customers transact directly with a connected account, often unaware of your platform’s existence. With direct charges:

  • The payment appears as a charge on the connected account, not your platform’s account.
  • The connected account’s balance increases with every charge.
  • Your account balance increases with application fees from every charge.

This charge type is best suited for platforms providing software as a service. For example, Shopify provides tools for building online storefronts, and Thinkific enables educators to sell online courses.

Notiz

We recommend using direct charges for connected accounts that have access to the full Stripe Dashboard.

Redirect to a Stripe-hosted payment page using Stripe Checkout. See how this integration compares to Stripe’s other integration types.

Bezahlvorgang – Vorschau

Integration effort

Kaum Code

Integration type

Redirect to Stripe-hosted payment page

UI customization

Limited customization

Try it out

First, register for a Stripe account.

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

Command Line
Ruby
# Available as a gem sudo gem install stripe
Gemfile
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 controls what your customer sees in the payment form such as line items, the order amount, and currency. Add a checkout button to your website that calls a server-side endpoint to create a Checkout Session.

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

On your server, create a Checkout Session and redirect your customer to the URL returned in the response.

Command Line
cURL
curl https://api.stripe.com/v1/checkout/sessions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -H "Stripe-Account:
{{CONNECTED_ACCOUNT_ID}}
"
\ -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 mode=payment \ --data-urlencode success_url="https://example.com/success?session_id={CHECKOUT_SESSION_ID}"
  • line_items - This attribute represents items that your customer is purchasing and shows up in the Stripe-hosted checkout page.
  • payment_intent_data[application_fee_amount] - This attribute specifies the amount your platform deducts from the transaction as an application fee. After the payment is processed on the connected account, the application_fee_amount is transferred to the platform. See collect fees for more information.
  • success_url - Stripe redirects the customer to the success URL after they complete a payment and replaces the {CHECKOUT_SESSION_ID} string with the Checkout Session ID. Use this to retrieve the Checkout Session and inspect the status to decide what to show your customer. You can also append your own query parameters, which persist through the redirect process. See customize redirect behavior with a Stripe-hosted page for more information.
  • Stripe-Account - This header indicates a direct charge for your connected account. The connected account’s branding is used in Checkout, which allows their customers to feel like they’re interacting directly with the connected account instead of your platform.

Charges that you create directly on the connected account are reported only on that account. These charges aren’t shown in your platform’s Dashboard or exports. Direct charges are included in reports and Sigma for connected accounts that your platform controls. You can always retrieve this information using the Stripe API.

Handle post-payment events
Server-side

Stripe sends a checkout.session.completed event when the payment completes. Use a webhook to receive these events 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 with a single integration.

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

EventDescriptionNext steps
checkout.session.completedThe customer has successfully authorized the payment by submitting the Checkout form.Wait for the payment to succeed or fail.
checkout.session.async_payment_succeededThe customer’s payment succeeded.Fulfill the purchased goods or services.
checkout.session.async_payment_failedThe 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 object. After the payment succeeds, the underlying PaymentIntent status changes from processing to succeeded or a failure status.

Test the integration

Card numberScenarioHow to test
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.
The card payment requires authentication.Fill out the credit card form using the credit card number with any expiration, CVC, and postal code.
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.
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.

See Testing for additional information to test your integration.

OptionalEnable additional payment methods

Collect fees

When a payment is processed, your platform can take a portion of the transaction in the form of application fees. You can set application fee pricing in two ways:

  • Use the Platform Pricing Tool to set and test 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 application fees directly in a PaymentIntent. Fees set with this method override the pricing logic specified in the Platform Pricing Tool.

Your platform can take an application fee with the following limitations:

  • The value of application_fee_amount must be positive and less than the amount of the charge. The application fee collected is capped at the captured amount of the charge.
  • There are no additional Stripe fees on the application fee itself.
  • In line with Brazilian regulatory and compliance requirements, platforms based outside of Brazil, with Brazilian connected accounts can’t collect application fees through Stripe.
  • The currency of application_fee_amount depends upon a few multiple currency factors.

The resulting charge’s balance transaction includes a detailed fee breakdown of both the Stripe and application fees. To provide a better reporting experience, an Application Fee is created after the fee is collected. Use the amount property on the application fee object for reporting. You can then access these objects with the Application Fees endpoint.

Earned application fees are added to your available account balance on the same schedule as funds from regular Stripe charges. Application fees are viewable in the Collected fees section of the Dashboard.

Vorsicht

Application fees for direct charges are created asynchronously by default. If you expand the application_fee object in a charge creation request, the application fee is created synchronously as part of that request. Only expand the application_fee object if you must, because it increases the latency of the request.

To access the application fee objects for application fees that are created asynchronously, listen for the application_fee.created webhook event.

Flow of funds with fees

When you specify an application fee on a charge, the fee amount is transferred to your platform’s Stripe account. When processing a charge directly on the connected account, the charge amount—less the Stripe fees and application fee—is deposited into the connected account.

For example, if you make a charge of 10 USD with a 1.23 USD application fee (like in the previous example), 1.23 USD is transferred to your platform account. 8.18 USD (10 USD - 0.59 USD - 1.23 USD) is netted in the connected account (assuming standard US Stripe fees).

Flow of funds for a charge with an application fee

If you process payments in multiple currencies, read how currencies are handled in Connect.

Customize branding

Your platform and connected accounts can use the Branding settings 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:

  • 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.
Command Line
cURL
curl https://api.stripe.com/v1/accounts/
{{CONNECTED_ACCOUNT_ID}}
\ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -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"

Issue refunds

Just as platforms can create charges on connected accounts, they can also create refunds of charges on connected accounts. Create a refund using your platform’s secret key while authenticated as the connected account.

Application fees are not automatically refunded when issuing a refund. Your platform must explicitly refund the application fee or the connected account—the account on which the charge was created—loses that amount. You can refund an application fee by passing a refund_application_fee value of true in the refund request:

Command Line
cURL
curl https://api.stripe.com/v1/refunds \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -H "Stripe-Account:
{{CONNECTED_ACCOUNT_ID}}
"
\ -d charge=
{{CHARGE_ID}}
\ -d refund_application_fee=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 application fee is refunded. Otherwise, a proportional amount of the application fee is refunded. Alternatively, you can provide a refund_application_fee value of false and refund the application fee separately.

Siehe auch

  • Working with multiple currencies
  • Statement descriptors with Connect
War diese Seite hilfreich?
JaNein
Benötigen Sie Hilfe? Kontaktieren Sie den Kundensupport.
Nehmen Sie an unserem Programm für frühzeitigen Zugriff teil.
Schauen Sie sich unser Änderungsprotokoll an.
Fragen? Sales-Team kontaktieren.
LLM? Lesen Sie llms.txt.
Unterstützt von Markdoc