|
Pre-Existing Report: Customer Balances
Generate a report with all the customer balances for the given campaign.
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 |
|
reports |
|
Required |
|
|
|
report |
|
customers_balances |
|
Required |
|
|
|
coalition_balance |
|
coalition_points or coalition_storedvalue |
|
Optional, see notes. |
|
|
|
campaign_id |
|
123456789012 |
|
Required |
|
|
|
offset |
|
100 |
|
Optional |
|
|
|
limit |
|
50 |
|
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:
- NEW Note: To get the Balances Report for the Points Coalition use field: coalition_balance and value: coalition_points. This will provide the customer's points balances accross the coalition. Campaigns that are marked as "opt-out" are not included.
- NEW Note: To get the Balances Report for the Gift Card Coalition use field: coalition_balance and value: coalition_storedvalue. This will provide the customer's gift card balances accross the coalition. Campaigns that are marked as "opt-out" are not included.
- Only ONE selected_campaign can be run at a time.
- The offset and limit are optional and can be used to generate paginated lists, or to limit the reporting range into more manageable chunks / lists.
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'] = 'reports';
- $data['report'] = 'customers_balances';
- $data['campaign_id'] = '123456789012';
- $data['offset'] = '100';
- $data['limit'] = '50';
Success XML Response (New / Updated User):
- <response status="success">
- <customer>
- <card_number>12345678</card_number>
- <code>173648028775637382</code>
- <first_name>Jane</first_name>
- <last_name>Doe</last_name>
- <email>jdoe@email.com</email>
- <phone>555-5555</phone>
- <address1>123 Main St.</address1>
- <address2>Apt 3G</address2>
- <city>Anytown</city>
- <state>ND</state>
- <zip>12345</zip>
- <country>NZ</country>
- <custom1>She likes cheese!</custom1>
- <custom_date>1970-07-14</custom_date>
- <customer_username>jdoe123</customer_username>
- <record_timestamp>2011-05-07 14:38:59</record_timestamp>
- <earned>6021</earned>
- <redeemed>-6001</redeemed>
- <balance>20</balance>
- <balance_equivalent>0.02</balance_equivalent>
- <earned_equivalent>6.02</earned_equivalent>
- <redeemed_equivalent>-6</redeemed_equivalent>
- </customer>
- ...
- </response>
Error XML Response:
- <response status="error">
- <error>Error message</error>
- </response>
|
|