# Mit Treasury für Plattformen und Issuing Finanzkonten und Karten einrichten Schauen Sie sich ein Beispiel für die Integration von Treasury für Plattformen und Issuing an, bei dem ein Finanzkonto eingerichtet wird und Karten erstellt werden. Homebox ist ein fiktives vertikales SaaS-Unternehmen, das Software für Hausmeisterunternehmen entwickelt, wie etwa Heizungs- und Sanitärinstallateure, Reinigungsanbieter und Gas-/Wasserinstallateure. Homebox beginnt seine Integration von Treasury für Plattformen durch mit der Einrichtung eines Finanzkontos und der Erstellung von Zahlungskarten. Um zu sehen, wie Homebox Geldbewegungen auf und von externen Konten bewerkstelligt, siehe die Beispielintegration [Mit Treasury für Plattformen Geldbewegungen durchführen](https://docs.stripe.com/treasury/connect/examples/moving-money.md). ## Plattform-Onboarding Homebox ist bereits eine Stripe-Plattform, bei der [Payments](https://docs.stripe.com/payments.md) und [Connect](https://docs.stripe.com/connect.md) aktiviert sind. Homebox verwendet [nutzerdefinierte verbundene Konten](https://docs.stripe.com/connect/accounts.md), und für diese verbundenen Konten ist die Funktion `card_payments` bereits aktiviert. ## Funktionen hinzufügen > #### Kompatibilität mit der Accounts v2 API > > Die Accounts v2 API unterstützt keine Treasury for platforms-Workflows. Wenn Sie Konten mit Accounts v2 erstellt haben, können Sie Accounts v1 verwenden, um die Funktionen `treasury` and `card_issuing` zu verwalten. Weitere Informationen finden Sie unter [Accounts als Kundinnen und Kunden verwenden](https://docs.stripe.com/accounts-v2/use-accounts-as-customers.md). Um Treasury für Plattformen und Issuing nutzen zu können, muss Homebox die zusätzlichen Funktionen `treasury` und `card_issuing` für die verbundenen Konten der Plattform anfordern. Alle verbundenen Konten müssen dann das Onboarding durchlaufen, bevor Stripe ein zugehöriges Finanzkonto erstellen kann. Um ACH-Überweisungen mit Treasury für Plattformen zu verwenden, muss Homebox auch die Funktion `us_bank_account_ach_payments` anfordern. Um die Funktionen `treasury`, `card_issuing` und `us_bank_account_ach_payments` anzufordern, stellt Homebox eine Anfrage an die [Accounts API](https://docs.stripe.com/api/accounts.md). ```curl curl https://api.stripe.com/v1/accounts/{{CONNECTED_ACCOUNT_ID}} \ -u "<>:" \ -d "capabilities[treasury][requested]=true" \ -d "capabilities[card_issuing][requested]=true" \ -d "capabilities[us_bank_account_ach_payments][requested]=true" ``` Um das gehostete Onboarding zu verwenden, ruft Homebox [Konto-Links](https://docs.stripe.com/api/account_links.md) auf, um eine URL abzurufen, die ihr verbundenes Konto zum Übermitteln von Onboarding-Informationen für das Finanzkonto verwenden kann. ```curl curl https://api.stripe.com/v1/account_links \ -u "<>:" \ -d "account={{CONNECTEDACCOUNT_ID}}" \ --data-urlencode "refresh_url=https://example.com/reauth" \ --data-urlencode "return_url=https://example.com/return" \ -d type=account_onboarding ``` Die Antwort darauf enthält eine URL, mit der verbundene Konten auf das Anmeldeformular zugreifen können. Dies muss vor Ablauf des Links geschehen. ```json { "object": "account_link", "created": 1612927106, "expires_at": 1612927406,"url": "https://connect.stripe.com/setup/s/iCtLfmYb2tEU" } ``` Homebox hört den Webhook `account.updated` ab, um die folgenden Felder und Funktionen auf den verbundenen Konten zu bestätigen. ```json { "object": { "id": "{{CONNECTED_ACCOUNT_ID}}", "object": "account", "capabilities": { "card_payments": "active", "treasury": "active", "card_issuing": "active", // Only appears if requesting the `card_issuing` capability. "us_bank_account_ach_payments": "active", // Only appears if requesting the `us_bank_account_ach_payments` capability. }, ... } } ``` ## FinancialAccount erstellen Sobald Stripe einem Konto die Funktion `treasury` hinzufügt, kann Homebox das `FinancialAccount`-Objekt für das Konto erstellen. Hierfür ruft Homebox die [Financial Accounts API](https://docs.stripe.com/api/treasury/financial_accounts.md) auf und fordert die `Features` an, die das Unternehmen bereitstellen möchte. ```curl curl https://api.stripe.com/v1/treasury/financial_accounts \ -u "<>:" \ -H "Stripe-Account: {{CONNECTEDACCOUNT_ID}}" \ -d "supported_currencies[]=usd" \ -d "features[card_issuing][requested]=true" \ -d "features[deposit_insurance][requested]=true" \ -d "features[financial_addresses][aba][requested]=true" \ -d "features[inbound_transfers][ach][requested]=true" \ -d "features[intra_stripe_flows][requested]=true" \ -d "features[outbound_payments][ach][requested]=true" \ -d "features[outbound_payments][us_domestic_wire][requested]=true" \ -d "features[outbound_transfers][ach][requested]=true" \ -d "features[outbound_transfers][us_domestic_wire][requested]=true" ``` Die Antwort bestätigt, dass das Konto bearbeitet wird. Nachdem die Verarbeitung abgeschlossen ist und alle relevanten Funktionen aktiviert wurden, erhält die Homebox eine Bestätigung vom Webhook-Listener `treasury.financial_account.features_status_updated`. ```json { "object": "treasury.financial_account", "created": 1612927106, "id": "{{FINANCIAL_ACCOUNT_ID}}", "country": "US", "supported_currencies": ["usd"], "financial_addresses": [ // This field is empty until the "financial_addresses.aba" feature becomes active { "type": "aba", "supported_networks": ["ach", "us_domestic_wire"], "aba": { "account_number_last4": "7890", // Use the expand[] parameter to view the `account_number` field hidden by default "account_number": "1234567890", "routing_number": "000000001", "bank_name": "Bank of Earth" } } ], "livemode": true, // State machine: // open - the account is ready to be used // closed - the account is closed "status": "open", "status_details": { // `closed` is null if financial account is not closed "closed": { // List of one or more reasons why the FinancialAccount was closed: // - account_rejected // - closed_by_platform // - other "reasons": [] } }, "active_features": ["card_issuing"], "pending_features": ["deposit_insurance", "financial_addresses.aba", "outbound_payments.ach", "us_domestic_wire", "inbound_transfers.ach", "outbound_transfers.ach", "outbound_transfers.us_domestic_wire"], "restricted_features": [], "features": { "object": "treasury.financial_account_features", "card_issuing": { "status": "active", "status_details": [], "access": "active" }, "deposit_insurance": { "requested": true, "status": "pending", // Becomes "active" after the financial account is set up "status_details": [{"code": "activating", "resolution": null}] }, "financial_addresses": { "aba": { "requested": true, "status": "pending", // Becomes "active" after the financial account is set up "status_details": [{"code": "activating", "resolution": null}] } }, "outbound_payments": { "ach": { "requested": true, "status": "pending", // Becomes "active" after the financial account is set up "status_details": [{"code": "activating", "resolution": null}] }, "us_domestic_wire": { "requested": true, "status": "pending", // Becomes "active" after the financial account is set up "status_details": [{"code": "activating", "resolution": null}] } }, "inbound_transfers": { "ach": { "requested": true, "status": "pending", // Becomes "active" after the financial account is set up "status_details": [{"code": "activating", "resolution": null}] } }, "outbound_transfers": { "ach": { "requested": true, "status": "pending", // Becomes "active" after the financial account is set up "status_details": [{"code": "activating", "resolution": null}] }, "us_domestic_wire": { "requested": true, "status": "pending", // Becomes "active" once the financial account is set up "status_details": [{"code": "activating", "resolution": null}] } } }, "platform_restrictions": { "inbound_flows": "unrestricted", "outbound_flows": "unrestricted" }, "metadata": {}, ... } ``` ## Zahlungskarteninhaber/in erstellen Bevor Homebox Karten für Finanzkonten erstellen kann, muss es zunächst Karteninhaber/innen anlegen. In diesem Beispiel handelt es sich dabei um Klempnerfirmen, die die Dienstleistungen von Homebox nutzen und denen die die verbundenen Konten der Plattform gehören. ## Index This article has multiple variants. Fetch one of the following URLs to view specific content for your use case: - [Dashboard](https://docs.stripe.com/treasury/connect/examples/financial-accounts.md?testing-method=without-code) - [API](https://docs.stripe.com/treasury/connect/examples/financial-accounts.md?testing-method=with-code) ## Zahlungskarten erstellen Nachdem das verbundene Konto nun mit einem `FinancialAccount`-Objekt und einem/einer verfügbaren Karteninhaber/in verknüpft ist, kann Homebox eine Zahlungskarte mit dem Guthaben des `FinancialAccount` als verfügbarem Saldo der Karte erstellen. ## Index This article has multiple variants. Fetch one of the following URLs to view specific content for your use case: - [Dashboard](https://docs.stripe.com/treasury/connect/examples/financial-accounts.md?testing-method=without-code) - [API](https://docs.stripe.com/treasury/connect/examples/financial-accounts.md?testing-method=with-code) ## See also - [Mit Treasury für Plattformen Geldbewegungen durchführen](https://docs.stripe.com/treasury/connect/examples/moving-money.md) - [API-Dokumentation](https://docs.stripe.com/api/treasury/financial_accounts.md)