Skip to content

Instantly share code, notes, and snippets.

@rhettre
Created July 28, 2022 03:13
Show Gist options
  • Save rhettre/ed1837ff66b1f00226f545a18550dae6 to your computer and use it in GitHub Desktop.
Save rhettre/ed1837ff66b1f00226f545a18550dae6 to your computer and use it in GitHub Desktop.
Get Connected Bank Account IDs (For Deposits)
import json
import cbpro
my_key = ""
my_secret = ""
my_passphrase = ""
def _getBankID(my_key, my_secret, my_passphrase):
auth_client = cbpro.AuthenticatedClient(my_key, my_secret, my_passphrase)
payment_methods = auth_client.get_payment_methods()
print(payment_methods)
for method in payment_methods:
print(f"Account: {method['name']} | ID: {method['id']}")
def lambda_handler(event, context):
_getBankID(my_key, my_secret, my_passphrase)
return {
'statusCode': 200,
'body': json.dumps(f'These are you bank IDs!')
}
@rhettre
Copy link
Author

rhettre commented Jul 28, 2022

Run this script to get the bank_id field for your connected bank accounts. You need this bank ID field to run the deposit script. To run this, your API keys need the transfer permission or you'll get a 403 Forbidden response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment