--- title: Access transactions for a Financial Connections account subtitle: Access an account's transactions with your user's permission. route: /financial-connections/transactions --- # Access transactions for a Financial Connections account Access an account's transactions with your user's permission. The Financial Connections API allows you to retrieve transactions on a [Financial Connections Account](https://stripe.com/api/financial_connections/accounts/object). Use transaction data to build a variety of products and solutions, such as: - Expedite the underwriting process and improve access to credit and other financial services for your users. - Mitigate fraud and reduce risk during user onboarding by evaluating a user’s transaction history, and understanding cash inflows and outflows from their financial accounts. - Help your users track expenses, handle bills, and manage their finances. You must have a completed Financial Connections registration to access transactions in live mode. Visit your [Dashboard settings](https://dashboard.stripe.com/settings/financial-connections) to check the state of your registration or begin the registration process. Financial Connections test data is always available. ## Create a customer [Recommended] [Server-side] We recommend that you create a *Customer* (Customer objects represent customers of your business. They let you reuse payment methods and give you the ability to track multiple payments) with an email address to represent your user, that you then attach to your payment. Attaching a `Customer` object allows you to [list previously linked accounts ](https://stripe.com/api/financial_connections/accounts/list) later. By providing an email address on the `Customer` object, Financial Connections can improve the authentication flow by simplifying sign-in or sign-up for your user, depending on whether they’re a returning [Link](https://support.stripe.com/questions/link-for-financial-connections-support-for-businesses) user. Code snippet calling post /v1/customers in curl (resource-based pattern). ```curl curl https://api.stripe.com/v1/customers \ -u "sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \ -d email={{CUSTOMER_EMAIL}} ``` Code snippet calling post /v1/customers in cli (resource-based pattern). ```cli stripe customers create \ --email={{CUSTOMER_EMAIL}} ``` Code snippet calling post /v1/customers in ruby (resource-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys Stripe.api_key = 'sk_test_BQokikJOvBiI2HlWgH4olfQ2' customer = Stripe::Customer.create({email: '{{CUSTOMER_EMAIL}}'}) ``` Code snippet calling post /v1/customers in ruby (service-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("sk_test_BQokikJOvBiI2HlWgH4olfQ2") customer = client.v1.customers.create({email: '{{CUSTOMER_EMAIL}}'}) ``` Code snippet calling post /v1/customers in python (resource-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys import stripe stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" customer = stripe.Customer.create(email="{{CUSTOMER_EMAIL}}") ``` Code snippet calling post /v1/customers in python (service-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2") customer = client.customers.create({"email": "{{CUSTOMER_EMAIL}}"}) ``` Code snippet calling post /v1/customers in php (resource-based pattern). ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); $customer = $stripe->customers->create(['email' => '{{CUSTOMER_EMAIL}}']); ``` Code snippet calling post /v1/customers in java (resource-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; CustomerCreateParams params = CustomerCreateParams.builder().setEmail("{{CUSTOMER_EMAIL}}").build(); Customer customer = Customer.create(params); ``` Code snippet calling post /v1/customers in java (service-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); CustomerCreateParams params = CustomerCreateParams.builder().setEmail("{{CUSTOMER_EMAIL}}").build(); Customer customer = client.customers().create(params); ``` Code snippet calling post /v1/customers in node (resource-based pattern). ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); const customer = await stripe.customers.create({ email: '{{CUSTOMER_EMAIL}}', }); ``` Code snippet calling post /v1/customers in go (resource-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys stripe.Key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" params := &stripe.CustomerParams{Email: stripe.String("{{CUSTOMER_EMAIL}}")}; result, err := customer.New(params); ``` Code snippet calling post /v1/customers in go (service-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); params := &stripe.CustomerCreateParams{Email: stripe.String("{{CUSTOMER_EMAIL}}")}; result, err := sc.V1Customers.Create(context.TODO(), params); ``` Code snippet calling post /v1/customers in dotnet (resource-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeConfiguration.ApiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; var options = new CustomerCreateOptions { Email = "{{CUSTOMER_EMAIL}}" }; var service = new CustomerService(); Customer customer = service.Create(options); ``` Code snippet calling post /v1/customers in dotnet (service-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new CustomerCreateOptions { Email = "{{CUSTOMER_EMAIL}}" }; var client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); var service = client.V1.Customers; Customer customer = service.Create(options); ``` ## Request access to an account's transactions [Server-side] You must collect an account before you can access its transaction data. To learn more about how to collect Financial Connections Accounts consult the integration guide most relevant to your use case: [accept payments](https://stripe.com/financial-connections/ach-direct-debit-payments), [facilitate Connect payouts](https://stripe.com/financial-connections/connect-payouts), or [build other-data powered products](https://stripe.com/financial-connections/other-data-powered-products). When collecting an account, you specify the data you need access to with the [permissions](https://stripe.com/financial-connections/fundamentals#data-permissions) parameter. The set of requested data permissions are viewable by the user in the [authentication flow](https://stripe.com/financial-connections/fundamentals#authentication-flow). Financial Connections Accounts are collectible through various integration paths, and how you specify the parameter varies slightly by API. #### Payment Intents Code snippet calling post /v1/payment_intents in curl (resource-based pattern). ```curl curl https://api.stripe.com/v1/payment_intents \ -u "sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \ -d amount=20000 \ -d currency=usd \ -d customer="{{CUSTOMER_ID}}" \ -d "payment_method_types[]"=us_bank_account \ -d "payment_method_options[us_bank_account][financial_connections][permissions][]"=transactions \ -d "payment_method_options[us_bank_account][financial_connections][permissions][]"=payment_method ``` Code snippet calling post /v1/payment_intents in cli (resource-based pattern). ```cli stripe payment_intents create \ --amount=20000 \ --currency=usd \ --customer="{{CUSTOMER_ID}}" \ -d "payment_method_types[0]"=us_bank_account \ -d "payment_method_options[us_bank_account][financial_connections][permissions][0]"=transactions \ -d "payment_method_options[us_bank_account][financial_connections][permissions][1]"=payment_method ``` Code snippet calling post /v1/payment_intents in ruby (resource-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys Stripe.api_key = 'sk_test_BQokikJOvBiI2HlWgH4olfQ2' payment_intent = Stripe::PaymentIntent.create({ amount: 20000, currency: 'usd', customer: '{{CUSTOMER_ID}}', payment_method_types: ['us_bank_account'], payment_method_options: { us_bank_account: { financial_connections: {permissions: ['transactions', 'payment_method']}, }, }, }) ``` Code snippet calling post /v1/payment_intents in ruby (service-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("sk_test_BQokikJOvBiI2HlWgH4olfQ2") payment_intent = client.v1.payment_intents.create({ amount: 20000, currency: 'usd', customer: '{{CUSTOMER_ID}}', payment_method_types: ['us_bank_account'], payment_method_options: { us_bank_account: { financial_connections: {permissions: ['transactions', 'payment_method']}, }, }, }) ``` Code snippet calling post /v1/payment_intents in python (resource-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys import stripe stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" payment_intent = stripe.PaymentIntent.create( amount=20000, currency="usd", customer="{{CUSTOMER_ID}}", payment_method_types=["us_bank_account"], payment_method_options={ "us_bank_account": { "financial_connections": {"permissions": ["transactions", "payment_method"]}, }, }, ) ``` Code snippet calling post /v1/payment_intents in python (service-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2") payment_intent = client.payment_intents.create({ "amount": 20000, "currency": "usd", "customer": "{{CUSTOMER_ID}}", "payment_method_types": ["us_bank_account"], "payment_method_options": { "us_bank_account": { "financial_connections": {"permissions": ["transactions", "payment_method"]}, }, }, }) ``` Code snippet calling post /v1/payment_intents in php (resource-based pattern). ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); $paymentIntent = $stripe->paymentIntents->create([ 'amount' => 20000, 'currency' => 'usd', 'customer' => '{{CUSTOMER_ID}}', 'payment_method_types' => ['us_bank_account'], 'payment_method_options' => [ 'us_bank_account' => [ 'financial_connections' => ['permissions' => ['transactions', 'payment_method']], ], ], ]); ``` Code snippet calling post /v1/payment_intents in java (resource-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; PaymentIntentCreateParams params = PaymentIntentCreateParams.builder() .setAmount(20000L) .setCurrency("usd") .setCustomer("{{CUSTOMER_ID}}") .addPaymentMethodType("us_bank_account") .setPaymentMethodOptions( PaymentIntentCreateParams.PaymentMethodOptions.builder() .setUsBankAccount( PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.builder() .setFinancialConnections( PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.builder() .addPermission( PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission.TRANSACTIONS ) .addPermission( PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission.PAYMENT_METHOD ) .build() ) .build() ) .build() ) .build(); PaymentIntent paymentIntent = PaymentIntent.create(params); ``` Code snippet calling post /v1/payment_intents in java (service-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); PaymentIntentCreateParams params = PaymentIntentCreateParams.builder() .setAmount(20000L) .setCurrency("usd") .setCustomer("{{CUSTOMER_ID}}") .addPaymentMethodType("us_bank_account") .setPaymentMethodOptions( PaymentIntentCreateParams.PaymentMethodOptions.builder() .setUsBankAccount( PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.builder() .setFinancialConnections( PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.builder() .addPermission( PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission.TRANSACTIONS ) .addPermission( PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission.PAYMENT_METHOD ) .build() ) .build() ) .build() ) .build(); PaymentIntent paymentIntent = client.paymentIntents().create(params); ``` Code snippet calling post /v1/payment_intents in node (resource-based pattern). ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); const paymentIntent = await stripe.paymentIntents.create({ amount: 20000, currency: 'usd', customer: '{{CUSTOMER_ID}}', payment_method_types: ['us_bank_account'], payment_method_options: { us_bank_account: { financial_connections: { permissions: ['transactions', 'payment_method'], }, }, }, }); ``` Code snippet calling post /v1/payment_intents in go (resource-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys stripe.Key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" params := &stripe.PaymentIntentParams{ Amount: stripe.Int64(20000), Currency: stripe.String(stripe.CurrencyUSD), Customer: stripe.String("{{CUSTOMER_ID}}"), PaymentMethodTypes: []*string{stripe.String("us_bank_account")}, PaymentMethodOptions: &stripe.PaymentIntentPaymentMethodOptionsParams{ USBankAccount: &stripe.PaymentIntentPaymentMethodOptionsUSBankAccountParams{ FinancialConnections: &stripe.PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsParams{ Permissions: []*string{ stripe.String(stripe.PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionTransactions), stripe.String(stripe.PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionPaymentMethod), }, }, }, }, }; result, err := paymentintent.New(params); ``` Code snippet calling post /v1/payment_intents in go (service-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); params := &stripe.PaymentIntentCreateParams{ Amount: stripe.Int64(20000), Currency: stripe.String(stripe.CurrencyUSD), Customer: stripe.String("{{CUSTOMER_ID}}"), PaymentMethodTypes: []*string{stripe.String("us_bank_account")}, PaymentMethodOptions: &stripe.PaymentIntentCreatePaymentMethodOptionsParams{ USBankAccount: &stripe.PaymentIntentCreatePaymentMethodOptionsUSBankAccountParams{ FinancialConnections: &stripe.PaymentIntentCreatePaymentMethodOptionsUSBankAccountFinancialConnectionsParams{ Permissions: []*string{ stripe.String(stripe.PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionTransactions), stripe.String(stripe.PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionPaymentMethod), }, }, }, }, }; result, err := sc.V1PaymentIntents.Create(context.TODO(), params); ``` Code snippet calling post /v1/payment_intents in dotnet (resource-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeConfiguration.ApiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; var options = new PaymentIntentCreateOptions { Amount = 20000, Currency = "usd", Customer = "{{CUSTOMER_ID}}", PaymentMethodTypes = new List { "us_bank_account" }, PaymentMethodOptions = new PaymentIntentPaymentMethodOptionsOptions { UsBankAccount = new PaymentIntentPaymentMethodOptionsUsBankAccountOptions { FinancialConnections = new PaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsOptions { Permissions = new List { "transactions", "payment_method" }, }, }, }, }; var service = new PaymentIntentService(); PaymentIntent paymentIntent = service.Create(options); ``` Code snippet calling post /v1/payment_intents in dotnet (service-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new PaymentIntentCreateOptions { Amount = 20000, Currency = "usd", Customer = "{{CUSTOMER_ID}}", PaymentMethodTypes = new List { "us_bank_account" }, PaymentMethodOptions = new PaymentIntentPaymentMethodOptionsOptions { UsBankAccount = new PaymentIntentPaymentMethodOptionsUsBankAccountOptions { FinancialConnections = new PaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsOptions { Permissions = new List { "transactions", "payment_method" }, }, }, }, }; var client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); var service = client.V1.PaymentIntents; PaymentIntent paymentIntent = service.Create(options); ``` #### Setup Intents Code snippet calling post /v1/setup_intents in curl (resource-based pattern). ```curl curl https://api.stripe.com/v1/setup_intents \ -u "sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \ -d customer="{{CUSTOMER_ID}}" \ -d "payment_method_types[]"=us_bank_account \ -d "payment_method_options[us_bank_account][financial_connections][permissions][]"=transactions \ -d "payment_method_options[us_bank_account][financial_connections][permissions][]"=payment_method ``` Code snippet calling post /v1/setup_intents in cli (resource-based pattern). ```cli stripe setup_intents create \ --customer="{{CUSTOMER_ID}}" \ -d "payment_method_types[0]"=us_bank_account \ -d "payment_method_options[us_bank_account][financial_connections][permissions][0]"=transactions \ -d "payment_method_options[us_bank_account][financial_connections][permissions][1]"=payment_method ``` Code snippet calling post /v1/setup_intents in ruby (resource-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys Stripe.api_key = 'sk_test_BQokikJOvBiI2HlWgH4olfQ2' setup_intent = Stripe::SetupIntent.create({ customer: '{{CUSTOMER_ID}}', payment_method_types: ['us_bank_account'], payment_method_options: { us_bank_account: { financial_connections: {permissions: ['transactions', 'payment_method']}, }, }, }) ``` Code snippet calling post /v1/setup_intents in ruby (service-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("sk_test_BQokikJOvBiI2HlWgH4olfQ2") setup_intent = client.v1.setup_intents.create({ customer: '{{CUSTOMER_ID}}', payment_method_types: ['us_bank_account'], payment_method_options: { us_bank_account: { financial_connections: {permissions: ['transactions', 'payment_method']}, }, }, }) ``` Code snippet calling post /v1/setup_intents in python (resource-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys import stripe stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" setup_intent = stripe.SetupIntent.create( customer="{{CUSTOMER_ID}}", payment_method_types=["us_bank_account"], payment_method_options={ "us_bank_account": { "financial_connections": {"permissions": ["transactions", "payment_method"]}, }, }, ) ``` Code snippet calling post /v1/setup_intents in python (service-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2") setup_intent = client.setup_intents.create({ "customer": "{{CUSTOMER_ID}}", "payment_method_types": ["us_bank_account"], "payment_method_options": { "us_bank_account": { "financial_connections": {"permissions": ["transactions", "payment_method"]}, }, }, }) ``` Code snippet calling post /v1/setup_intents in php (resource-based pattern). ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); $setupIntent = $stripe->setupIntents->create([ 'customer' => '{{CUSTOMER_ID}}', 'payment_method_types' => ['us_bank_account'], 'payment_method_options' => [ 'us_bank_account' => [ 'financial_connections' => ['permissions' => ['transactions', 'payment_method']], ], ], ]); ``` Code snippet calling post /v1/setup_intents in java (resource-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; SetupIntentCreateParams params = SetupIntentCreateParams.builder() .setCustomer("{{CUSTOMER_ID}}") .addPaymentMethodType("us_bank_account") .setPaymentMethodOptions( SetupIntentCreateParams.PaymentMethodOptions.builder() .setUsBankAccount( SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.builder() .setFinancialConnections( SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.builder() .addPermission( SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission.TRANSACTIONS ) .addPermission( SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission.PAYMENT_METHOD ) .build() ) .build() ) .build() ) .build(); SetupIntent setupIntent = SetupIntent.create(params); ``` Code snippet calling post /v1/setup_intents in java (service-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); SetupIntentCreateParams params = SetupIntentCreateParams.builder() .setCustomer("{{CUSTOMER_ID}}") .addPaymentMethodType("us_bank_account") .setPaymentMethodOptions( SetupIntentCreateParams.PaymentMethodOptions.builder() .setUsBankAccount( SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.builder() .setFinancialConnections( SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.builder() .addPermission( SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission.TRANSACTIONS ) .addPermission( SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission.PAYMENT_METHOD ) .build() ) .build() ) .build() ) .build(); SetupIntent setupIntent = client.setupIntents().create(params); ``` Code snippet calling post /v1/setup_intents in node (resource-based pattern). ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); const setupIntent = await stripe.setupIntents.create({ customer: '{{CUSTOMER_ID}}', payment_method_types: ['us_bank_account'], payment_method_options: { us_bank_account: { financial_connections: { permissions: ['transactions', 'payment_method'], }, }, }, }); ``` Code snippet calling post /v1/setup_intents in go (resource-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys stripe.Key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" params := &stripe.SetupIntentParams{ Customer: stripe.String("{{CUSTOMER_ID}}"), PaymentMethodTypes: []*string{stripe.String("us_bank_account")}, PaymentMethodOptions: &stripe.SetupIntentPaymentMethodOptionsParams{ USBankAccount: &stripe.SetupIntentPaymentMethodOptionsUSBankAccountParams{ FinancialConnections: &stripe.SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsParams{ Permissions: []*string{ stripe.String(stripe.SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionTransactions), stripe.String(stripe.SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionPaymentMethod), }, }, }, }, }; result, err := setupintent.New(params); ``` Code snippet calling post /v1/setup_intents in go (service-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); params := &stripe.SetupIntentCreateParams{ Customer: stripe.String("{{CUSTOMER_ID}}"), PaymentMethodTypes: []*string{stripe.String("us_bank_account")}, PaymentMethodOptions: &stripe.SetupIntentCreatePaymentMethodOptionsParams{ USBankAccount: &stripe.SetupIntentCreatePaymentMethodOptionsUSBankAccountParams{ FinancialConnections: &stripe.SetupIntentCreatePaymentMethodOptionsUSBankAccountFinancialConnectionsParams{ Permissions: []*string{ stripe.String(stripe.SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionTransactions), stripe.String(stripe.SetupIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionPaymentMethod), }, }, }, }, }; result, err := sc.V1SetupIntents.Create(context.TODO(), params); ``` Code snippet calling post /v1/setup_intents in dotnet (resource-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeConfiguration.ApiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; var options = new SetupIntentCreateOptions { Customer = "{{CUSTOMER_ID}}", PaymentMethodTypes = new List { "us_bank_account" }, PaymentMethodOptions = new SetupIntentPaymentMethodOptionsOptions { UsBankAccount = new SetupIntentPaymentMethodOptionsUsBankAccountOptions { FinancialConnections = new SetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsOptions { Permissions = new List { "transactions", "payment_method" }, }, }, }, }; var service = new SetupIntentService(); SetupIntent setupIntent = service.Create(options); ``` Code snippet calling post /v1/setup_intents in dotnet (service-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new SetupIntentCreateOptions { Customer = "{{CUSTOMER_ID}}", PaymentMethodTypes = new List { "us_bank_account" }, PaymentMethodOptions = new SetupIntentPaymentMethodOptionsOptions { UsBankAccount = new SetupIntentPaymentMethodOptionsUsBankAccountOptions { FinancialConnections = new SetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsOptions { Permissions = new List { "transactions", "payment_method" }, }, }, }, }; var client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); var service = client.V1.SetupIntents; SetupIntent setupIntent = service.Create(options); ``` #### Sessions Code snippet calling post /v1/financial_connections/sessions in curl (resource-based pattern). ```curl curl https://api.stripe.com/v1/financial_connections/sessions \ -u "sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \ -d "account_holder[type]"=customer \ -d "account_holder[customer]"="{{CUSTOMER_ID}}" \ -d "permissions[]"=transactions ``` Code snippet calling post /v1/financial_connections/sessions in cli (resource-based pattern). ```cli stripe financial_connections sessions create \ -d "account_holder[type]"=customer \ -d "account_holder[customer]"="{{CUSTOMER_ID}}" \ -d "permissions[0]"=transactions ``` Code snippet calling post /v1/financial_connections/sessions in ruby (resource-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys Stripe.api_key = 'sk_test_BQokikJOvBiI2HlWgH4olfQ2' session = Stripe::FinancialConnections::Session.create({ account_holder: { type: 'customer', customer: '{{CUSTOMER_ID}}', }, permissions: ['transactions'], }) ``` Code snippet calling post /v1/financial_connections/sessions in ruby (service-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("sk_test_BQokikJOvBiI2HlWgH4olfQ2") session = client.v1.financial_connections.sessions.create({ account_holder: { type: 'customer', customer: '{{CUSTOMER_ID}}', }, permissions: ['transactions'], }) ``` Code snippet calling post /v1/financial_connections/sessions in python (resource-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys import stripe stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" session = stripe.financial_connections.Session.create( account_holder={"type": "customer", "customer": "{{CUSTOMER_ID}}"}, permissions=["transactions"], ) ``` Code snippet calling post /v1/financial_connections/sessions in python (service-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2") session = client.financial_connections.sessions.create({ "account_holder": {"type": "customer", "customer": "{{CUSTOMER_ID}}"}, "permissions": ["transactions"], }) ``` Code snippet calling post /v1/financial_connections/sessions in php (resource-based pattern). ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); $session = $stripe->financialConnections->sessions->create([ 'account_holder' => [ 'type' => 'customer', 'customer' => '{{CUSTOMER_ID}}', ], 'permissions' => ['transactions'], ]); ``` Code snippet calling post /v1/financial_connections/sessions in java (resource-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; SessionCreateParams params = SessionCreateParams.builder() .setAccountHolder( SessionCreateParams.AccountHolder.builder() .setType(SessionCreateParams.AccountHolder.Type.CUSTOMER) .setCustomer("{{CUSTOMER_ID}}") .build() ) .addPermission(SessionCreateParams.Permission.TRANSACTIONS) .build(); Session session = Session.create(params); ``` Code snippet calling post /v1/financial_connections/sessions in java (service-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); SessionCreateParams params = SessionCreateParams.builder() .setAccountHolder( SessionCreateParams.AccountHolder.builder() .setType(SessionCreateParams.AccountHolder.Type.CUSTOMER) .setCustomer("{{CUSTOMER_ID}}") .build() ) .addPermission(SessionCreateParams.Permission.TRANSACTIONS) .build(); Session session = client.financialConnections().sessions().create(params); ``` Code snippet calling post /v1/financial_connections/sessions in node (resource-based pattern). ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); const session = await stripe.financialConnections.sessions.create({ account_holder: { type: 'customer', customer: '{{CUSTOMER_ID}}', }, permissions: ['transactions'], }); ``` Code snippet calling post /v1/financial_connections/sessions in go (resource-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys stripe.Key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" params := &stripe.FinancialConnectionsSessionParams{ AccountHolder: &stripe.FinancialConnectionsSessionAccountHolderParams{ Type: stripe.String(stripe.FinancialConnectionsSessionAccountHolderTypeCustomer), Customer: stripe.String("{{CUSTOMER_ID}}"), }, Permissions: []*string{ stripe.String(stripe.FinancialConnectionsSessionPermissionTransactions), }, }; result, err := session.New(params); ``` Code snippet calling post /v1/financial_connections/sessions in go (service-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); params := &stripe.FinancialConnectionsSessionCreateParams{ AccountHolder: &stripe.FinancialConnectionsSessionCreateAccountHolderParams{ Type: stripe.String(stripe.FinancialConnectionsSessionAccountHolderTypeCustomer), Customer: stripe.String("{{CUSTOMER_ID}}"), }, Permissions: []*string{ stripe.String(stripe.FinancialConnectionsSessionPermissionTransactions), }, }; result, err := sc.V1FinancialConnectionsSessions.Create(context.TODO(), params); ``` Code snippet calling post /v1/financial_connections/sessions in dotnet (resource-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeConfiguration.ApiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; var options = new Stripe.FinancialConnections.SessionCreateOptions { AccountHolder = new Stripe.FinancialConnections.SessionAccountHolderOptions { Type = "customer", Customer = "{{CUSTOMER_ID}}", }, Permissions = new List { "transactions" }, }; var service = new Stripe.FinancialConnections.SessionService(); Stripe.FinancialConnections.Session session = service.Create(options); ``` Code snippet calling post /v1/financial_connections/sessions in dotnet (service-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new Stripe.FinancialConnections.SessionCreateOptions { AccountHolder = new Stripe.FinancialConnections.SessionAccountHolderOptions { Type = "customer", Customer = "{{CUSTOMER_ID}}", }, Permissions = new List { "transactions" }, }; var client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); var service = client.V1.FinancialConnections.Sessions; Stripe.FinancialConnections.Session session = service.Create(options); ``` #### Checkout Code snippet calling post /v1/checkout/sessions in curl (resource-based pattern). ```curl curl https://api.stripe.com/v1/checkout/sessions \ -u "sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \ -d customer="{{CUSTOMER_ID}}" \ -d "payment_method_types[]"=us_bank_account \ -d "payment_method_options[us_bank_account][financial_connections][permissions][]"=transactions \ -d "payment_method_options[us_bank_account][financial_connections][permissions][]"=payment_method ``` Code snippet calling post /v1/checkout/sessions in cli (resource-based pattern). ```cli stripe checkout sessions create \ --customer="{{CUSTOMER_ID}}" \ -d "payment_method_types[0]"=us_bank_account \ -d "payment_method_options[us_bank_account][financial_connections][permissions][0]"=transactions \ -d "payment_method_options[us_bank_account][financial_connections][permissions][1]"=payment_method ``` Code snippet calling post /v1/checkout/sessions in ruby (resource-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys Stripe.api_key = 'sk_test_BQokikJOvBiI2HlWgH4olfQ2' session = Stripe::Checkout::Session.create({ customer: '{{CUSTOMER_ID}}', payment_method_types: ['us_bank_account'], payment_method_options: { us_bank_account: { financial_connections: {permissions: ['transactions', 'payment_method']}, }, }, }) ``` Code snippet calling post /v1/checkout/sessions in ruby (service-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("sk_test_BQokikJOvBiI2HlWgH4olfQ2") session = client.v1.checkout.sessions.create({ customer: '{{CUSTOMER_ID}}', payment_method_types: ['us_bank_account'], payment_method_options: { us_bank_account: { financial_connections: {permissions: ['transactions', 'payment_method']}, }, }, }) ``` Code snippet calling post /v1/checkout/sessions in python (resource-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys import stripe stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" session = stripe.checkout.Session.create( customer="{{CUSTOMER_ID}}", payment_method_types=["us_bank_account"], payment_method_options={ "us_bank_account": { "financial_connections": {"permissions": ["transactions", "payment_method"]}, }, }, ) ``` Code snippet calling post /v1/checkout/sessions in python (service-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2") session = client.checkout.sessions.create({ "customer": "{{CUSTOMER_ID}}", "payment_method_types": ["us_bank_account"], "payment_method_options": { "us_bank_account": { "financial_connections": {"permissions": ["transactions", "payment_method"]}, }, }, }) ``` Code snippet calling post /v1/checkout/sessions in php (resource-based pattern). ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); $session = $stripe->checkout->sessions->create([ 'customer' => '{{CUSTOMER_ID}}', 'payment_method_types' => ['us_bank_account'], 'payment_method_options' => [ 'us_bank_account' => [ 'financial_connections' => ['permissions' => ['transactions', 'payment_method']], ], ], ]); ``` Code snippet calling post /v1/checkout/sessions in java (resource-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; SessionCreateParams params = SessionCreateParams.builder() .setCustomer("{{CUSTOMER_ID}}") .addPaymentMethodType(SessionCreateParams.PaymentMethodType.US_BANK_ACCOUNT) .setPaymentMethodOptions( SessionCreateParams.PaymentMethodOptions.builder() .setUsBankAccount( SessionCreateParams.PaymentMethodOptions.UsBankAccount.builder() .setFinancialConnections( SessionCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.builder() .addPermission( SessionCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission.TRANSACTIONS ) .addPermission( SessionCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission.PAYMENT_METHOD ) .build() ) .build() ) .build() ) .build(); Session session = Session.create(params); ``` Code snippet calling post /v1/checkout/sessions in java (service-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); SessionCreateParams params = SessionCreateParams.builder() .setCustomer("{{CUSTOMER_ID}}") .addPaymentMethodType(SessionCreateParams.PaymentMethodType.US_BANK_ACCOUNT) .setPaymentMethodOptions( SessionCreateParams.PaymentMethodOptions.builder() .setUsBankAccount( SessionCreateParams.PaymentMethodOptions.UsBankAccount.builder() .setFinancialConnections( SessionCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.builder() .addPermission( SessionCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission.TRANSACTIONS ) .addPermission( SessionCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission.PAYMENT_METHOD ) .build() ) .build() ) .build() ) .build(); Session session = client.checkout().sessions().create(params); ``` Code snippet calling post /v1/checkout/sessions in node (resource-based pattern). ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); const session = await stripe.checkout.sessions.create({ customer: '{{CUSTOMER_ID}}', payment_method_types: ['us_bank_account'], payment_method_options: { us_bank_account: { financial_connections: { permissions: ['transactions', 'payment_method'], }, }, }, }); ``` Code snippet calling post /v1/checkout/sessions in go (resource-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys stripe.Key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" params := &stripe.CheckoutSessionParams{ Customer: stripe.String("{{CUSTOMER_ID}}"), PaymentMethodTypes: []*string{stripe.String("us_bank_account")}, PaymentMethodOptions: &stripe.CheckoutSessionPaymentMethodOptionsParams{ USBankAccount: &stripe.CheckoutSessionPaymentMethodOptionsUSBankAccountParams{ FinancialConnections: &stripe.CheckoutSessionPaymentMethodOptionsUSBankAccountFinancialConnectionsParams{ Permissions: []*string{ stripe.String(stripe.CheckoutSessionPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionTransactions), stripe.String(stripe.CheckoutSessionPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionPaymentMethod), }, }, }, }, }; result, err := session.New(params); ``` Code snippet calling post /v1/checkout/sessions in go (service-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); params := &stripe.CheckoutSessionCreateParams{ Customer: stripe.String("{{CUSTOMER_ID}}"), PaymentMethodTypes: []*string{stripe.String("us_bank_account")}, PaymentMethodOptions: &stripe.CheckoutSessionCreatePaymentMethodOptionsParams{ USBankAccount: &stripe.CheckoutSessionCreatePaymentMethodOptionsUSBankAccountParams{ FinancialConnections: &stripe.CheckoutSessionCreatePaymentMethodOptionsUSBankAccountFinancialConnectionsParams{ Permissions: []*string{ stripe.String(stripe.CheckoutSessionPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionTransactions), stripe.String(stripe.CheckoutSessionPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionPaymentMethod), }, }, }, }, }; result, err := sc.V1CheckoutSessions.Create(context.TODO(), params); ``` Code snippet calling post /v1/checkout/sessions in dotnet (resource-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeConfiguration.ApiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; var options = new Stripe.Checkout.SessionCreateOptions { Customer = "{{CUSTOMER_ID}}", PaymentMethodTypes = new List { "us_bank_account" }, PaymentMethodOptions = new Stripe.Checkout.SessionPaymentMethodOptionsOptions { UsBankAccount = new Stripe.Checkout.SessionPaymentMethodOptionsUsBankAccountOptions { FinancialConnections = new Stripe.Checkout.SessionPaymentMethodOptionsUsBankAccountFinancialConnectionsOptions { Permissions = new List { "transactions", "payment_method" }, }, }, }, }; var service = new Stripe.Checkout.SessionService(); Stripe.Checkout.Session session = service.Create(options); ``` Code snippet calling post /v1/checkout/sessions in dotnet (service-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new Stripe.Checkout.SessionCreateOptions { Customer = "{{CUSTOMER_ID}}", PaymentMethodTypes = new List { "us_bank_account" }, PaymentMethodOptions = new Stripe.Checkout.SessionPaymentMethodOptionsOptions { UsBankAccount = new Stripe.Checkout.SessionPaymentMethodOptionsUsBankAccountOptions { FinancialConnections = new Stripe.Checkout.SessionPaymentMethodOptionsUsBankAccountFinancialConnectionsOptions { Permissions = new List { "transactions", "payment_method" }, }, }, }, }; var client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); var service = client.V1.Checkout.Sessions; Stripe.Checkout.Session session = service.Create(options); ``` #### Invoices Code snippet calling post /v1/invoices in curl (resource-based pattern). ```curl curl https://api.stripe.com/v1/invoices \ -u "sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \ -d customer="{{CUSTOMER_ID}}" \ -d "payment_settings[payment_method_types][]"=us_bank_account \ -d "payment_settings[payment_method_options][us_bank_account][financial_connections][permissions][]"=transactions \ -d "payment_settings[payment_method_options][us_bank_account][financial_connections][permissions][]"=payment_method ``` Code snippet calling post /v1/invoices in cli (resource-based pattern). ```cli stripe invoices create \ --customer="{{CUSTOMER_ID}}" \ -d "payment_settings[payment_method_types][0]"=us_bank_account \ -d "payment_settings[payment_method_options][us_bank_account][financial_connections][permissions][0]"=transactions \ -d "payment_settings[payment_method_options][us_bank_account][financial_connections][permissions][1]"=payment_method ``` Code snippet calling post /v1/invoices in ruby (resource-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys Stripe.api_key = 'sk_test_BQokikJOvBiI2HlWgH4olfQ2' invoice = Stripe::Invoice.create({ customer: '{{CUSTOMER_ID}}', payment_settings: { payment_method_types: ['us_bank_account'], payment_method_options: { us_bank_account: { financial_connections: {permissions: ['transactions', 'payment_method']}, }, }, }, }) ``` Code snippet calling post /v1/invoices in ruby (service-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("sk_test_BQokikJOvBiI2HlWgH4olfQ2") invoice = client.v1.invoices.create({ customer: '{{CUSTOMER_ID}}', payment_settings: { payment_method_types: ['us_bank_account'], payment_method_options: { us_bank_account: { financial_connections: {permissions: ['transactions', 'payment_method']}, }, }, }, }) ``` Code snippet calling post /v1/invoices in python (resource-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys import stripe stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" invoice = stripe.Invoice.create( customer="{{CUSTOMER_ID}}", payment_settings={ "payment_method_types": ["us_bank_account"], "payment_method_options": { "us_bank_account": { "financial_connections": {"permissions": ["transactions", "payment_method"]}, }, }, }, ) ``` Code snippet calling post /v1/invoices in python (service-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2") invoice = client.invoices.create({ "customer": "{{CUSTOMER_ID}}", "payment_settings": { "payment_method_types": ["us_bank_account"], "payment_method_options": { "us_bank_account": { "financial_connections": {"permissions": ["transactions", "payment_method"]}, }, }, }, }) ``` Code snippet calling post /v1/invoices in php (resource-based pattern). ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); $invoice = $stripe->invoices->create([ 'customer' => '{{CUSTOMER_ID}}', 'payment_settings' => [ 'payment_method_types' => ['us_bank_account'], 'payment_method_options' => [ 'us_bank_account' => [ 'financial_connections' => ['permissions' => ['transactions', 'payment_method']], ], ], ], ]); ``` Code snippet calling post /v1/invoices in java (resource-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; InvoiceCreateParams params = InvoiceCreateParams.builder() .setCustomer("{{CUSTOMER_ID}}") .setPaymentSettings( InvoiceCreateParams.PaymentSettings.builder() .addPaymentMethodType( InvoiceCreateParams.PaymentSettings.PaymentMethodType.US_BANK_ACCOUNT ) .setPaymentMethodOptions( InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.builder() .setUsBankAccount( InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.builder() .setFinancialConnections( InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.builder() .addPermission( InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission.TRANSACTIONS ) .addPermission( InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission.PAYMENT_METHOD ) .build() ) .build() ) .build() ) .build() ) .build(); Invoice invoice = Invoice.create(params); ``` Code snippet calling post /v1/invoices in java (service-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); InvoiceCreateParams params = InvoiceCreateParams.builder() .setCustomer("{{CUSTOMER_ID}}") .setPaymentSettings( InvoiceCreateParams.PaymentSettings.builder() .addPaymentMethodType( InvoiceCreateParams.PaymentSettings.PaymentMethodType.US_BANK_ACCOUNT ) .setPaymentMethodOptions( InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.builder() .setUsBankAccount( InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.builder() .setFinancialConnections( InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.builder() .addPermission( InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission.TRANSACTIONS ) .addPermission( InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission.PAYMENT_METHOD ) .build() ) .build() ) .build() ) .build() ) .build(); Invoice invoice = client.invoices().create(params); ``` Code snippet calling post /v1/invoices in node (resource-based pattern). ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); const invoice = await stripe.invoices.create({ customer: '{{CUSTOMER_ID}}', payment_settings: { payment_method_types: ['us_bank_account'], payment_method_options: { us_bank_account: { financial_connections: { permissions: ['transactions', 'payment_method'], }, }, }, }, }); ``` Code snippet calling post /v1/invoices in go (resource-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys stripe.Key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" params := &stripe.InvoiceParams{ Customer: stripe.String("{{CUSTOMER_ID}}"), PaymentSettings: &stripe.InvoicePaymentSettingsParams{ PaymentMethodTypes: []*string{ stripe.String(stripe.InvoicePaymentSettingsPaymentMethodTypeUSBankAccount), }, PaymentMethodOptions: &stripe.InvoicePaymentSettingsPaymentMethodOptionsParams{ USBankAccount: &stripe.InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountParams{ FinancialConnections: &stripe.InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsParams{ Permissions: []*string{ stripe.String(stripe.InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionTransactions), stripe.String(stripe.InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionPaymentMethod), }, }, }, }, }, }; result, err := invoice.New(params); ``` Code snippet calling post /v1/invoices in go (service-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); params := &stripe.InvoiceCreateParams{ Customer: stripe.String("{{CUSTOMER_ID}}"), PaymentSettings: &stripe.InvoiceCreatePaymentSettingsParams{ PaymentMethodTypes: []*string{ stripe.String(stripe.InvoicePaymentSettingsPaymentMethodTypeUSBankAccount), }, PaymentMethodOptions: &stripe.InvoiceCreatePaymentSettingsPaymentMethodOptionsParams{ USBankAccount: &stripe.InvoiceCreatePaymentSettingsPaymentMethodOptionsUSBankAccountParams{ FinancialConnections: &stripe.InvoiceCreatePaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsParams{ Permissions: []*string{ stripe.String(stripe.InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionTransactions), stripe.String(stripe.InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionPaymentMethod), }, }, }, }, }, }; result, err := sc.V1Invoices.Create(context.TODO(), params); ``` Code snippet calling post /v1/invoices in dotnet (resource-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeConfiguration.ApiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; var options = new InvoiceCreateOptions { Customer = "{{CUSTOMER_ID}}", PaymentSettings = new InvoicePaymentSettingsOptions { PaymentMethodTypes = new List { "us_bank_account" }, PaymentMethodOptions = new InvoicePaymentSettingsPaymentMethodOptionsOptions { UsBankAccount = new InvoicePaymentSettingsPaymentMethodOptionsUsBankAccountOptions { FinancialConnections = new InvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsOptions { Permissions = new List { "transactions", "payment_method" }, }, }, }, }, }; var service = new InvoiceService(); Invoice invoice = service.Create(options); ``` Code snippet calling post /v1/invoices in dotnet (service-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new InvoiceCreateOptions { Customer = "{{CUSTOMER_ID}}", PaymentSettings = new InvoicePaymentSettingsOptions { PaymentMethodTypes = new List { "us_bank_account" }, PaymentMethodOptions = new InvoicePaymentSettingsPaymentMethodOptionsOptions { UsBankAccount = new InvoicePaymentSettingsPaymentMethodOptionsUsBankAccountOptions { FinancialConnections = new InvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsOptions { Permissions = new List { "transactions", "payment_method" }, }, }, }, }, }; var client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); var service = client.V1.Invoices; Invoice invoice = service.Create(options); ``` #### Subscriptions Code snippet calling post /v1/subscriptions in curl (resource-based pattern). ```curl curl https://api.stripe.com/v1/subscriptions \ -u "sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \ -d customer={{CUSTOMER_ID}} \ -d "payment_settings[payment_method_types][]"=us_bank_account \ -d "payment_settings[payment_method_options][us_bank_account][financial_connections][permissions][]"=transactions \ -d "payment_settings[payment_method_options][us_bank_account][financial_connections][permissions][]"=payment_method ``` Code snippet calling post /v1/subscriptions in cli (resource-based pattern). ```cli stripe subscriptions create \ --customer={{CUSTOMER_ID}} \ -d "payment_settings[payment_method_types][0]"=us_bank_account \ -d "payment_settings[payment_method_options][us_bank_account][financial_connections][permissions][0]"=transactions \ -d "payment_settings[payment_method_options][us_bank_account][financial_connections][permissions][1]"=payment_method ``` Code snippet calling post /v1/subscriptions in ruby (resource-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys Stripe.api_key = 'sk_test_BQokikJOvBiI2HlWgH4olfQ2' subscription = Stripe::Subscription.create({ customer: '{{CUSTOMER_ID}}', payment_settings: { payment_method_types: ['us_bank_account'], payment_method_options: { us_bank_account: { financial_connections: {permissions: ['transactions', 'payment_method']}, }, }, }, }) ``` Code snippet calling post /v1/subscriptions in ruby (service-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("sk_test_BQokikJOvBiI2HlWgH4olfQ2") subscription = client.v1.subscriptions.create({ customer: '{{CUSTOMER_ID}}', payment_settings: { payment_method_types: ['us_bank_account'], payment_method_options: { us_bank_account: { financial_connections: {permissions: ['transactions', 'payment_method']}, }, }, }, }) ``` Code snippet calling post /v1/subscriptions in python (resource-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys import stripe stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" subscription = stripe.Subscription.create( customer="{{CUSTOMER_ID}}", payment_settings={ "payment_method_types": ["us_bank_account"], "payment_method_options": { "us_bank_account": { "financial_connections": {"permissions": ["transactions", "payment_method"]}, }, }, }, ) ``` Code snippet calling post /v1/subscriptions in python (service-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2") subscription = client.subscriptions.create({ "customer": "{{CUSTOMER_ID}}", "payment_settings": { "payment_method_types": ["us_bank_account"], "payment_method_options": { "us_bank_account": { "financial_connections": {"permissions": ["transactions", "payment_method"]}, }, }, }, }) ``` Code snippet calling post /v1/subscriptions in php (resource-based pattern). ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); $subscription = $stripe->subscriptions->create([ 'customer' => '{{CUSTOMER_ID}}', 'payment_settings' => [ 'payment_method_types' => ['us_bank_account'], 'payment_method_options' => [ 'us_bank_account' => [ 'financial_connections' => ['permissions' => ['transactions', 'payment_method']], ], ], ], ]); ``` Code snippet calling post /v1/subscriptions in java (resource-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; SubscriptionCreateParams params = SubscriptionCreateParams.builder() .setCustomer("{{CUSTOMER_ID}}") .setPaymentSettings( SubscriptionCreateParams.PaymentSettings.builder() .addPaymentMethodType( SubscriptionCreateParams.PaymentSettings.PaymentMethodType.US_BANK_ACCOUNT ) .setPaymentMethodOptions( SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.builder() .setUsBankAccount( SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.builder() .setFinancialConnections( SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.builder() .addPermission( SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission.TRANSACTIONS ) .addPermission( SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission.PAYMENT_METHOD ) .build() ) .build() ) .build() ) .build() ) .build(); Subscription subscription = Subscription.create(params); ``` Code snippet calling post /v1/subscriptions in java (service-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); SubscriptionCreateParams params = SubscriptionCreateParams.builder() .setCustomer("{{CUSTOMER_ID}}") .setPaymentSettings( SubscriptionCreateParams.PaymentSettings.builder() .addPaymentMethodType( SubscriptionCreateParams.PaymentSettings.PaymentMethodType.US_BANK_ACCOUNT ) .setPaymentMethodOptions( SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.builder() .setUsBankAccount( SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.builder() .setFinancialConnections( SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.builder() .addPermission( SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission.TRANSACTIONS ) .addPermission( SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission.PAYMENT_METHOD ) .build() ) .build() ) .build() ) .build() ) .build(); Subscription subscription = client.subscriptions().create(params); ``` Code snippet calling post /v1/subscriptions in node (resource-based pattern). ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); const subscription = await stripe.subscriptions.create({ customer: '{{CUSTOMER_ID}}', payment_settings: { payment_method_types: ['us_bank_account'], payment_method_options: { us_bank_account: { financial_connections: { permissions: ['transactions', 'payment_method'], }, }, }, }, }); ``` Code snippet calling post /v1/subscriptions in go (resource-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys stripe.Key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" params := &stripe.SubscriptionParams{ Customer: stripe.String("{{CUSTOMER_ID}}"), PaymentSettings: &stripe.SubscriptionPaymentSettingsParams{ PaymentMethodTypes: []*string{ stripe.String(stripe.SubscriptionPaymentSettingsPaymentMethodTypeUSBankAccount), }, PaymentMethodOptions: &stripe.SubscriptionPaymentSettingsPaymentMethodOptionsParams{ USBankAccount: &stripe.SubscriptionPaymentSettingsPaymentMethodOptionsUSBankAccountParams{ FinancialConnections: &stripe.SubscriptionPaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsParams{ Permissions: []*string{ stripe.String(stripe.SubscriptionPaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionTransactions), stripe.String(stripe.SubscriptionPaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionPaymentMethod), }, }, }, }, }, }; result, err := subscription.New(params); ``` Code snippet calling post /v1/subscriptions in go (service-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); params := &stripe.SubscriptionCreateParams{ Customer: stripe.String("{{CUSTOMER_ID}}"), PaymentSettings: &stripe.SubscriptionCreatePaymentSettingsParams{ PaymentMethodTypes: []*string{ stripe.String(stripe.SubscriptionPaymentSettingsPaymentMethodTypeUSBankAccount), }, PaymentMethodOptions: &stripe.SubscriptionCreatePaymentSettingsPaymentMethodOptionsParams{ USBankAccount: &stripe.SubscriptionCreatePaymentSettingsPaymentMethodOptionsUSBankAccountParams{ FinancialConnections: &stripe.SubscriptionCreatePaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsParams{ Permissions: []*string{ stripe.String(stripe.SubscriptionPaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionTransactions), stripe.String(stripe.SubscriptionPaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionPaymentMethod), }, }, }, }, }, }; result, err := sc.V1Subscriptions.Create(context.TODO(), params); ``` Code snippet calling post /v1/subscriptions in dotnet (resource-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeConfiguration.ApiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; var options = new SubscriptionCreateOptions { Customer = "{{CUSTOMER_ID}}", PaymentSettings = new SubscriptionPaymentSettingsOptions { PaymentMethodTypes = new List { "us_bank_account" }, PaymentMethodOptions = new SubscriptionPaymentSettingsPaymentMethodOptionsOptions { UsBankAccount = new SubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountOptions { FinancialConnections = new SubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsOptions { Permissions = new List { "transactions", "payment_method" }, }, }, }, }, }; var service = new SubscriptionService(); Subscription subscription = service.Create(options); ``` Code snippet calling post /v1/subscriptions in dotnet (service-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new SubscriptionCreateOptions { Customer = "{{CUSTOMER_ID}}", PaymentSettings = new SubscriptionPaymentSettingsOptions { PaymentMethodTypes = new List { "us_bank_account" }, PaymentMethodOptions = new SubscriptionPaymentSettingsPaymentMethodOptionsOptions { UsBankAccount = new SubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountOptions { FinancialConnections = new SubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsOptions { Permissions = new List { "transactions", "payment_method" }, }, }, }, }, }; var client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); var service = client.V1.Subscriptions; Subscription subscription = service.Create(options); ``` When using dynamic payment methods for certain payments APIs, you can also configure requested permissions in the Dashboard. Learn how to [access additional account data on Financial Connections accounts](https://stripe.com/financial-connections/ach-direct-debit-payments?dashboard-or-api=dashboard#access). ## Subscribe to transaction data [Server-side] When you subscribe to an account’s transaction data, Stripe automatically retrieves new transactions in the background every day and notifies you when they’re available. Subscribing to daily updates is the easiest way to keep the account’s transaction data up to date. To get the Financial Connections Account ID you want to subscribe to transactions for, consult the documentation for our [payments integrations](https://stripe.com/financial-connections/ach-direct-debit-payments#finding-the-financial-connections-account-id) or check the guide for [Financial Connections Sessions](https://stripe.com/financial-connections/other-data-powered-products?platform=web#collect-an-account). Subscribe to transaction data by calling the [subscribe API](https://stripe.com/api/financial_connections/accounts/subscribe): Code snippet calling post /v1/financial_connections/accounts/{account}/subscribe in curl (resource-based pattern). ```curl curl https://api.stripe.com/v1/financial_connections/accounts/{{FINANCIALCONNECTIONSACCOUNT_ID}}/subscribe \ -u "sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \ -d "features[]"=transactions ``` Code snippet calling post /v1/financial_connections/accounts/{account}/subscribe in cli (resource-based pattern). ```cli stripe financial_connections accounts subscribe {{FINANCIALCONNECTIONSACCOUNT_ID}} \ -d "features[0]"=transactions ``` Code snippet calling post /v1/financial_connections/accounts/{account}/subscribe in ruby (resource-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys Stripe.api_key = 'sk_test_BQokikJOvBiI2HlWgH4olfQ2' account = Stripe::FinancialConnections::Account.subscribe( '{{FINANCIALCONNECTIONSACCOUNT_ID}}', {features: ['transactions']}, ) ``` Code snippet calling post /v1/financial_connections/accounts/{account}/subscribe in ruby (service-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("sk_test_BQokikJOvBiI2HlWgH4olfQ2") account = client.v1.financial_connections.accounts.subscribe( '{{FINANCIALCONNECTIONSACCOUNT_ID}}', {features: ['transactions']}, ) ``` Code snippet calling post /v1/financial_connections/accounts/{account}/subscribe in python (resource-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys import stripe stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" account = stripe.financial_connections.Account.subscribe( "{{FINANCIALCONNECTIONSACCOUNT_ID}}", features=["transactions"], ) ``` Code snippet calling post /v1/financial_connections/accounts/{account}/subscribe in python (service-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2") account = client.financial_connections.accounts.subscribe( "{{FINANCIALCONNECTIONSACCOUNT_ID}}", {"features": ["transactions"]}, ) ``` Code snippet calling post /v1/financial_connections/accounts/{account}/subscribe in php (resource-based pattern). ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); $account = $stripe->financialConnections->accounts->subscribe( '{{FINANCIALCONNECTIONSACCOUNT_ID}}', ['features' => ['transactions']] ); ``` Code snippet calling post /v1/financial_connections/accounts/{account}/subscribe in java (resource-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; Account resource = Account.retrieve("{{FINANCIALCONNECTIONSACCOUNT_ID}}"); AccountSubscribeParams params = AccountSubscribeParams.builder() .addFeature(AccountSubscribeParams.Feature.TRANSACTIONS) .build(); Account account = resource.subscribe(params); ``` Code snippet calling post /v1/financial_connections/accounts/{account}/subscribe in java (service-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); AccountSubscribeParams params = AccountSubscribeParams.builder() .addFeature(AccountSubscribeParams.Feature.TRANSACTIONS) .build(); Account account = client.financialConnections().accounts().subscribe( "{{FINANCIALCONNECTIONSACCOUNT_ID}}", params ); ``` Code snippet calling post /v1/financial_connections/accounts/{account}/subscribe in node (resource-based pattern). ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); const account = await stripe.financialConnections.accounts.subscribe( '{{FINANCIALCONNECTIONSACCOUNT_ID}}', { features: ['transactions'], } ); ``` Code snippet calling post /v1/financial_connections/accounts/{account}/subscribe in go (resource-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys stripe.Key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" params := &stripe.FinancialConnectionsAccountSubscribeParams{ Features: []*string{stripe.String("transactions")}, }; result, err := account.Subscribe("{{FINANCIALCONNECTIONSACCOUNT_ID}}", params); ``` Code snippet calling post /v1/financial_connections/accounts/{account}/subscribe in go (service-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); params := &stripe.FinancialConnectionsAccountSubscribeParams{ Features: []*string{stripe.String("transactions")}, Account: stripe.String("{{FINANCIALCONNECTIONSACCOUNT_ID}}"), }; result, err := sc.V1FinancialConnectionsAccounts.Subscribe(context.TODO(), params); ``` Code snippet calling post /v1/financial_connections/accounts/{account}/subscribe in dotnet (resource-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeConfiguration.ApiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; var options = new Stripe.FinancialConnections.AccountSubscribeOptions { Features = new List { "transactions" }, }; var service = new Stripe.FinancialConnections.AccountService(); Stripe.FinancialConnections.Account account = service.Subscribe( "{{FINANCIALCONNECTIONSACCOUNT_ID}}", options); ``` Code snippet calling post /v1/financial_connections/accounts/{account}/subscribe in dotnet (service-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new Stripe.FinancialConnections.AccountSubscribeOptions { Features = new List { "transactions" }, }; var client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); var service = client.V1.FinancialConnections.Accounts; Stripe.FinancialConnections.Account account = service.Subscribe( "{{FINANCIALCONNECTIONSACCOUNT_ID}}", options); ``` Subscriptions aren’t allowed on inactive accounts. In addition to activating a subscription to future transaction data, this API call automatically initiates a transaction refresh: ```json { "id": "fca_1LDYuMGxLVUXRs6HW0lrat9T", "object": "financial_connections.account", "display_name": "Savings", "institution_name": "Test Bank", "status": "active", "permissions": ["transactions"],"subscriptions": ["transactions"], "transaction_refresh": { "id": "fctxnref_1aaaxqEitUZY8Svm4QdcWZKt", "last_attempted_at": 1706742786, "next_refresh_available_at": null, "status": "pending" } // ... } ``` As long as you remain subscribed to transaction data, Stripe initiates a new refresh every day. ### Wait for the refresh to complete All Financial Connections data refreshes are asynchronous. After you initiate a transaction refresh, you must wait for it to complete, then retrieve the resulting transactions. The [transaction_refresh](https://stripe.com/api/financial_connections/accounts/object#financial_connections_account_object-transaction_refresh) field on a Financial Connections account represents the transaction refresh state. This field remains `null` until you request the `transactions` permission and initiate a refresh. After you start a transaction refresh, the state changes to `pending`, and after completion, it moves to either `succeeded` or `failed`. We send the [financial_connections.account.refreshed_transactions](https://stripe.com/api/events/types#event_types-financial_connections.account.refreshed_transactions) event when the transaction refresh completes. To determine the success of the refresh, check the `transaction_refresh.status` field while handling the webhook. ## Retrieve transactions [Server-side] After Stripe successfully refreshes transactions on the account, you can retrieve them using the [transactions list API](https://stripe.com/api/financial_connections/transactions/list): Code snippet calling get /v1/financial_connections/transactions in curl (resource-based pattern). ```curl curl -G https://api.stripe.com/v1/financial_connections/transactions \ -u "sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \ -d account="{{FINANCIALCONNECTIONSACCOUNT_ID}}" ``` Code snippet calling get /v1/financial_connections/transactions in cli (resource-based pattern). ```cli stripe financial_connections transactions list \ --account="{{FINANCIALCONNECTIONSACCOUNT_ID}}" ``` Code snippet calling get /v1/financial_connections/transactions in ruby (resource-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys Stripe.api_key = 'sk_test_BQokikJOvBiI2HlWgH4olfQ2' transactions = Stripe::FinancialConnections::Transaction.list({ account: '{{FINANCIALCONNECTIONSACCOUNT_ID}}', }) ``` Code snippet calling get /v1/financial_connections/transactions in ruby (service-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("sk_test_BQokikJOvBiI2HlWgH4olfQ2") transactions = client.v1.financial_connections.transactions.list({ account: '{{FINANCIALCONNECTIONSACCOUNT_ID}}', }) ``` Code snippet calling get /v1/financial_connections/transactions in python (resource-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys import stripe stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" transactions = stripe.financial_connections.Transaction.list( account="{{FINANCIALCONNECTIONSACCOUNT_ID}}", ) ``` Code snippet calling get /v1/financial_connections/transactions in python (service-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2") transactions = client.financial_connections.transactions.list({ "account": "{{FINANCIALCONNECTIONSACCOUNT_ID}}", }) ``` Code snippet calling get /v1/financial_connections/transactions in php (resource-based pattern). ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); $transactions = $stripe->financialConnections->transactions->all([ 'account' => '{{FINANCIALCONNECTIONSACCOUNT_ID}}', ]); ``` Code snippet calling get /v1/financial_connections/transactions in java (resource-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; TransactionListParams params = TransactionListParams.builder() .setAccount("{{FINANCIALCONNECTIONSACCOUNT_ID}}") .build(); TransactionCollection transactions = Transaction.list(params); ``` Code snippet calling get /v1/financial_connections/transactions in java (service-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); TransactionListParams params = TransactionListParams.builder() .setAccount("{{FINANCIALCONNECTIONSACCOUNT_ID}}") .build(); StripeCollection stripeCollection = client.financialConnections().transactions().list(params); ``` Code snippet calling get /v1/financial_connections/transactions in node (resource-based pattern). ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); const transactions = await stripe.financialConnections.transactions.list({ account: '{{FINANCIALCONNECTIONSACCOUNT_ID}}', }); ``` Code snippet calling get /v1/financial_connections/transactions in go (resource-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys stripe.Key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" params := &stripe.FinancialConnectionsTransactionListParams{ Account: stripe.String("{{FINANCIALCONNECTIONSACCOUNT_ID}}"), }; result := transaction.List(params); ``` Code snippet calling get /v1/financial_connections/transactions in go (service-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); params := &stripe.FinancialConnectionsTransactionListParams{ Account: stripe.String("{{FINANCIALCONNECTIONSACCOUNT_ID}}"), }; result := sc.V1FinancialConnectionsTransactions.List(context.TODO(), params); ``` Code snippet calling get /v1/financial_connections/transactions in dotnet (resource-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeConfiguration.ApiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; var options = new Stripe.FinancialConnections.TransactionListOptions { Account = "{{FINANCIALCONNECTIONSACCOUNT_ID}}", }; var service = new Stripe.FinancialConnections.TransactionService(); StripeList transactions = service.List(options); ``` Code snippet calling get /v1/financial_connections/transactions in dotnet (service-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new Stripe.FinancialConnections.TransactionListOptions { Account = "{{FINANCIALCONNECTIONSACCOUNT_ID}}", }; var client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); var service = client.V1.FinancialConnections.Transactions; StripeList transactions = service.List(options); ``` Stripe returns a [paginated](https://stripe.com/api/pagination) list of up to the last 180 days of transaction history on an account, depending on the account’s financial institution. ```json { "object": "list", "data": [ { "id": "fctxn_1LXp9RGxLVUXRs6HtTSVfxse", "object": "financial_connections.transaction", "account": "fca_1LDYuMGxLVUXRs6HW0lrat9T", "amount": -1000, "currency": "usd", "description": "Rocket Rides", "livemode": true, "status": "posted", "status_transitions": { "posted_at": 1651784999, "void_at": null }, "transacted_at": 1651784999, "transaction_refresh": "fctxnref_1LXp8WGxLVUXRs6Hkc5PNUXf", "updated": 1651784999 }, {...}, {...} ], "has_more": false, "url": "/v1/financial_connections/transactions" } ``` The [status](https://stripe.com/api/financial_connections/transactions/object#financial_connections_transaction_object-status) of a transaction is one of `pending`, `posted`, or `void`. Information included in the [description](https://stripe.com/api/financial_connections/transactions/object#financial_connections_transaction_object-description) field varies, but can include metadata such as the business name. ### Retrieving transactions since last refresh You might wish to retrieve only new transaction data since your last data pull. For example, some users save previously retrieved transaction data to their database, and subsequently merge new or updated data as it becomes available. To retrieve only new or updated transaction data since your last refresh, pass the `transaction_refresh` identifier provided by your last observed [financial_connections.account.refreshed_transactions](https://stripe.com/api/events/types#event_types-financial_connections.account.refreshed_transactions) webhook event object to the list API: Code snippet calling get /v1/financial_connections/transactions in curl (resource-based pattern). ```curl curl -G https://api.stripe.com/v1/financial_connections/transactions \ -u "sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \ -d account="{{FINANCIALCONNECTIONSACCOUNT_ID}}" \ -d "transaction_refresh[after]"=fctxnref_1LXp8WGxLVUXRs6Hkc5PNUXf ``` Code snippet calling get /v1/financial_connections/transactions in cli (resource-based pattern). ```cli stripe financial_connections transactions list \ --account="{{FINANCIALCONNECTIONSACCOUNT_ID}}" \ -d "transaction_refresh[after]"=fctxnref_1LXp8WGxLVUXRs6Hkc5PNUXf ``` Code snippet calling get /v1/financial_connections/transactions in ruby (resource-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys Stripe.api_key = 'sk_test_BQokikJOvBiI2HlWgH4olfQ2' transactions = Stripe::FinancialConnections::Transaction.list({ account: '{{FINANCIALCONNECTIONSACCOUNT_ID}}', transaction_refresh: {after: 'fctxnref_1LXp8WGxLVUXRs6Hkc5PNUXf'}, }) ``` Code snippet calling get /v1/financial_connections/transactions in ruby (service-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("sk_test_BQokikJOvBiI2HlWgH4olfQ2") transactions = client.v1.financial_connections.transactions.list({ account: '{{FINANCIALCONNECTIONSACCOUNT_ID}}', transaction_refresh: {after: 'fctxnref_1LXp8WGxLVUXRs6Hkc5PNUXf'}, }) ``` Code snippet calling get /v1/financial_connections/transactions in python (resource-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys import stripe stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" transactions = stripe.financial_connections.Transaction.list( account="{{FINANCIALCONNECTIONSACCOUNT_ID}}", transaction_refresh={"after": "fctxnref_1LXp8WGxLVUXRs6Hkc5PNUXf"}, ) ``` Code snippet calling get /v1/financial_connections/transactions in python (service-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2") transactions = client.financial_connections.transactions.list({ "account": "{{FINANCIALCONNECTIONSACCOUNT_ID}}", "transaction_refresh": {"after": "fctxnref_1LXp8WGxLVUXRs6Hkc5PNUXf"}, }) ``` Code snippet calling get /v1/financial_connections/transactions in php (resource-based pattern). ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); $transactions = $stripe->financialConnections->transactions->all([ 'account' => '{{FINANCIALCONNECTIONSACCOUNT_ID}}', 'transaction_refresh' => ['after' => 'fctxnref_1LXp8WGxLVUXRs6Hkc5PNUXf'], ]); ``` Code snippet calling get /v1/financial_connections/transactions in java (resource-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; TransactionListParams params = TransactionListParams.builder() .setAccount("{{FINANCIALCONNECTIONSACCOUNT_ID}}") .setTransactionRefresh( TransactionListParams.TransactionRefresh.builder() .setAfter("fctxnref_1LXp8WGxLVUXRs6Hkc5PNUXf") .build() ) .build(); TransactionCollection transactions = Transaction.list(params); ``` Code snippet calling get /v1/financial_connections/transactions in java (service-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); TransactionListParams params = TransactionListParams.builder() .setAccount("{{FINANCIALCONNECTIONSACCOUNT_ID}}") .setTransactionRefresh( TransactionListParams.TransactionRefresh.builder() .setAfter("fctxnref_1LXp8WGxLVUXRs6Hkc5PNUXf") .build() ) .build(); StripeCollection stripeCollection = client.financialConnections().transactions().list(params); ``` Code snippet calling get /v1/financial_connections/transactions in node (resource-based pattern). ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); const transactions = await stripe.financialConnections.transactions.list({ account: '{{FINANCIALCONNECTIONSACCOUNT_ID}}', transaction_refresh: { after: 'fctxnref_1LXp8WGxLVUXRs6Hkc5PNUXf', }, }); ``` Code snippet calling get /v1/financial_connections/transactions in go (resource-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys stripe.Key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" params := &stripe.FinancialConnectionsTransactionListParams{ Account: stripe.String("{{FINANCIALCONNECTIONSACCOUNT_ID}}"), TransactionRefresh: &stripe.FinancialConnectionsTransactionListTransactionRefreshParams{ After: stripe.String("fctxnref_1LXp8WGxLVUXRs6Hkc5PNUXf"), }, }; result := transaction.List(params); ``` Code snippet calling get /v1/financial_connections/transactions in go (service-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); params := &stripe.FinancialConnectionsTransactionListParams{ Account: stripe.String("{{FINANCIALCONNECTIONSACCOUNT_ID}}"), TransactionRefresh: &stripe.FinancialConnectionsTransactionListTransactionRefreshParams{ After: stripe.String("fctxnref_1LXp8WGxLVUXRs6Hkc5PNUXf"), }, }; result := sc.V1FinancialConnectionsTransactions.List(context.TODO(), params); ``` Code snippet calling get /v1/financial_connections/transactions in dotnet (resource-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeConfiguration.ApiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; var options = new Stripe.FinancialConnections.TransactionListOptions { Account = "{{FINANCIALCONNECTIONSACCOUNT_ID}}", TransactionRefresh = new Stripe.FinancialConnections.TransactionTransactionRefreshOptions { After = "fctxnref_1LXp8WGxLVUXRs6Hkc5PNUXf", }, }; var service = new Stripe.FinancialConnections.TransactionService(); StripeList transactions = service.List(options); ``` Code snippet calling get /v1/financial_connections/transactions in dotnet (service-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new Stripe.FinancialConnections.TransactionListOptions { Account = "{{FINANCIALCONNECTIONSACCOUNT_ID}}", TransactionRefresh = new Stripe.FinancialConnections.TransactionTransactionRefreshOptions { After = "fctxnref_1LXp8WGxLVUXRs6Hkc5PNUXf", }, }; var client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); var service = client.V1.FinancialConnections.Transactions; StripeList transactions = service.List(options); ``` The following is an example [webhook](https://stripe.com/webhooks#webhook-endpoint-def) integration that only retrieves and records new or updated transaction data: ## Optional: Unsubscribe from transaction data You can start, cancel, and resume a subscription at any point. To cancel a subscription, call the [unsubscribe API](https://stripe.com/api/financial_connections/accounts/unsubscribe): Code snippet calling post /v1/financial_connections/accounts/{account}/unsubscribe in curl (resource-based pattern). ```curl curl https://api.stripe.com/v1/financial_connections/accounts/{{FINANCIALCONNECTIONSACCOUNT_ID}}/unsubscribe \ -u "sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \ -d "features[]"=transactions ``` Code snippet calling post /v1/financial_connections/accounts/{account}/unsubscribe in cli (resource-based pattern). ```cli stripe financial_connections accounts unsubscribe {{FINANCIALCONNECTIONSACCOUNT_ID}} \ -d "features[0]"=transactions ``` Code snippet calling post /v1/financial_connections/accounts/{account}/unsubscribe in ruby (resource-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys Stripe.api_key = 'sk_test_BQokikJOvBiI2HlWgH4olfQ2' account = Stripe::FinancialConnections::Account.unsubscribe( '{{FINANCIALCONNECTIONSACCOUNT_ID}}', {features: ['transactions']}, ) ``` Code snippet calling post /v1/financial_connections/accounts/{account}/unsubscribe in ruby (service-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("sk_test_BQokikJOvBiI2HlWgH4olfQ2") account = client.v1.financial_connections.accounts.unsubscribe( '{{FINANCIALCONNECTIONSACCOUNT_ID}}', {features: ['transactions']}, ) ``` Code snippet calling post /v1/financial_connections/accounts/{account}/unsubscribe in python (resource-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys import stripe stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" account = stripe.financial_connections.Account.unsubscribe( "{{FINANCIALCONNECTIONSACCOUNT_ID}}", features=["transactions"], ) ``` Code snippet calling post /v1/financial_connections/accounts/{account}/unsubscribe in python (service-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2") account = client.financial_connections.accounts.unsubscribe( "{{FINANCIALCONNECTIONSACCOUNT_ID}}", {"features": ["transactions"]}, ) ``` Code snippet calling post /v1/financial_connections/accounts/{account}/unsubscribe in php (resource-based pattern). ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); $account = $stripe->financialConnections->accounts->unsubscribe( '{{FINANCIALCONNECTIONSACCOUNT_ID}}', ['features' => ['transactions']] ); ``` Code snippet calling post /v1/financial_connections/accounts/{account}/unsubscribe in java (resource-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; Account resource = Account.retrieve("{{FINANCIALCONNECTIONSACCOUNT_ID}}"); AccountUnsubscribeParams params = AccountUnsubscribeParams.builder() .addFeature(AccountUnsubscribeParams.Feature.TRANSACTIONS) .build(); Account account = resource.unsubscribe(params); ``` Code snippet calling post /v1/financial_connections/accounts/{account}/unsubscribe in java (service-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); AccountUnsubscribeParams params = AccountUnsubscribeParams.builder() .addFeature(AccountUnsubscribeParams.Feature.TRANSACTIONS) .build(); Account account = client.financialConnections().accounts().unsubscribe( "{{FINANCIALCONNECTIONSACCOUNT_ID}}", params ); ``` Code snippet calling post /v1/financial_connections/accounts/{account}/unsubscribe in node (resource-based pattern). ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); const account = await stripe.financialConnections.accounts.unsubscribe( '{{FINANCIALCONNECTIONSACCOUNT_ID}}', { features: ['transactions'], } ); ``` Code snippet calling post /v1/financial_connections/accounts/{account}/unsubscribe in go (resource-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys stripe.Key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" params := &stripe.FinancialConnectionsAccountUnsubscribeParams{ Features: []*string{stripe.String("transactions")}, }; result, err := account.Unsubscribe("{{FINANCIALCONNECTIONSACCOUNT_ID}}", params); ``` Code snippet calling post /v1/financial_connections/accounts/{account}/unsubscribe in go (service-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); params := &stripe.FinancialConnectionsAccountUnsubscribeParams{ Features: []*string{stripe.String("transactions")}, Account: stripe.String("{{FINANCIALCONNECTIONSACCOUNT_ID}}"), }; result, err := sc.V1FinancialConnectionsAccounts.Unsubscribe(context.TODO(), params); ``` Code snippet calling post /v1/financial_connections/accounts/{account}/unsubscribe in dotnet (resource-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeConfiguration.ApiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; var options = new Stripe.FinancialConnections.AccountUnsubscribeOptions { Features = new List { "transactions" }, }; var service = new Stripe.FinancialConnections.AccountService(); Stripe.FinancialConnections.Account account = service.Unsubscribe( "{{FINANCIALCONNECTIONSACCOUNT_ID}}", options); ``` Code snippet calling post /v1/financial_connections/accounts/{account}/unsubscribe in dotnet (service-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new Stripe.FinancialConnections.AccountUnsubscribeOptions { Features = new List { "transactions" }, }; var client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); var service = client.V1.FinancialConnections.Accounts; Stripe.FinancialConnections.Account account = service.Unsubscribe( "{{FINANCIALCONNECTIONSACCOUNT_ID}}", options); ``` To resume the subscription, call the [subscribe API](https://stripe.com/api/financial_connections/accounts/subscribe) again. ## Optional: Refresh transactions on demand There are two alternatives to [subscribing](#subscribe-to-transactions) to daily updates: prefetching transaction data and on-demand refreshes. You might use these methods if you only want a one-time transaction data pull for a use case like underwriting. These methods are not mutually exclusive with maintaining a subscription, but most financial institutions don’t update transactions multiple times per day. ### Prefetch transaction data Specify whether you want to prefetch account transactions *before* account collection. This initiates the refresh process as soon as your user connects their account in the [authentication flow](https://stripe.com/financial-connections/fundamentals#authentication-flow). Set `prefetch` when you require transaction data for every linked account, to make sure you receive it with minimal delay. The `prefetch` parameter is available on all APIs that support Financial Connections. Code snippet calling post /v1/payment_intents in curl (resource-based pattern). ```curl curl https://api.stripe.com/v1/payment_intents \ -u "sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \ -d amount=20000 \ -d currency=usd \ -d "payment_method_types[]"=us_bank_account \ -d "payment_method_options[us_bank_account][financial_connections][prefetch][]"=transactions \ -d "payment_method_options[us_bank_account][financial_connections][permissions][]"=payment_method \ -d "payment_method_options[us_bank_account][financial_connections][permissions][]"=transactions ``` Code snippet calling post /v1/payment_intents in cli (resource-based pattern). ```cli stripe payment_intents create \ --amount=20000 \ --currency=usd \ -d "payment_method_types[0]"=us_bank_account \ -d "payment_method_options[us_bank_account][financial_connections][prefetch][0]"=transactions \ -d "payment_method_options[us_bank_account][financial_connections][permissions][0]"=payment_method \ -d "payment_method_options[us_bank_account][financial_connections][permissions][1]"=transactions ``` Code snippet calling post /v1/payment_intents in ruby (resource-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys Stripe.api_key = 'sk_test_BQokikJOvBiI2HlWgH4olfQ2' payment_intent = Stripe::PaymentIntent.create({ amount: 20000, currency: 'usd', payment_method_types: ['us_bank_account'], payment_method_options: { us_bank_account: { financial_connections: { prefetch: ['transactions'], permissions: ['payment_method', 'transactions'], }, }, }, }) ``` Code snippet calling post /v1/payment_intents in ruby (service-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("sk_test_BQokikJOvBiI2HlWgH4olfQ2") payment_intent = client.v1.payment_intents.create({ amount: 20000, currency: 'usd', payment_method_types: ['us_bank_account'], payment_method_options: { us_bank_account: { financial_connections: { prefetch: ['transactions'], permissions: ['payment_method', 'transactions'], }, }, }, }) ``` Code snippet calling post /v1/payment_intents in python (resource-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys import stripe stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" payment_intent = stripe.PaymentIntent.create( amount=20000, currency="usd", payment_method_types=["us_bank_account"], payment_method_options={ "us_bank_account": { "financial_connections": { "prefetch": ["transactions"], "permissions": ["payment_method", "transactions"], }, }, }, ) ``` Code snippet calling post /v1/payment_intents in python (service-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2") payment_intent = client.payment_intents.create({ "amount": 20000, "currency": "usd", "payment_method_types": ["us_bank_account"], "payment_method_options": { "us_bank_account": { "financial_connections": { "prefetch": ["transactions"], "permissions": ["payment_method", "transactions"], }, }, }, }) ``` Code snippet calling post /v1/payment_intents in php (resource-based pattern). ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); $paymentIntent = $stripe->paymentIntents->create([ 'amount' => 20000, 'currency' => 'usd', 'payment_method_types' => ['us_bank_account'], 'payment_method_options' => [ 'us_bank_account' => [ 'financial_connections' => [ 'prefetch' => ['transactions'], 'permissions' => ['payment_method', 'transactions'], ], ], ], ]); ``` Code snippet calling post /v1/payment_intents in java (resource-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; PaymentIntentCreateParams params = PaymentIntentCreateParams.builder() .setAmount(20000L) .setCurrency("usd") .addPaymentMethodType("us_bank_account") .setPaymentMethodOptions( PaymentIntentCreateParams.PaymentMethodOptions.builder() .setUsBankAccount( PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.builder() .setFinancialConnections( PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.builder() .addPrefetch( PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Prefetch.TRANSACTIONS ) .addPermission( PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission.PAYMENT_METHOD ) .addPermission( PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission.TRANSACTIONS ) .build() ) .build() ) .build() ) .build(); PaymentIntent paymentIntent = PaymentIntent.create(params); ``` Code snippet calling post /v1/payment_intents in java (service-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); PaymentIntentCreateParams params = PaymentIntentCreateParams.builder() .setAmount(20000L) .setCurrency("usd") .addPaymentMethodType("us_bank_account") .setPaymentMethodOptions( PaymentIntentCreateParams.PaymentMethodOptions.builder() .setUsBankAccount( PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.builder() .setFinancialConnections( PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.builder() .addPrefetch( PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Prefetch.TRANSACTIONS ) .addPermission( PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission.PAYMENT_METHOD ) .addPermission( PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission.TRANSACTIONS ) .build() ) .build() ) .build() ) .build(); PaymentIntent paymentIntent = client.paymentIntents().create(params); ``` Code snippet calling post /v1/payment_intents in node (resource-based pattern). ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); const paymentIntent = await stripe.paymentIntents.create({ amount: 20000, currency: 'usd', payment_method_types: ['us_bank_account'], payment_method_options: { us_bank_account: { financial_connections: { prefetch: ['transactions'], permissions: ['payment_method', 'transactions'], }, }, }, }); ``` Code snippet calling post /v1/payment_intents in go (resource-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys stripe.Key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" params := &stripe.PaymentIntentParams{ Amount: stripe.Int64(20000), Currency: stripe.String(stripe.CurrencyUSD), PaymentMethodTypes: []*string{stripe.String("us_bank_account")}, PaymentMethodOptions: &stripe.PaymentIntentPaymentMethodOptionsParams{ USBankAccount: &stripe.PaymentIntentPaymentMethodOptionsUSBankAccountParams{ FinancialConnections: &stripe.PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsParams{ Prefetch: []*string{ stripe.String(stripe.PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetchTransactions), }, Permissions: []*string{ stripe.String(stripe.PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionPaymentMethod), stripe.String(stripe.PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionTransactions), }, }, }, }, }; result, err := paymentintent.New(params); ``` Code snippet calling post /v1/payment_intents in go (service-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); params := &stripe.PaymentIntentCreateParams{ Amount: stripe.Int64(20000), Currency: stripe.String(stripe.CurrencyUSD), PaymentMethodTypes: []*string{stripe.String("us_bank_account")}, PaymentMethodOptions: &stripe.PaymentIntentCreatePaymentMethodOptionsParams{ USBankAccount: &stripe.PaymentIntentCreatePaymentMethodOptionsUSBankAccountParams{ FinancialConnections: &stripe.PaymentIntentCreatePaymentMethodOptionsUSBankAccountFinancialConnectionsParams{ Prefetch: []*string{ stripe.String(stripe.PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetchTransactions), }, Permissions: []*string{ stripe.String(stripe.PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionPaymentMethod), stripe.String(stripe.PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionTransactions), }, }, }, }, }; result, err := sc.V1PaymentIntents.Create(context.TODO(), params); ``` Code snippet calling post /v1/payment_intents in dotnet (resource-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeConfiguration.ApiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; var options = new PaymentIntentCreateOptions { Amount = 20000, Currency = "usd", PaymentMethodTypes = new List { "us_bank_account" }, PaymentMethodOptions = new PaymentIntentPaymentMethodOptionsOptions { UsBankAccount = new PaymentIntentPaymentMethodOptionsUsBankAccountOptions { FinancialConnections = new PaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsOptions { Prefetch = new List { "transactions" }, Permissions = new List { "payment_method", "transactions" }, }, }, }, }; var service = new PaymentIntentService(); PaymentIntent paymentIntent = service.Create(options); ``` Code snippet calling post /v1/payment_intents in dotnet (service-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new PaymentIntentCreateOptions { Amount = 20000, Currency = "usd", PaymentMethodTypes = new List { "us_bank_account" }, PaymentMethodOptions = new PaymentIntentPaymentMethodOptionsOptions { UsBankAccount = new PaymentIntentPaymentMethodOptionsUsBankAccountOptions { FinancialConnections = new PaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsOptions { Prefetch = new List { "transactions" }, Permissions = new List { "payment_method", "transactions" }, }, }, }, }; var client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); var service = client.V1.PaymentIntents; PaymentIntent paymentIntent = service.Create(options); ``` After initiating a transaction refresh using `prefetch`, [wait for it to complete](#wait-for-completion). ### Initiate an on-demand refresh Use the [Refresh API](https://stripe.com/api/financial_connections/accounts/refresh) to initiate on-demand transaction refreshes *after* account collection, and fetch transaction information for a specific account at your convenience, allowing you to defer the decision until a later time. Code snippet calling post /v1/financial_connections/accounts/{account}/refresh in curl (resource-based pattern). ```curl curl https://api.stripe.com/v1/financial_connections/accounts/{{FINANCIALCONNECTIONSACCOUNT_ID}}/refresh \ -u "sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \ -d "features[]"=transactions ``` Code snippet calling post /v1/financial_connections/accounts/{account}/refresh in cli (resource-based pattern). ```cli stripe financial_connections accounts refresh {{FINANCIALCONNECTIONSACCOUNT_ID}} \ -d "features[0]"=transactions ``` Code snippet calling post /v1/financial_connections/accounts/{account}/refresh in ruby (resource-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys Stripe.api_key = 'sk_test_BQokikJOvBiI2HlWgH4olfQ2' account = Stripe::FinancialConnections::Account.refresh_account( '{{FINANCIALCONNECTIONSACCOUNT_ID}}', {features: ['transactions']}, ) ``` Code snippet calling post /v1/financial_connections/accounts/{account}/refresh in ruby (service-based pattern). ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("sk_test_BQokikJOvBiI2HlWgH4olfQ2") account = client.v1.financial_connections.accounts.refresh( '{{FINANCIALCONNECTIONSACCOUNT_ID}}', {features: ['transactions']}, ) ``` Code snippet calling post /v1/financial_connections/accounts/{account}/refresh in python (resource-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys import stripe stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" account = stripe.financial_connections.Account.refresh_account( "{{FINANCIALCONNECTIONSACCOUNT_ID}}", features=["transactions"], ) ``` Code snippet calling post /v1/financial_connections/accounts/{account}/refresh in python (service-based pattern). ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2") account = client.financial_connections.accounts.refresh( "{{FINANCIALCONNECTIONSACCOUNT_ID}}", {"features": ["transactions"]}, ) ``` Code snippet calling post /v1/financial_connections/accounts/{account}/refresh in php (resource-based pattern). ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); $account = $stripe->financialConnections->accounts->refresh( '{{FINANCIALCONNECTIONSACCOUNT_ID}}', ['features' => ['transactions']] ); ``` Code snippet calling post /v1/financial_connections/accounts/{account}/refresh in java (resource-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; Account resource = Account.retrieve("{{FINANCIALCONNECTIONSACCOUNT_ID}}"); AccountRefreshParams params = AccountRefreshParams.builder() .addFeature(AccountRefreshParams.Feature.TRANSACTIONS) .build(); Account account = resource.refresh(params); ``` Code snippet calling post /v1/financial_connections/accounts/{account}/refresh in java (service-based pattern). ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); AccountRefreshParams params = AccountRefreshParams.builder() .addFeature(AccountRefreshParams.Feature.TRANSACTIONS) .build(); Account account = client.financialConnections().accounts().refresh( "{{FINANCIALCONNECTIONSACCOUNT_ID}}", params ); ``` Code snippet calling post /v1/financial_connections/accounts/{account}/refresh in node (resource-based pattern). ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); const account = await stripe.financialConnections.accounts.refresh( '{{FINANCIALCONNECTIONSACCOUNT_ID}}', { features: ['transactions'], } ); ``` Code snippet calling post /v1/financial_connections/accounts/{account}/refresh in go (resource-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys stripe.Key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2" params := &stripe.FinancialConnectionsAccountRefreshParams{ Features: []*string{stripe.String("transactions")}, }; result, err := account.Refresh("{{FINANCIALCONNECTIONSACCOUNT_ID}}", params); ``` Code snippet calling post /v1/financial_connections/accounts/{account}/refresh in go (service-based pattern). ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); params := &stripe.FinancialConnectionsAccountRefreshParams{ Features: []*string{stripe.String("transactions")}, Account: stripe.String("{{FINANCIALCONNECTIONSACCOUNT_ID}}"), }; result, err := sc.V1FinancialConnectionsAccounts.Refresh(context.TODO(), params); ``` Code snippet calling post /v1/financial_connections/accounts/{account}/refresh in dotnet (resource-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeConfiguration.ApiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"; var options = new Stripe.FinancialConnections.AccountRefreshOptions { Features = new List { "transactions" }, }; var service = new Stripe.FinancialConnections.AccountService(); Stripe.FinancialConnections.Account account = service.Refresh( "{{FINANCIALCONNECTIONSACCOUNT_ID}}", options); ``` Code snippet calling post /v1/financial_connections/accounts/{account}/refresh in dotnet (service-based pattern). ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new Stripe.FinancialConnections.AccountRefreshOptions { Features = new List { "transactions" }, }; var client = new StripeClient("sk_test_BQokikJOvBiI2HlWgH4olfQ2"); var service = client.V1.FinancialConnections.Accounts; Stripe.FinancialConnections.Account account = service.Refresh( "{{FINANCIALCONNECTIONSACCOUNT_ID}}", options); ``` Refreshes aren’t allowed on inactive accounts. After initiating a transaction refresh using the Refresh API, [wait for it to complete](#wait-for-completion). After a transaction refresh completes, Stripe sets the availability of future refreshes through the [transaction_refresh.next_refresh_available_at](https://stripe.com/api/financial_connections/accounts/object#financial_connections_account_object-transaction_refresh-next_refresh_available_at) field. Check this field before initiating a new transaction refresh to make sure that refreshes are currently available. If you attempt a refresh while the value is `null` (as is always the case when the refresh is pending or the account is inactive) or the current time is less than the `next_refresh_available_at` timestamp, the refresh won’t be initiated. In the unlikely event that a refresh fails, the `error` field on the refresh hash is a preview feature that provides the cause of the failure and recommended next steps. If you’d like to use it, [email us](mailto:financial-connections-beta+refresh-error@stripe.com) for access.