Below is the info about the "CUSTOMER EDIT ENDPOINT" for the CoreCommerce API.
The Request:
<?xml version="1.0" encoding="utf-8"?>
<Request version="1.0">
<Authentication>
<Username></Username>
<Password></Password>
<StoreName></StoreName>
<XMLKey></XMLKey>
</Authentication>
<Action>ACTION_TYPE_CUSTOMER_EDIT</Action>
<List length="1">
<Customer>
<BillingSameAsShipping>Boolean Types</BillingSameAsShipping>
<Address>
<Company><![CDATA[Matt's Cool Company]]></Company>
<FirstName><![CDATA[Matt]]></FirstName>
<LastName><![CDATA[Jones]]></LastName>
<Address1><![CDATA[145 SE Parkway]]></Address1>
<Address2><![CDATA[Ste 100]]></Address2>
<City><![CDATA[Franklin]]></City>
<State><![CDATA[TN]]></State>
<Zip><![CDATA[37064-7829]]></Zip>
<Country><![CDATA[US]]></Country>
<County><![CDATA[Williamson]]></County>
<Email><![CDATA[email@mystore.com]]></Email>
</Address>
<ShippingAddress>
<Company><![CDATA[Matt's Cool Company]]></Company>
<FirstName><![CDATA[Matt]]></FirstName>
<LastName><![CDATA[Jones]]></LastName>
<Address1><![CDATA[145 SE Parkway]]></Address1>
<Address2><![CDATA[Ste 100]]></Address2>
<City><![CDATA[Franklin]]></City>
<State><![CDATA[TN]]></State>
<Zip><![CDATA[37064-7829]]></Zip>
<Country><![CDATA[US]]></Country>
<County><![CDATA[Williamson]]></County>
<Email><![CDATA[email@mystore.com]]></Email>
</ShippingAddress>
<CustomerGroupId>5</CustomerGroupId>
<Phone><![CDATA[615-555-1212]]></Phone>
<Fax><![CDATA[615-555-1234]]></Fax>
<InternalNumber><![CDATA[123456]]></InternalNumber>
<HowHeardAbout><![CDATA[A friend]]></HowHeardAbout>
<Password><![CDATA[abc123]]></Password>
<PasswordHint><![CDATA[abc+3]]></PasswordHint>
<Memo><![CDATA[abc]]></Memo>
<WholesaleDiscount><![CDATA[10]]></WholesaleDiscount>
<TaxExempt>Boolean Types</TaxExempt>
<FreeShipping>Boolean Types</FreeShipping>
<StoneEdgeExported>Boolean Types</StoneEdgeExported>
<CustomFields length="1">
<CustomField id="62">
<Name><![CDATA[Age]]></Name>
<Value><![CDATA[23]]></Value>
</CustomField>
</CustomFields>
<MailingLists length="1">
<MailingList id="1" />
</MailingLists>
<Status>Customer Status List</Status>
<RewardPointModifications length="1">
<RewardPointModification>
<Amount><![CDATA[-25]]></Amount>
<Reason><![CDATA[Customer returned $30 worth of groceries]]></Reason>
</RewardPointModification>
</RewardPointModifications>
</Customer>
</List>
</Request>
Below is a chart of the definitions of what is in the above request, and what each search term means:
Authentication and Fields
Name | Req | Example Value | Comments |
Username | Y | "admin" or "mystorename" | You create this value inside your admin under Settings->Store API. The value you set there inside your CoreCommerce Admin Panel is the value you use here. |
Password | Y | An alphanumeric string that is hard to guess (i.e. "MyPassWord1!") | You create this value inside your admin under Settings->Store API. The value you set there inside your CoreCommerce Admin Panel is the value you use here. |
XML Key | Y | A long string to further add to the security of your API connection (i.e. "FY3D57THY32HTC3748TRC38H74TR") | You create this value inside your admin under Settings->Store API. The value you set there inside your CoreCommerce Admin Panel is the value you use here. |
Action | Y | ACTION_TYPE_CUSTOMER_ADD | This is telling the API which endpoint you want to work with. In this case it is ACTION_TYPE_CUSTOMER_ADD |
List | Y | "Length = 1" or "Length = 10" | Opens the Request by telling the API how many Customers you have included in the request. If you are adding one customer, "length" would be set to 1 as you see in the above example. If you are adding multiple categories, this should tell the API how many you are adding. |
Customer | Y | This is the starting tag for a single customer being added. | |
BillingSameAsShipping | Y or N | ||
Address | Y | This is the starting tag for the BILLING Address. | |
Company | Company LLC | Billing Company Name | |
FirstName | Y | Mike | Billing First Name |
LastName | Y | Jones | Billing Last Name |
Address1 | Y | 123 Fake St. | Billing Address 1 |
Address2 | Suite 100 | Billing Address 2 | |
City | Y | Franklin | Billing City |
State | Y | TN | Billing State |
Zip | Y | 37064 | Billing Zip Code |
Country | Y | US | Billing Country |
County | Williamson | Billing County | |
Y | mike@mystore.com | Email Address | |
ShippingAddress | Y | This is the starting tag for the SHIPPING Address. | |
Company | Company LLC | Shipping Company Name | |
FirstName | Y | Mike | Shipping First Name |
LastName | Y | Jones | Shipping Last Name |
Address1 | Y | 123 Fake St. | Shipping Address 1 |
Address2 | Suite 100 | Shipping Address 2 | |
City | Y | Franklin | Shipping City |
State | Y | TN | Shipping State |
Zip | Y | 37064 | Shipping Zip Code |
Country | Y | US | Shipping Country |
County | Williamson | Shipping County | |
mike@mystore.com | Shipping Email Address (if different from billing email) | ||
CustomerGroupId | 1 | The ID of the customer group you wish to tie to the customer to. This is only required if you are using the "Customer Group Discounts" feature inside your store. | |
Phone | 615-790-0823 | The Phone Number of the Customer. | |
Fax | 615-790-0593 | The Fax Number of the Customer. | |
InternalNumber | 1345432323 | The Internal Number used to identify that customer. This value is for Admin Use only and is NOT seen by the customer themselves. | |
HowHeardAbout | Newspaper | The answer the customer gave to "How you Heard About Us?" (if any). | |
Password | mykids123 | The customer password. This is the UNENCRYPTED password you want to use for the customer. the API will encrypt it for you when it saves it in the database. | |
PasswordHint | your kids | The Hint you want the system to provide to the customer if they try to reset their password. | |
Memo | This customer is really nice! | Any Memo tied to the customer. It is for Admin use only for notes about the customer. | |
WholesaleDiscount | 10 | Does the customer get their own individual discount without coupons? If so, enter the % discount they get here. | |
TaxExempt | Y or N | If the customer is tax exempt, specify Y here, otherwise N or blank will work | |
FreeShipping | Y or N | If the customer is allowed to be offer Free Shipping EVERY TIME when they checkout, use Y here. Otherwise N. | |
StoneEdgeExported | Y or N | If you use the Stone Edge fulfillment app, and the customer has already been exported to Stone Edge, use Y here, otherwise N. | |
Status | "Pending or Approved" |
Custom Fields:
Name | Req | Example Value | Comments |
CustomFields | length = "1" | This is the opening Tag for Custom Fields IF you have created Custom Fields and need to provide values for them for this customer. The Length specifies how many custom fields you will be adding. | |
CustomField | id = '62' | This is the opening tag for a single Custom Field to be specified. The "id" is the Custom Field ID from the database, which you can get from your admin, by editing the custom field, and then viewing the address bar URL and seeing the ID value in the URL. | |
Name | Y | "Type of Customer" | If you specify a CustomField Node, there are required. This it the NAME of the custom field. It must 100% match the name of the same custom field in the database for it to import. |
Value | Y | "Construction" | This is the new value of that custom field for this customer. If will overwrite the existing value if you are editing, otherwise it will insert it new. |
Mailing Lists:
Name | Req | Example Value | Comments |
MailingLists | length = "1" | This is the opening Tag for Mailing Lists Fields IF you have created Mailing Lists and need to assign them for this customer. The Length specifies how many mailing lists you will be assigning. | |
MailingList | id = '5' | This is the opening tag for a single Mailing List to be specified. The "id" is the Custom Field ID from the database, which you can get from your admin, by editing the mailing list, and then viewing the address bar URL and seeing the ID value in the URL. |
Other Misc Fields:
Name | Req | Example Value | Comments |
RewardPointModifications | length = "1" | This is the opening Tag for Reward Point Modifications IF you have to alter the Reward Point Balance for this customer. If you do not use Reward Points inside CoreCommerce, this sections is not needed. | |
RewardPointModifications | This is the opening tag for a single Modification to be specified. | ||
Amount | 10 | The amount of the Modification. It can be positive (10) or negative (-10). | |
Reason | "He purchased in person and the order is not in CoreCommerce" | The reason you are making the change |
The Response:
<?xml version="1.0" encoding="utf-8"?>
<Response>
<Action>ACTION_TYPE_CUSTOMER_EDIT</Action>
<Status>SUCCESS_CODE</Status>
<Code />
<Messages />
<List length="2">
<Customer id="5">
<Code>100</Code>
<Message></Message>
</Customer>
<Customer id="6">
<Code>100</Code>
<Message></Message>
</Customer>
</List>
</Response>
Name | Comments |
Action | This will tell you the action it just processed. |
Status | SUCCESS_CODE means it was successful. Anything other than this means it failed. |
Code | "200" is a valid response and means it was successful and executed the request you made properly. Anything other than "200" means there was an error. |
Messages | This will be the message from the API telling you what the issue was IF it failed. |
List | This will show you the list of customers it successfully added. You will only see this IF you get a "200" success response code. |
Customer | This will show you the ID of the customer it added for your reference. |
Code | The code related to adding or editing that customer. "100" means it was successful. |
Message | Any specific message related to adding that customer to your store. |