New in Chargebee: Explore Reveal and understand your payment performance end-to-end.Try Now
Docschargebee docs
HomeBillingPaymentsRevRecGrowthReveal
Support

Product Updates


  • Release Notes

Payment Methods


  • Payment Methods Overview
  • Cards
  • Direct Debit
  • Bank Based Payments
  • Wallets
  • Vouchers
  • Articles and FAQ

Payment Gateways and Configuration


  • Payment Gateways Overview
  • Chargebee Test Gateway
  • Stripe
  • PayPal Payment Services
  • Chargebee Pay
  • Adyen
  • Authorize.net
  • Bambora (formerly Beanstream)
  • Bank of America
  • BluePay
  • BlueSnap
  • Braintree
  • Checkout.com
  • CyberSource
  • dLocal
  • EBANX
  • Ecentric
  • Elavon
  • E-xact Direct Integration
  • eWay Rapid
  • Global Payments
  • GoCardless
  • J.P. Morgan Mobility Payment Solutions
  • Metrics Global
  • Mollie
  • Moneris
  • Network Merchants Incorporated (NMI)
  • Nuvei
  • Orbital (Chase Paymentech)
  • Pay.com
  • Paymill
  • Paystack
  • Pin Payments
  • QuickBooks Payments
  • Razorpay
  • Sage Pay
  • Solidgate
  • Tempus
  • Twikey
  • Windcave
  • Worldline Online Payments(formerly Ingenico)
  • Worldpay
  • Articles and FAQ

Level 2/3 Data Support


  • Level 2/3 Data Support

Payment Optimization Engine


  • Overview
  • Defaults
  • Advanced Setup
  • Payment Method Display Rules
  • Verification Rules
  • Routing Rules

Dunning


  • Dunning
  • Articles and FAQ

Offline Checkout


  • Offline Checkout
  • Articles and FAQ

Transaction Sync & Invoice Mapping


  • Transaction Sync and Invoice Mapping

Fraud Management


  • Fraud Management

Error Handling


  • Errors with Root Cause and Troubleshooting

Payment Lifecycle Logs


  • Payment Intents
  • Transactions
  • Gateway Activity Logs
  • Gateway Webhook Logs
  • Articles and FAQ

Others


  • Reach (Merchant of Record)
  • Bulk Deletion of Payment Methods
  • Custom Payment Methods
  • Payment Initiator Parameter
  • PSD2 and Strong Customer Authentication
  • RBI e-Mandate
  • RBI Tokenization Regulations
  • Chargeback Management
  • Transaction Descriptors
  • Payment Preferences
  • Visa Trial Rules
  • Mastercard Trial Rules
  • Co-badged Card Compliance
  • Articles and FAQ
  1. Payments
  2. Payment Gateways and Configuration
  3. Articles and FAQ
  4. Stripe
  1. Payments
  2. Payment Gateways and Configuration
  3. Articles and FAQ
  4. Stripe

Creating BACS and BECS bank account payment sources via Chargebee API

Problem Statement

You want to create BACS or BECS bank account payment sources via Stripe using Chargebee's API, but the request fails with parameter or direct debit errors.

Common errors include:

  • Direct debit is not supported for this customer.
  • bank_account[routing_number] must be a 9-digit number.
  • Problem while adding the payment method. Error message : Missing required param: billing_details[address].

Solution

Use the Create a bank account payment source API and pass the bank account details with bank_account[billing_address]. For BACS and BECS via Stripe, the billing address JSON is mandatory because Stripe requires billing_details[address] for these direct debit payment methods.

Before creating the payment source, ensure the following:

  • BACS or BECS is enabled for Stripe in Chargebee and in your Stripe account.
  • The customer is eligible for direct debit.
  • The customer's preferred currency matches the direct debit scheme:
    • BACS: GBP
    • BECS: AUD
  • The bank account country matches the scheme:
    • BACS: GB
    • BECS: AU

