Helcim Logo Support & Tutorials

© Copyright 2006-2018 Helcim Inc.

All Rights Reserved.

Helcim Commerce API » Customers »

Add or Edit a Customer

This API call let's you add a new customer or edit an existing customer. The response is an XML of the add/edit customer.

Request Fields

Field Name Type Required Description
action String Yes customerEdit
accountId Integer Yes The Helcim Commerce account ID.
apiToken String Yes API token used for authentication and access control. 
businessName String No The business name. Either the business name or the contact name must be entered.
customerCode String No The customer code. If it is not entered then you are adding a customer.  If it is entered then you are editing an existing customer.
contactName String No The contact name. Either the business name or the contact name must be entered.
billing_contactName String No The contact name for the billing address.
billing_businessName String No The business name for the billing address.
billing_street1 String No The street address for the billing address.
billing_street2 String No The street address for the billing address.
billing_city String No The city for the billing address.
billing_province String No The province for the billing address.
billing_country String No The country for the billing address.
billing_postalCode String No The postal code for the billing address.
billing_phone String No The phone number for the billing address.
billing_fax String No  The fax number for the billing address.
billing_email String No The email address for the billing address.
shipping_contactName String No The contact name for the shipping address.
shipping_businessName String No The business name for the shipping address.
shipping_street1 String No The street address for the shipping address.
shipping_street2 String No The street address for the shipping address.
shipping_city String No The city for the shipping address.
shipping_province String No The province for the shipping address.
shipping_country String No The country for the shipping address.
shipping_postalCode String No The postal code for the shipping address.
shipping_phone String No The phone number for the shipping address.
shipping_fax String No The fax number for the shipping address.
shipping_email String No The email address for the shipping address.

Response Fields (XML)

Field Name Type Description
message - XML structure
response Integer  1 or 0. 
responseMessage String Confirmation of completed action.
customer - XML structure
customerCode String The customer code.
businessName String The business name.
contactName String The contact name.

Errors

For all API requests, there are also generic API authentication and user access restriction errors.
Response Code Error Code Message Description
0 - Missing Fields - Contact Name or Business Name You must enter either the Contact Name or the Business Name.

Code Samples

Sample Adding and Editing Customer Respos XML

<?xml version="1.0"?>
<message>
    <response>1</response>
    <responseMessage>Customer Updated</responseMessage>
    <customer>
        <customerCode>12A1160</customerCode>
        <businessName>Party</businessName>
        <contactName>Time1</contactName>
    </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="customerEdit">
<input type="hidden" name="businessName" value="Helcim">
<input type="hidden" name="customerCode" value="12A1141">
<input type="hidden" name="contactName" value="John Smith">
<input type="hidden" name="billing_contactName" value="John Smith">
<input type="hidden" name="billing_businessName" value="Helcim">
<input type="hidden" name="billing_street1" value="123 Home Street">
<input type="hidden" name="billing_street2" value="123 Home Street">
<input type="hidden" name="billing_city" value="Calgary">
<input type="hidden" name="billing_province" value="Alberta">
<input type="hidden" name="billing_country" value="Canada">
<input type="hidden" name="billing_postalCode" value="T2H1K7">
<input type="hidden" name="billing_phone" value="877-643-5246">
<input type="hidden" name="billing_fax" value="866-469-3077">
<input type="hidden" name="billing_email" value="info@helcim.com">
<input type="hidden" name="shipping_contactName" value="John Smith">
<input type="hidden" name="shipping_businessName" value="Helcim">
<input type="hidden" name="shipping_street1" value="123 Home Street">
<input type="hidden" name="shipping_street2" value="123 Home Street">
<input type="hidden" name="shipping_city" value="Calgary">
<input type="hidden" name="shipping_province" value="Alberta">
<input type="hidden" name="shipping_country" value="Canada">
<input type="hidden" name="shipping_postalCode" value="T2H1K7">
<input type="hidden" name="shipping_phone" value="877-643-5246">
<input type="hidden" name="shipping_fax" value="866-469-3077">
<input type="hidden" name="shipping_email" value="info@helcim.com">