Batch Import Customers
Import one or more customers at a time.
The data to be submitted to the API is composed of the following fields:
Headers
|
|
Key |
|
Value |
|
Note |
|
|
|
api_access_key |
|
user_api_key |
|
Optional |
|
   
Basic credentials and common parameters:
|
|
field |
|
Example |
|
Note |
|
|
|
API |
|
1.5 |
|
Required |
|
|
|
user_id |
|
john1970 |
|
Required |
|
|
|
user_api_key |
|
1959caadac9b13dcb3 |
|
Required if not included in the headers |
|
|
|
account_id |
|
greatwidgets |
|
Required |
|
|
|
type |
|
customers_batch |
|
Required |
|
|
|
|
|
|
|
|
|
|
|
delimiter |
|
pipe or comma or tab |
|
Required |
|
|
|
overwrite_duplicates |
|
yes or update or ignore |
|
See Note |
|
|
|
allow_undo |
|
yes |
|
Optional: 'yes'
or don't include. |
|
|
|
card_number_generate |
|
(# of digits) |
|
Optional - See Note |
|
|
|
campaigns_to_include |
|
89898989989
or
aaaa,bbbb, cccc |
|
At least one is required. If more than one, separate by comma. |
|
|
|
|
|
|
|
|
|
|
|
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 |
|
|
|
|
|
|
|
|
|
Headers:
Determines the order of the fields, separated by the delimiter, given in the data:
|
field |
|
Example |
|
Note |
|
profiles_header_1 |
|
card_number |
|
At least one is required
|
|
profiles_header_2 |
|
code (customer UID) |
|
|
profiles_header_3 |
|
first_name |
|
|
etc... |
|
last_name |
|
|
|
|
email |
|
|
|
|
phone |
|
|
|
|
custom_date |
|
|
|
|
street1 |
|
|
|
|
street2 |
|
|
|
|
city |
|
|
|
|
state |
|
|
|
|
postal_code |
|
|
|
|
country |
|
|
|
|
customer_username |
|
|
|
|
customer_password |
|
|
|
|
customer_PIN |
|
|
|
|
auto_add |
|
|
|
|
custom_field_1 |
|
Note:
Use the Customer Fields - List
API call to determine the name (custom_field_##) of any added custom fields.
|
|
|
|
custom_field_2 |
|
|
|
|
custom_field_3 |
|
|
|
|
etc... |
|
|
|
|
|
|
|
Import data:
|
field |
|
Example |
|
Note |
|
profiles_data |
|
(see below) |
|
|
|
Data to be imported in batch:
One single (text) field with "end-of-lines" (ex: \n and/or \r) at the end of each line: |
|
11223344|11223344|jane|doe|1970-07-14|555-5555
22334455|22334455|jim|mcdoe|1966-07-28|555-5556
33445566|33445566|larry|smith|1980-02-05|555-5557
|
|
|
|
|
|
|
Notes:
Example PHP Request:
If you are using PHP, the $data array would look like this:
- $data['API'] = '1.5';
- $data['user_id'] = 'john1970';
- $data['user_api_key'] = '1959caadac9b13dcb3';
- $data['account_id'] = 'greatwidgets';
- $data['type'] = 'customers_batch';
- $data['delimiter'] = 'pipe';
- $data['overwrite_duplicates'] = 'update';
- or: $data['card_number_generate'] = 10; // for 10-digit number.
- $data['campaigns_to_include'] = '898989889|,|13234545|,|34534554';
- $data['profiles_header_1'] = 'code';
- $data['profiles_header_2'] = 'card_number';
- $data['profiles_header_3'] = 'first_name';
- $data['profiles_header_4'] = 'last_name';
- $data['profiles_header_5'] = 'custome_date';
- $data['profiles_header_6'] = 'phone';
- $data['Profiles_Data'] = '
- 11223344|11223344|jane|doe|1970-07-14|555-5555
- 22334455|22334455|jim|mcdoe|1966-07-28|555-5556
- 33445566|33445566|larry|smith|1980-02-05|555-5557
- ';
Success XML Response:
- <response status="success">
- <batch status="imported">
- <customers>
- <new>2<new>
- <updated>1<updated>
- <customers>
- </batch>
- </response>
Error XML Response:
- <response status="error">
- <error>Error message</error>
- </response>
|