Helcim Logo Support & Tutorials

© Copyright 2006-2018 Helcim Inc.

All Rights Reserved.

Helcim Commerce API » Customers »

Add or Edit a Bank Account

This API call let's you add a new credit card to a specific customer. The response is an XML of the available new credit card information.

Request Fields


Field Name Type Required Description
action String Yes customerBankAccountEdit
accountId Integer Yes The Helcim Commerce account ID.
apiToken String Yes API token used for authentication and access control. 
customerCode String Yes The customer code.
postalCode String Yes The postal code.
country String Yes The country.
province String Yes The province.
city String Yes The city.
streetAddress String Yes The street address.
companyName String Yes The company name.
lastName String Yes The last name.
firstName String Yes The first name.
bankAccountNumber Integer Yes The bank account number.
bankTransitNumber Integer Yes The bank account transit number.
accountCorporate String Yes The account category (P-personal, C-corporate).
accountType String Yes The type of accoung (CHK-chequing, SAV-savings).
bankAccountToken String No The bank accoung token. If it is entered then you are editing an existing bank account.
If it is not entered then you are adding a new bank account.

Response Fields (XML)


Field Name Type Description
message - XML structure
response Integer 1 or 0. Whether the bank account was added/edited or not.
responseMessage String Response message confirming actions taken.
customer - XML structure
customerCode String the customer code.
businessName String The business name.
contactName String The contact name.
bankAccount - XML structure
bankAccountToken String The bank account Token
bankAccountL4L4 String The last four digits of the routing number, and the last four digits of the bank account number
dateLastUsed String The date the bank account was last used.

Errors


For all API requests, there are also generic API authentication and user access restriction errors.

Response Code Error Code Message Description
0 - Invalid Customer Code The customer code was not entered, or was invalid.
0 - Invalid bank account token The bank account token you provided is invalid.
0 - Invalid Field - postalCode The postal code was not entered, or was invalid.
0 - Invalid Field - country The country was not entered, or was invalid.
0 - Invalid Field - province The province was not entered, or was invalid.
0 - Invalid Field - city The city was not entered, or was invalid.
0 - Invalid Field - streetAddress The street address was not entered, or was invalid.
0 - Invalid Field - companyName The company name was not entered, or was invalid.
0 - Invalid Field - lastName The last name was not entered, or was invalid.
0 Invalid Field - firstName The first name was not entered or was invalid.
0 - Invalid Field - bankAccountNumber The bank account number was not entered, or was invalid.
0 - Invalid Field - bankTransitNumber The bank account transit number was not entered, or was invalid.
0 - Invalid Field - accountCorporate - Must be P or C The account category (personal or corporate) was not entered, or was invalid.
0 - Invalid Field - accountType - Must be CHK or SAV The account type (chequing or savings) was not entered, or was invalid.

Code Samples

Sample Adding and Editing Bank Account Response XML

<message>
    <response>1</response>
    <responseMessage>Bank Account Saved</responseMessage>
    <customer>
        <customerCode>12A1141</customerCode>
        <businessName>Aaron Hamilton</businessName>
        <contactName>Aaron Hamilton</contactName>
        <bankAccount>
            <bankAccountToken>830ddb5c5c785bedd1cacc</bankAccountToken>
            <bankAccountL4L4>23464545</bankAccountL4L4>
            <dateLastUsed>0000-00-00 00:00:00</dateLastUsed>
        </bankAccount>
    </customer>
</message>

HTML Form Sample HTML

<input type="hidden" name="accountId" value="YOUR-ACCOUNT-ID">
<input type="hidden" name="apiToken" value="YOUR-API-TOKEN">
<input type="hidden" name="action" value="customerBankAccountEdit">
<input type="hidden" name="customerCode" value="12A1141">
<input type="hidden" name="postalCode" value="T2H1K7">
<input type="hidden" name="country" value="Canada">
<input type="hidden" name="province" value="Alberta">
<input type="hidden" name="city" value="Calgary">
<input type="hidden" name="streetAddress" value="123 Home Street">
<input type="hidden" name="companyName" value="Helcim">
<input type="hidden" name="lastName" value="Smith">
<input type="hidden" name="firstName" value="John">
<input type="hidden" name="bankAccountNumber" value="4545454545454545">
<input type="hidden" name="bankTransitNumber" value="12345">
<input type="hidden" name="accountCorporate" value="P">
<input type="hidden" name="accountType" value="CHK">
<input type="hidden" name="bankAccountToken" value="830ddb5c5c785bedd1cacc">