Update Customer Information
Update a customer account with new information.
Headers
|
|
Key |
|
Value |
|
Note |
|
|
|
api_access_key |
|
user_api_key |
|
Optional |
|
   
The data to be submitted to the API is composed of the following fields:
|
|
field |
|
Example |
|
Note |
|
|
|
user_id |
|
john1970 |
|
Required |
|
|
|
user_password |
|
1959caadac9b13dcb3 |
|
Required if not included in the headers |
|
|
|
type |
|
record_customer |
|
Required |
|
|
|
customer_action |
|
edit |
|
Required |
|
|
|
account_id |
|
greatwidgets |
|
Required |
|
|
|
code |
|
89898989898989 |
|
Optional |
|
|
|
new_code |
|
Yes |
|
Optional |
|
|
|
card_number |
|
1212121212 |
|
Optional |
|
|
|
card_number_generate |
|
(# of digits) |
|
Optional |
|
|
|
first_name |
|
John |
|
Optional |
|
|
|
last_name |
|
Doe |
|
Optional |
|
|
|
phone |
|
555-555-2455 |
|
Optional |
|
|
|
email |
|
test@email.com |
|
Optional |
|
|
|
street1 |
|
123 Main St. |
|
Optional |
|
|
|
street2 |
|
Apt 3G |
|
Optional |
|
|
|
city |
|
Anytown |
|
Optional |
|
|
|
state |
|
ZZ |
|
Optional |
|
|
|
postal_code |
|
55555 |
|
Optional |
|
|
|
country |
|
NZ |
|
Optional |
|
|
|
custom_date |
|
1970-07-14 |
|
Optional |
|
|
|
custom_field |
|
John likes cheese. |
|
Optional |
|
|
|
customer_username |
|
jdoe1970 |
|
Optional |
|
|
|
customer_password |
|
ilovecheese |
|
Optional |
|
|
|
customer_PIN |
|
1234 |
|
Optional |
|
|
|
custom_field_## |
|
1kg Emental Cheese
or
2012.07.28 22:59:59
or
Gouda,Emental,Swiss
|
|
Optional |
|
|
|
send_no_email |
|
true |
|
Optional or
don't include. |
|
|
|
|
|
|
|
|
|
|
|
Output Format: |
|
|
|
output |
|
JSON or XML |
|
Optional. If not provided, defaults to XML |
|
|
|
callback |
|
someFunctionName |
|
Optional: JSONP format |
|
|
|
condensed |
|
yes |
|
Optional (No white space) Applies only to JSON(P) output |
|
|
|
|
|
|
|
|
|
Notes:
Example PHP Request:
If you are using PHP, the $data array would look like this:
- $data['user_id'] = 'john1970';
- $data['user_password'] = '1959caadac9b13dcb3';
- $data['type'] = 'record_customer';
- $data['customer_action'] = 'edit';
- $data['account_id'] = 'greatwidgets';
- $data['code'] = '89898989898989';
- $data['card_number'] = '1212121212';
- or: $data['card_number_generate'] = 10; // for 10-digit number.
- $data['first_name'] = 'John';
- $data['last_name'] = 'Doe';
- $data['phone'] = '555-555-2455';
- $data['email'] = 'test@yourdomain.com';
- $data['custom_date'] = '1970-07-14';
- $data['street1'] = '123 Main St.';
- $data['street2'] = 'Apt 3G';
- $data['city'] = 'Anytown';
- $data['state'] = 'ZZ';
- $data['postal_code'] = '55555';
- $data['country'] = 'NZ';
- $data['customer_username'] = 'jdoe1970';
- $data['customer_password'] = 'ilovecheese';
- $data['customer_PIN'] = '1234';
- $data['custom_field_2'] = 'Single';
Success XML Response (Update Customer):
- <response status="success">
- <customer status="update">
- <code>1234567890123456</code>
- //only when card_number_generate is set:
- <card_number>1234567890</card_number>
- </customer>
- </response>
Error XML Response:
- <response status="error">
- <error>Error message</error>
- </response>
|