Add a contact bank account
Before you can debit or credit a customer’s bank account, the account must be stored and associated with a contact in Jetpay.
In this guide, you will learn how to add a bank account to an existing contact. Once saved, the bank account can be referenced by its identifier when creating debit or credit transactions.
Prerequisites
- Jetpay API KeyAPI token
- An existing Jetpay Contact IDContact
Flow overview
sequenceDiagram
participant partner as Platform
participant api as Jetpay
partner->>+api: Create and associate new bank account to contact.
Note right of api: PUT /contact/bank-account
api-->>-partner: R: Bank account created.
Note right of api: 201 CreatedImplementation details
Collect account details from your customer
For EFT payments, your application is responsible for collecting the customer’s bank account details. This typically involves presenting a secure form within your frontend, transmitting the data to your backend, and calling the create Contact endpoint from a server-side environment.
Bank account details should never be sent directly from the browser to the Jetpay API.
Create the bank account for an existing contact
Endpoint: PUT /contact/bank-account
curl https://extapi.demo.jetpay.baselinepayments.com/contact/bank-account \
-X PUT \
-H "Authorization: Bearer <YOUR_API_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"institution": "BMO",
"title": "Business Chequing",
"holder_name": "John Smith",
"contact_id": "contact_123",
"account_type": "Chequing",
"transit_number": "27601",
"institution_number": "001",
"account_number": "1111111",
"holder_address": "123 Happy St",
"holder_address_postal_code": "A1A1A1",
"holder_address_city": "Vancouver",
"holder_address_country": "CA",
"holder_email": "[email protected]"
}'For sandbox testing, please use the following values for bank account information (all other fields you can specify any value you'd like that passes field validation):
- "institution": "BMO"
- "transit_number": "27601"
- "institution_number": "001"
Handle the response
If a Bank Account is successfully created, a response will be returned with an HTTP status code of 200, and a response body containing the identifier of the newly created bank account:
{
"identifier": "bank_456"
}We do not return any sensitive bank account details in the creation response. This is to ensure sensitive financial information is not exposed, transmitted, or stored outside of our secure environment, reducing your PCI/compliance scope and minimizing security risk. Instead, we return a unique identifier that should be securely stored on your side and used for initiating future debit paymentsdebit payments.
Using the saved bank account
With a Contact and a saved contact bank account, you can receive payments and send money directly, without requesting payment information from your customer/supplier each time.
Multiple bank accounts per contact
A contact can have multiple bank accounts associated with it. Jetpay does not impose a limit on how many bank accounts may be stored for a single contact. This allows your platform to support scenarios where a customer or supplier may use different accounts for different transactions.
If your system allows contacts to manage multiple bank accounts, you should store the bank account identifier returned during creation along with the title you assign to the account. This allows your application to clearly identify which account should be used for future transactions.
You can also retrieve basic information about a saved bank account at any time using the GET /bank-account/{identifier} endpoint. This endpoint returns non-sensitive metadata such as the identifier, title, account type, and ownership.