Helcim Logo Support & Tutorials

© Copyright 2006-2018 Helcim Inc.

All Rights Reserved.

Helcim Commerce API » Customers »

Edit a Credit Card

This API call let's you update an existing credit card for a specific customer. The response is an XML of the available updated credit card information.

Request Fields


Field Name Type Required Description
action String Yes customerCardEdit
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.
cardToken String Yes The credit card token.
cardHolderName String No The card holder's name.
cardNumber Integer No The credit card number.
cardExpiry String No The credit card expiry date.
cardCVV Integer No The card verification value.
cardHolderAddress String No The card holder's address.
cardHolderPostalCode String No The card holder's postal code.
terminalId Integer No The terminal ID.
verify Integer No 1 or 0. Whether the card will be verified or not.

Response Fields (XML)


Field Name Type Description
message - XML structure
response Integer 1 or 0. Whether the credit card was updated 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.
card - XML structure
cardNumber Integer The credit card number (first four and last four digits only).
cardToken String The credit card token.
cardF4L4 Integer The first four and last four credit card digits.
dateLastUsed String The date the credit card 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 you provided cannot be found.
0 - Card has expired The credit card has expired, or the credit card expiry date was not entered.

Code Samples

HTML Form Sample Code

<input type="hidden" name="accountId" value="YOUR-ACCOUNT-ID">
<input type="hidden" name="apiToken" value="YOUR-API-TOKEN">
<input type="hidden" name="action" value="customerCardEdit">
<input type="hidden" name="customerCode" value="12A1167">
<input type="hidden" name="cardHolderName" value="John Smith">
<input type="hidden" name="cardNumber" value="5454545454545454">
<input type="hidden" name="cardExpiry" value="0219">
<input type="hidden" name="cardCVV" value="100">
<input type="hidden" name="cardHolderAddress" value="123 Home Street">
<input type="hidden" name="cardHolderPostalCode" value="T2H1K7">
<input type="hidden" name="terminalId" value="YOUR-TERMINAL-ID">
<input type="hidden" name="verify" value="1">

Sample Update Credit Card Response XML

<?xml version="1.0"?>
<message>
    <response>1</response>
    <responseMessage>Card Verified and Save - APPROVAL CODE: T2E7ST</responseMessage>
    <customer>
        <customerCode>12A1141</customerCode>
        <businessName>Aaron Hamilton</businessName>
        <contactName>Aaron Hamilton</contactName>
        <card>
            <cardNumber>5454********5454</cardNumber>
            <cardToken>1edad472e9b44e76f820ce</cardToken>
            <cardF4L4>54545454</cardF4L4>
            <dateLastUsed>2017-06-15 12:13:58</dateLastUsed>
        </card>
    </customer>
</message>