API DOCUMENTATION Last Update: Apr 2022

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:

  1. $data['user_id'] = 'john1970';
  2. $data['user_password'] = '1959caadac9b13dcb3';
  3. $data['account_id'] = 'greatwidgets';
  4. $data['type'] = 'reports';
  5. $data['report'] = 'customers_balances';
  6. $data['campaign_id'] = '123456789012';
  7. $data['offset'] = '100';
  8. $data['limit'] = '50';

 

Success XML Response (New / Updated User):

  1. <response status="success">
  2. <customer>
  3. <card_number>12345678</card_number>
  4. <code>173648028775637382</code>
  5. <first_name>Jane</first_name>
  6. <last_name>Doe</last_name>
  7. <email>jdoe@email.com</email>
  8. <phone>555-5555</phone>
  9. <address1>123 Main St.</address1>
  10. <address2>Apt 3G</address2>
  11. <city>Anytown</city>
  12. <state>ND</state>
  13. <zip>12345</zip>
  14. <country>NZ</country>
  15. <custom1>She likes cheese!</custom1>
  16. <custom_date>1970-07-14</custom_date>
  17. <customer_username>jdoe123</customer_username>
  18. <record_timestamp>2011-05-07 14:38:59</record_timestamp>
  19. <earned>6021</earned>
  20. <redeemed>-6001</redeemed>
  21. <balance>20</balance>
  22. <balance_equivalent>0.02</balance_equivalent>
  23. <earned_equivalent>6.02</earned_equivalent>
  24. <redeemed_equivalent>-6</redeemed_equivalent>
  25. </customer>
  26. ...
  27. </response>

 

Error XML Response:

  1. <response status="error">
  2. <error>Error message</error>
  3. </response>