Create a customer account; Returns a unique Account ID.
See moreUpdate a customer account with new information.
See moreCreates a random card number of a given length and checks that this number is unique and not in use already in the account.
See moreImport one or more customers at a time.
See moreSearch for a customer within each given field. As opposed to Customer - Find, which finds a customer across all fields.
See moreFinds a customer across all fields. As opposed to Customer - Search which searches only inside each given fields.
See moreRetrieves a customer's information and campaigns' balances.
See moreReturns a customer's balance and transaction history for a particular campaign.
See moreDeletes a customer from the account PERMANENTLY.
See moreReturns whether a customer's password is valid or not.
See moreUpdates a customer's card_number and/or unique code with new ones, based on partial customer data matching.
See moreRecord or Register a New Customer
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 | ||||
type | record_customer | Required | ||||
customer_action | new or register | Required | ||||
account_id | greatwidgets | Required | ||||
campaign_id | 1234567890123456
or 12344234,1234234,1234124 |
Optional | ||||
card_number | 1212121212 | Optional | ||||
card_number_generate | (# of digits) | Optional | ||||
code | 89898989898989 | Optional | ||||
new_code | Yes | Optional | ||||
first_name | John | Optional | ||||
last_name | Doe | Optional | ||||
phone | 555-555-2455 | Optional | ||||
test@email.com | Optional | |||||
street1 | 123 Main St. | Optional | ||||
street2 | Apt 3G | Optional | ||||
city | Anytown | Optional | ||||
state | ZZ | Optional | ||||
postal_code | 55555 | Optional | ||||
country | New Zealand | 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 | ||||
auto_add | 1500 | 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'] = 'new';
$data['account_id'] = 'greatwidgets';
$data['campaign_id'] = '1234567890123456';
$data['card_number'] = '1212121212';
or: $data['card_number_generate'] = 10; // for 10-digit number.
$data['code'] = '89898989898989';
$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'] = 'New Zealand';
$data['custom_field'] = 'John likes cheese.';
$data['customer_username'] = 'jdoe1970';
$data['customer_password'] = 'ilovecheese';
$data['customer_PIN'] = '1234';
$data['custom_field_2'] = 'Single';
Success XML Response (New Customer):
<response status="success">
<customer status="new">
<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>
Update Customer Information
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 | ||||
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 | ||||
test@email.com | Optional | |||||
street1 | 123 Main St. | Optional | ||||
street2 | Apt 3G | Optional | ||||
city | Anytown | Optional | ||||
state | ZZ | Optional | ||||
postal_code | 55555 | Optional | ||||
country | New Zealand | 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'] = 'New Zealand';
$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>
Generate a New Customer Card Number
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 | ||||
account_id | greatwidgets | Required | ||||
type | generate_card_number | Required | ||||
how_many_digits | (# of digits) | Optional | ||||
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['account_id'] = 'greatwidgets';
$data['type'] = 'generate_card_number';
or: $data['how_many_digits'] = 10; // for 10-digit number.
Success XML Response:
<response status="success">
<customer>
<card_number>1234567890</card_number>
</customer>
</response>
Error XML Response:
<response status="error">
<error>Error message</error>
</response>
Batch Import Customers
The data to be submitted to the API is composed of the following fields:
field | Example | Note | ||||
---|---|---|---|---|---|---|
API | 1.5 | Required | ||||
user_id | john1970 | Required | ||||
user_api_key | 1959caadac9b13dcb3 | Required | ||||
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 | |||||
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 |
|||||
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>
Customer - Search
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 | ||||
type | customer_search | Required | ||||
exact_match | sensitive or insensitive |
Do not include for partial matching. |
||||
account_id | greatwidgets | Required | ||||
card_number | 1234 | Optional | ||||
first_name | John | Optional | ||||
last_name | Doe | Optional | ||||
phone | 555-5555 | Optional | ||||
jdoe@email.com | Optional | |||||
city | Anytown | Optional | ||||
state | ONT | Optional | ||||
postal_code | 55555 | Optional | ||||
custom_date | 1970-07-14 | Optional | ||||
custom_field | baltimore | Optional | ||||
customer_username | jdoe1970 | Optional | ||||
customer_password | pa$$w0rd | Optional | ||||
customer_PIN | 1234 | Optional | ||||
custom_field_# | Married | Option | ||||
include_balances | Y | Do not include if not wanted. |
||||
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'] = 'customer_search';
$data['account_id'] = 'greatwidgets';
$data['last_name'] = 'Doe';
$data['phone'] = 555-5555;
Success XML Response with single match:
<response status="success">
<customer>
<code>89898989898989</code>
<card_number>1212121212</card_number>
<first_name>John</first_name>
<last_name>Doe</last_name>
<phone>555-5555</phone>
<email>john@email.com</email>
<street1>123 Main St.</street1>
<street2>Apt 3G</street2>
<city>Anytown</city>
<state>ONT</state>
<postal_code>55555</postal_code>
<country>New Zealand</country>
<custom_date>1970-07-14</custom_date>
<custom_field>He Likes Cheese</custom_field>
<customer_username>jdoe1970</customer_username>
</customer>
</response>
Success XML Response with multiple matches:
<response status="success">
<customer>
<code>89898989898989</code>
<card_number>1212121212</card_number>
<first_name>John</first_name>
<last_name>Doe</last_name>
<phone>555-5555</phone>
<email>john@email.com</email>
<street1>123 Main St.</street1>
<street2>Apt 3G</street2>
<city>Anytown</city>
<state>ONT</state>
<postal_code>55555</postal_code>
<country>New Zealand</country>
<custom_date>1970-07-14</custom_date>
<custom_field>He Likes Cheese</custom_field>
<customer_username>jdoe1970</customer_username>
</customer>
<customer>
<code>1234567890123456</code>
<card_number>1313131313</card_number>
<first_name>Jane</first_name>
<last_name>Smith</last_name>
<phone>555-6666</phone>
<email>j.smith@workemail.com</email>
<street1>321 Side St.</street1>
<street2></street2>
<city>Bigtown</city>
<state>CA</state>
<postal_code>55555</postal_code>
<country></country>
<custom_date>1966-07-28</custom_date>
<custom_field></custom_field>
<customer_username>janesmith222</customer_username>
</customer>
</response>
Success XML Response with "include_balances = Y":
<response status="success">
<customer>
<code>89898989898989</code>
<card_number>1212121212</card_number>
<first_name>John</first_name>
<last_name>Doe</last_name>
<phone>555-5555</phone>
<email>john@email.com</email>
<street1>123 Main St.</street1>
<street2>Apt 3G</street2>
<city>Anytown</city>
<state>ONT</state>
<postal_code>55555</postal_code>
<country>New Zealand</country>
<custom_date>1970-07-14</custom_date>
<custom_field>He Likes Cheese</custom_field>
<customer_username>jdoe1970</customer_username>
<campaigns>
<campaign>
<id>1234567890123456</id>
<name>Widget Rewards</name>
<type>points</type>
<balance>1500</balance>
<cumulative>4750</cumulative>
<last_transaction>2011-12-31</last_transaction>
</campaign>
...
</campaigns>
</customer>
...
</response>
XML Response if no customer matches fields given:
<response status="no_match">
<message>Language-specific "No Customers Match Criteria"</message>
</response>
Error XML Response:
<response status="error">
<error>Error message</error>
</response>
Customer - Find
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 | ||||
type | customer_find | Required | ||||
account_id | greatwidgets | Required | ||||
find_customer | Amy Acker, 1234 Main St | Required | ||||
include_balances | Y | Do not include if not wanted. |
||||
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'] = 'customer_find';
$data['account_id'] = 'greatwidgets';
$data['find_customer'] = 'Amy Acker, 1234 Main St';
Success XML Response with single match:
<response status="success">
<customer>
<code>89898989898989</code>
<card_number>1212121212</card_number>
<first_name>Amy</first_name>
<last_name>Doe</last_name>
<phone>555-5555</phone>
<email>adoe@email.com</email>
<street1>123 Acker St.</street1>
<street2>Apt 3G</street2>
<city>Anytown</city>
<state>ONT</state>
<postal_code>55555</postal_code>
<country>New Zealand</country>
<custom_date>1970-07-14</custom_date>
<custom_field>She Likes Cheese</custom_field>
<customer_username>adoe1970</customer_username>
</customer>
</response>
Success XML Response with multiple matches:
<response status="success">
<customer>
<code>1234567890123456</code>
<card_number>1313131313</card_number>
<first_name>John</first_name>
<last_name>Doe</last_name>
<phone>555-1234</phone>
<email>john@email.com</email>
<street1>434 Great St.</street1>
<street2></street2>
<city>Maintown</city>
<state>ONT</state>
<postal_code>55555</postal_code>
<country>New Zealand</country>
<custom_date>1966-07-28</custom_date>
<custom_field></custom_field>
<customer_username>jdoe1966</customer_username>
</customer>
<customer>
<code>89898989898989</code>
<card_number>1212121212</card_number>
<first_name>Amy</first_name>
<last_name>Doe</last_name>
<phone>555-5555</phone>
<email>adoe@email.com</email>
<street1>123 Acker St.</street1>
<street2>Apt 3G</street2>
<city>Anytown</city>
<state>ONT</state>
<postal_code>M5A-5A5</postal_code>
<country></country>
<custom_date>1970-07-14</custom_date>
<custom_field>She Likes Cheese</custom_field>
<customer_username>adoe1970</customer_username>
</customer>
</response>
Success XML Response with "include_balances = Y":
<response status="success">
<customer>
<code>89898989898989</code>
<card_number>1212121212</card_number>
<first_name>John</first_name>
<last_name>Doe</last_name>
<phone>555-1234</phone>
<email>john@email.com</email>
<street1>434 Great St.</street1>
<street2></street2>
<city>Maintown</city>
<state>ONT</state>
<postal_code>55555</postal_code>
<country>New Zealand</country>
<custom_date>1966-07-28</custom_date>
<custom_field></custom_field>
<customer_username>jdoe1966</customer_username>
<campaigns>
<campaign>
<id>1234567890123456</id>
<name>Widget Rewards</name>
<type>points</type>
<balance>1500</balance>
<cumulative>4750</cumulative>
<last_transaction>2011-12-31</last_transaction>
</campaign>
...
</campaigns>
</customer>
...
</response>
XML Response if no customer matches fields given:
<response status="no_match">
<message>Language-specific "No Customers Match Criteria"</message>
</response>
Error XML Response:
<response status="error">
<error>Error message</error>
</response>
Retrieve Customer Information
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 | ||||
type | customer_info | Required | ||||
account_id | greatwidgets | Required | ||||
card_number | 1212121212 | See Notes | ||||
code | 89898989898989 | See Notes | ||||
include_balances | N | Optional | ||||
campaign_id | 12345667890123456 | Optional | ||||
hide_custom_field | Y | Optional | ||||
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'] = 'customer_info';
$data['account_id'] = 'greatwidgets';
$data['code'] = '89898989898989';
or: $data['card_number'] = 1212121212;
Success XML Response:
<response status="success">
<customer>
<code>89898989898989</code>
<card_number>1212121212</card_number>
<first_name>John</first_name>
<last_name>Doe</last_name>
<phone>555-5555</phone>
<email>john@email.com</email>
<street1>123 Main St.</street1>
<street2>Apt 3G</street2>
<city>Anytown</city>
<state>ONT</state>
<postal_code>55555</postal_code>
<country>New Zealand</country>
<custom_date>1970-07-14</custom_date>
<custom_field>He Likes Cheese</custom_field>
<customer_username>jdoe1970</customer_username>
<registered>Y</registered>
<custom_field_2>
<label>Marital Status</label>
<data>Single</data>
</custom_field_2>
...
</customer>
<campaigns>
<campaign>
<id>1234567890123456</id>
<name>Widget Rewards</name>
<type>points</type>
<balance>1500</balance>
<cumulative>4500</cumulative>
<monetary_balance>10.00</monetary_balance>
<currency>EUR</currency>
<glyph>€</glyph>
<last_transaction>2011-12-31</last_transaction>
<available_rewards>
<reward>
<id>678</id>
<description>Free Widget</description>
<needed_to_redeem>1000</needed_to_redeem>
<reward_id>A-345678</reward_id>
</reward>
<reward>
<id>753</id>
<description>Free bigger widget</description>
<needed_to_redeem>2500</needed_to_redeem>
</reward>
</available_rewards>
</campaign>
<campaign>
<id>2345678901234567</id>
<name>Employee Rewards</name>
<type>earned</type>
<balance>16.50</balance>
<currency>EUR</currency>
<cumulative>59.95</cumulative>
<last_transaction>2011-12-31</last_transaction>
</campaign>
<campaign>
<id>3456789012345678</id>
<name>Frequent Buyer</name>
<type>buyx</type>
<balances>
<item>
<name>Coffees</name>
<item_id>96</item_id>
<balance>14</balance>
<earned>1</earned>
<cumulative>24</cumulative>
<redeemed>1</redeemed>
<earn_ratio>10</earn_ratio>
</item>
<item>
<name>Cakes</name>
<item_id>107</item_id>
<balance>11</balance>
<earned>1</earned>
<cumulative>21</cumulative>
<redeemed>1</redeemed>
<earn_ratio>10</earn_ratio>
</item>
<item>
<name>Books</name>
<balance>2</balance>
<earned>0</earned>
<cumulative>2</cumulative>
<redeemed>0</redeemed>
<earn_ratio>5</earn_ratio>
</item>
</balances>
<last_transaction>2011-12-31</last_transaction>
<available_rewards>
<reward>
<item_id>96</item_id>
<name>Coffees</name>
<earn_ratio>10</earn_ratio>
<reward_id>A-345678</reward_id>
</reward>
<reward>
<item_id>107</item_id>
<name>Cakes</name>
<earn_ratio>10</earn_ratio>
</reward>
</available_rewards>
</campaign>
</campaigns>
</response>
Notes:
Success XML Response for a Coaltion campaign:
<response status="success">
<customer>
<code>89898989898989</code>
<card_number>1212121212</card_number>
<first_name>John</first_name>
<last_name>Doe</last_name>
<phone>555-5555</phone>
<email>john@email.com</email>
<street1>123 Main St.</street1>
<street2>Apt 3G</street2>
<city>Anytown</city>
<state>ONT</state>
<postal_code>55555</postal_code>
<country>New Zealand</country>
<custom_date>1970-07-14</custom_date>
<custom_field>He Likes Cheese</custom_field>
<customer_username>jdoe1970</customer_username>
<registered>Y</registered>
<custom_field_2>
<label>Marital Status</label>
<data>Single</data>
</custom_field_2>
...
</customer>
<campaigns>
<campaign>
<id>1234567890123456</id>
<name>Widget Rewards</name>
<type>points</type>
<balance>1500</balance>
<cumulative>0</cumulative>
<last_transaction>2011-12-31</last_transaction>
<balance_coalition>1500</balance_coalition>
<cumulative_coalition>8350</cumulative_coalition>
<available_rewards>
<reward>
<id>678</id>
<description>Free Widget</description>
<needed_to_redeem>1000</needed_to_redeem>
<reward_id>A-345678</reward_id>
</reward>
<reward>
<id>753</id>
<description>Free bigger widget</description>
<needed_to_redeem>2500</needed_to_redeem>
</reward>
</available_rewards>
</campaign>
<campaign>
<id>0123456123456789</id>
<name>ACME Rewards</name>
<type>points</type>
<balance>1500</balance>
<cumulative>4500</cumulative>
<last_transaction>2011-12-31</last_transaction>
<balance_coalition>1500</balance_coalition>
<cumulative_coalition>8350</cumulative_coalition>
<available_rewards>
<reward>
<id>678</id>
<description>Free Widget</description>
<needed_to_redeem>1000</needed_to_redeem>
<reward_id>A-345678</reward_id>
</reward>
<reward>
<id>753</id>
<description>Free bigger widget</description>
<needed_to_redeem>2500</needed_to_redeem>
</reward>
</available_rewards>
</campaign>
</campaigns>
</response>
Notes:
XML Response if no customer matches code or card_number given:
<response status="no_match">
<message>Language-specific "No Customers Match Criteria"</message>
</response>
Error XML Response:
<response status="error">
<error>Error message</error>
</response>
Customer Balance and Transaction History
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 | ||||
type | customer_balance | Required | ||||
account_id | greatwidgets | Required | ||||
campaign_id | 1111222233334444 | Required | ||||
code or card_number |
1234567890123456 or 234566 |
Required | ||||
transactions_number | 0 for none
1 to 9999... |
Optional | ||||
across_campaigns | Yes | Optional | ||||
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'] = 'customer_balance';
$data['account_id'] = 'greatwidgets';
$data['campaign_id'] = 'Store Rewards';
$data['code'] = '1234567890123456';
or
$data['card_number'] = '29374856';
Success XML Response (Points-Based Campaign):
<response status="success">
<campaign>
<campaign_id>4857302875023023</campaign_id>
<campaign_type>points</campaign_type>
<campaign_name>Store_Rewards</campaign_name>
<customer>
<code>1234567890123456</code>
<balance>1500</balance>
<last_transaction>2011-12-15</last_transaction>
<last_redemption>2011-12-31</last_redemption>
<transactions>
<transaction>
<id>4056</id>
<date>2011-12-15</date>
<amount>20000</amount>
<orig_amount>200</orig_amount>
<redeemed>N</redeemed>
<authorization>Purchased Item</authorization>
<user_name>employee1</user_name>
</transaction>
<transaction>
<id>4097</id>
<date>2011-21-31</date>
<amount>-15000</amount>
<redeemed>Y</redeemed>
<authorization>Redeemed Item</authorization>
<user_name>employee2</user_name>
</transaction>
...
</transactions>
</customer>
</campaign>
</response>
Success XML Response (Points-Based Campaign with Spend-to-Reward ratio set):
<response status="success">
<campaign>
<campaign_id>4857302875023023</campaign_id>
<campaign_type>points</campaign_type>
<campaign_name>Store_Rewards</campaign_name>
<reward_ratio>10</reward_ratio>
<customer>
<code>1234567890123456</code>
<balance>1500</balance>
<equivalent_cash_balance>1.50</equivalent_cash_balance>
<equivalent_cash_currency>Euro</equivalent_cash_currency>
<equivalent_cash_glyph>€</equivalent_cash_glyph>
<last_transaction>2011-12-15</last_transaction>
<last_redemption>2011-12-31</last_redemption>
<transactions>
<transaction>
<id>4056</id>
<date>2011-03-15</date>
<amount>20000</amount>
<orig_amount>200</orig_amount>
<redeemed>N</redeemed>
<authorization>Purchased Item</authorization>
<user_name>employee1</user_name>
</transaction>
<transaction>
<id>4097</id>
<date>2011-12-31</date>
<amount>-50-0</amount>
<equivalent_cash_amount>-5.00</equivalent_cash_amount>
<redeemed>Y</redeemed>
<authorization>Redeemed Item</authorization>
<user_name>employee2</user_name>
</transaction>
...
</transactions>
</customer>
</campaign>
</response>
Success XML Response (Points-Based Campaign with Custom Fields):
<response status="success">
<campaign>
<campaign_id>4857302875023023</campaign_id>
<campaign_type>points</campaign_type>
<campaign_name>Store_Rewards</campaign_name>
<customer>
<code>1234567890123456</code>
<balance>1500</balance>
<equivalent_cash_balance>1.50</equivalent_cash_balance>
<equivalent_cash_currency>Euro</equivalent_cash_currency>
<equivalent_cash_glyph>€</equivalent_cash_glyph>
<last_transaction>2011-12-15</last_transaction>
<last_redemption>2011-12-31</last_redemption>
<transactions>
<transaction>
<id>4056</id>
<date>2011-12-15</date>
<amount>20000</amount>
<orig_amount>200.00</orig_amount>
<redeemed>N</redeemed>
<authorization>Purchased Item</authorization>
<user_name>employee1</user_name>
<custom_field_2>
<label>quantity</label>
<data>2</data>
</custom_field_2>
</transaction>
<transaction>
<id>4097</id>
<date>2011-12-31</date>
<amount>-5000</amount>
<redeemed>Y</redeemed>
<authorization>Redeemed Item</authorization>
<user_name>employee2</user_name>
<custom_field_2>
<label>quantity</label>
<data>1</data>
</custom_field_2>
</transaction>
...
</transactions>
</customer>
</campaign>
</response>
Success XML Response (Gift Card Campaign):
<response status="success">
<campaign>
<campaign_id>57203576293875493</campaign_id>
<campaign_type>giftcard</campaign_type>
<campaign_name>Gift Basket</campaign_name>
<customer>
<code>1234567890123456</code>
<balance>36.75</balance>
<last_transaction>2011-12-15</last_transaction>
<last_redemption>2011-12-31</last_redemption>
<transactions>
<transaction>
<id>4056</id>
<date>2011-12-15</date>
<amount>40</amount>
<redeemed>N</redeemed>
<authorization>Cash Added</authorization>
<user_name>employee2</user_name>
</transaction>
<transaction>
<id>4097</id>
<date>2011-12-31</date>
<amount>-3.25</amount>
<redeemed>Y</redeemed>
<authorization>Cash Redeemed</authorization>
<user_name>employee2</user_name>
</transaction>
...
</transactions>
</customer>
</campaign>
</response>
Success XML Response (Buy-X-Get_One-Free / Membership Campaign):
<response status="success">
<campaign>
<campaign_id>53485702387562034</campaign_id>
<campaign_type>buyx</campaign_type>
<campaign_name>Club Fantastic</campaign_name>
<customer>
<code>1234567890123456</code>
<balances>
<item>
<name>Coffees</name>
<balance>14</balance>
<earned>1</earned>
</item>
<item>
<name>Cakes</name>
<balance>7</balance>
<earned>0</earned>
</item>
<item>
<name>Books</name>
<balance>2</balance>
<earned>0</earned>
</item>
</balances>
<last_transaction>2011-12-15</last_transaction>
<last_redemption>2011-12-31</last_redemption>
<transactions>
<transaction>
<id>4056</id>
<date>2011-12-15</date>
<service_product>Coffees</service_product>
<amount>12</amount>
<redeemed>N</redeemed>
<authorization>Purchased Items</authorization>
<user_name>employee1</user_name>
</transaction>
<transaction>
<id>4097</id>
<date>2011-12-31</date>
<service_product>Cakes</service_product>
<amount>1</amount>
<redeemed>Y</redeemed>
<authorization>Redeemed Items</authorization>
<user_name>employee1</user_name>
</transaction>
...
</transactions>
</customer>
</campaign>
</response>
NOTES:
Success XML Response (Events (Visits) Based Campaign):
<response status="success">
<campaign>
<campaign_id>683979284679238</campaign_id>
<campaign_type>events</campaign_type>
<campaign_name>Frequent Shopper</campaign_name>
<customer>
<code>1234567890123456</code>
<balance>23</balance>
<last_transaction>2011-12-15</last_transaction>
<last_redemption>2011-12-31</last_redemption>
<transactions>
<transaction>
<id>4056</id>
<date>2011-12-15</date>
<amount>1</amount>
<redeemed>N</redeemed>
<authorization>Visit Note</authorization>
<user_name>employee1</user_name>
<transaction>
</transaction>
<id>4097</id>
<date>2011-12-31</date>
<amount>-10</amount>
<redeemed>Y</redeemed>
<authorization>Redeemed Reward</authorization>
<user_name>employee2</user_name>
</transaction>
...
</transactions>
</customer>
</campaign>
</response>
Success XML Response (Earn-per-Event Based Campaign):
<response status="success">
<campaign>
<campaign_id>325702938572039</campaign_id>
<campaign_type>earned</campaign_type>
<campaign_name>Referral Rewards</campaign_name>
<customer>
<code>1234567890123456</code>
<balance>105.00</balance>
<last_transaction>2011-12-15</last_transaction>
<last_redemption>2011-12-31</last_redemption>
<transactions>
<transaction>
<id>4056</id>
<date>2011-12-15</date>
<amount>4.50</amount>
<redeemed>N</redeemed>
<authorization>Event Earning</authorization>
<user_name>employee1</user_name>
</transaction>
<transaction>
<id>4097</id>
<date>2011-12-31</date>
<amount>-29.95</amount>
<redeemed>Y</redeemed>
<authorization>Redeemed reward</authorization>
<user_name>employee1</user_name>
</transaction>
...
</transactions>
</customer>
</campaign>
</response>
Error XML Response:
<response status="error">
<error>Error message</error>
</response>
Delete a Customer
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 | ||||
type | customer_delete | Required | ||||
account_id | greatwidgets | Required | ||||
code | 1234567890123456 | Required | ||||
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 |
WARNING: THIS IS A PERMANENT DELETE. THERE IS NO UNDO!
This call deletes ALL information related to that customer:
Notes:
If you want to remove more than one customer at a time, implement a loop in your code that makes this call for each customer that you want removed. This way, if the whole customer database gets erased accidentally, the fault lies with your code, not ours. :)
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'] = 'customer_delete';
$data['account_id'] = 'greatwidgets';
$data['code'] = '1234567890123456';
Success XML Response:
<response status="success">
<customer status="deleted">
<code>1234567890123456</code>
</customer>
</response>
Error XML Response:
<response status="error">
<error>Error message</error>
</response>
Customer Password Validation
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 | ||||
type | validate_customer_password | Required | ||||
account_id | greatwidgets | Required | ||||
card_number | 1212121212 | See Notes | ||||
code | 1234567890123456 | See Notes | ||||
customer_username | jdoe1970 | See Notes | ||||
customer_password | pa$$w0rd | See Notes | ||||
customer_PIN | 1234 | See Notes | ||||
phone | 5551115555 | |||||
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'] = 'validate_customer_password';
$data['account_id'] = 'greatwidgets';
$data['card_number'] = '121212121212';
$data['customer_password'] = 'pa$$w0rd';
Success XML Response (password matches the one on record):
<response status="success">
</response>
Error XML Response (password does not match the one on record):
<response status="error">
<error>Error message</error>
</response>
Customer Card Replace
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 | ||||
type | card_replace | Required | ||||
account_id | greatwidgets | Required | ||||
previous_code | 0123456789012345 | See notes | ||||
previous_card | 121212 | See notes | ||||
new_code | 1234567890123456 | See notes | ||||
new_card_number | 131313 | See notes | ||||
card_number_generate | (# of digits) | See notes | ||||
profile_uid | 395 | See notes | ||||
check_override | Y | See notes | ||||
keep_which | matched or duplicate | See notes | ||||
first_name | Jane | Optional | ||||
last_name | Doe | Optional | ||||
phone | 555-5555 | Optional | ||||
jdoe@email.com | Optional | |||||
street1 | 123 Main St. | |||||
street2 | Suite 3G | |||||
city | Anytown | Optional | ||||
state | ONT | Optional | ||||
postal_code | 55555 | Optional | ||||
country | Canada | |||||
custom_date | 1970-07-14 | Optional | ||||
custom_field | baltimore | Optional | ||||
customer_password | pa$$w0rd | Optional | ||||
customer_PIN | 1234 | Optional | ||||
customer_username | janedoe123 | Optional | ||||
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 Requests:
To replace the card number and/or code of a known card, by previous_code or by previous_card:
$data['user_id'] = 'john1970';
$data['user_password'] = '1959caadac9b13dcb3';
$data['type'] = 'card_replace';
$data['account_id'] = 'greatwidgets';
$data['previous_code'] = '012345678912345';
$data['new_card_number'] = '1231313';
To replace the card number and/or code knowing only certain data:
$data['user_id'] = 'john1970';
$data['user_password'] = '1959caadac9b13dcb3';
$data['type'] = 'card_replace';
$data['account_id'] = 'greatwidgets';
$data['last_name'] = 'Doe';
$data['phone'] = '555-55555';
$data['customer_password'] = '1234';
To replace the card number and/or code after selecting a customer from multiple matches:
$data['user_id'] = 'john1970';
$data['user_password'] = '1959caadac9b13dcb3';
$data['type'] = 'card_replace';
$data['account_id'] = 'greatwidgets';
$data['profile_uid'] = '365';
$data['new_code'] = '1234567890123456';
$data['new_card_number'] = '131313';
Success XML Response for a successful card number/code replacement:
<response status="success">
<customer>
<code>1234567890123456</code>
</customer>
</response>
Success XML Response for multiple matches:
<response status="multiple_matches">
<customers>
<customer>
<profile_uid>365</profile_uid>
<code>0123456789012345</code>
<card_number>121212</card_number>
<first_name>John</first_name>
<last_name>Doe</last_name>
<phone>555-5555</phone>
<email>jdoe@email.com</email>
<street1>123 Main St</street1>
<street2>Apt 3G</street2>
<city>Anytown</city>
<state>ONT</state>
<postal_code>55555</postal_code>
<country>Australia</country>
<custom_date>1970-07-14</custom_date>
<custom_field>Baltimore</custom_field>
</customer>
<customer>
<profile_uid>1267</profile_uid>
<code>2345678901234567</code>
<card_number>343435</card_number>
<first_name>John</first_name>
<last_name>Doe</last_name>
<phone>555-7777</phone>
<email>john.doe@workemail.com</email>
<street1>78 Side St</street1><street2>Apt 3G
<street2></street2>
<city>Bigtown</city>
<state>CA</state>
<postal_code>MX5-4F6</postal_code>
<country>Oceania</country>
<custom_date>1985-06-18</custom_date>
<custom_field></custom_field>
</customer>
...
</campaign>
</response>
XML Response if no customers matched:
<response status="no_match">
<message>Language-specific "No Customers Match Criteria"</message>
</response>
Error XML Response:
<response status="error">
<error>Error message</error>
</response>