Sample cURL for BACS via Stripe

Use this sample to create a BACS bank account payment source. Replace the placeholders with your site, API key, customer ID, and gateway account ID.

curl https://{site-name}.chargebee.com/api/v2/payment_sources/create_bank_account \
  -u {full-access-api-key}: \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "customer_id=16CLJEUoFmGvL87" \
  --data-urlencode "bank_account[gateway_account_id]=gw_AzqdxDSfmVXNv2PU" \
  --data-urlencode "bank_account[account_number]=00012345" \
  --data-urlencode "bank_account[routing_number]=108800" \
  --data-urlencode "bank_account[bank_name]=Stripe Test Bank" \
  --data-urlencode "bank_account[account_holder_type]=individual" \
  --data-urlencode "bank_account[account_type]=savings" \
  --data-urlencode "bank_account[first_name]=David" \
  --data-urlencode "bank_account[last_name]=Archer" \
  --data-urlencode "issuing_country=GB" \
  --data-urlencode "bank_account[company]=Chargebee" \
  --data-urlencode "bank_account[email]=test@example.com" \
  --data-urlencode "bank_account[billing_address]={\"first_name\":\"John\",\"last_name\":\"Doe\",\"line1\":\"49 Featherstone Street\",\"line2\":\"Suite 45\",\"country_code\":\"GB\",\"city\":\"London\",\"postal_code\":\"EC1Y 8SY\",\"email\":\"john.doe@example.com\"}"

Sample cURL for BECS via Stripe

Use this sample to create a BECS bank account payment source. Replace the placeholders with your site, API key, customer ID, and gateway account ID.

curl https://{site-name}.chargebee.com/api/v2/payment_sources/create_bank_account \
  -u {full-access-api-key}: \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "customer_id=16CLJEUoFok58dV" \
  --data-urlencode "bank_account[gateway_account_id]=gw_AzqdxDSfmVXNv2PU" \
  --data-urlencode "bank_account[account_number]=000123456" \
  --data-urlencode "bank_account[routing_number]=000-000" \
  --data-urlencode "bank_account[bank_name]=Stripe Test Bank" \
  --data-urlencode "bank_account[account_holder_type]=individual" \
  --data-urlencode "bank_account[account_type]=savings" \
  --data-urlencode "bank_account[first_name]=TestBecs" \
  --data-urlencode "bank_account[last_name]=Archer" \
  --data-urlencode "issuing_country=AU" \
  --data-urlencode "bank_account[company]=Chargebee" \
  --data-urlencode "bank_account[email]=test@example.com" \
  --data-urlencode "bank_account[billing_address]={\"first_name\":\"John\",\"last_name\":\"Doe\",\"line1\":\"49 Market Street\",\"line2\":\"Suite 45\",\"country_code\":\"AU\",\"city\":\"Sydney\",\"postal_code\":\"2000\",\"email\":\"john.doe@example.com\"}"

Troubleshooting

  • If you see Direct debit is not supported for this customer, verify that direct debit is enabled for the customer and that BACS or BECS via Stripe is enabled for the site.
  • If you see bank_account[routing_number] must be a 9-digit number, verify that the customer's preferred currency and bank account country match the direct debit scheme. BACS should use GBP and GB; BECS should use AUD and AU.
  • If you see Missing required param: billing_details[address], pass bank_account[billing_address] as a JSON object in the request.

Additional Information

  • Create a bank account payment source API
  • Payment source object API reference
  • Payment parameters API reference
  • BACS via Stripe
  • BECS via Stripe

Related Articles

How to enable BACS payment method via Stripe?
How to enable BECS payment method via Stripe?
For ACH payments, how do I pass a bank account to Chargebee using the API?
How to configure SEPA Payments via Stripe?
Stripe SEPA via API
How to use Financial Connections- ACH via Stripe?
How to move to a new Stripe account?
Configuring Payments via Stripe

Show more

Was this article helpful?