API DOCUMENTATION Last Update: Apr 2022

Manage Transaction Fields - List Custom Fields

List all the custom fields used when recording customer transactions:

 

The data to be submitted to the API is composed of the following fields:

 

  field   Example   Note
API 1.6 Required
user_id john1970 Required
user_api_key 1959caadac9b13dcb3 Required
account_id greatwidgets Required
type transaction_fields Required
action list 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

  

NOTE:

  • Almost all users can access this call.
  • This call returns ONLY the ADDITIONAL custom fields, and NOT the regular predefined ones.
    ie: Only fields whose field_name conform to the custom_field_# format are returned.

Example PHP Request:

If you are using PHP, the $data array would look like this:

  1. $data['API'] = '1.5';
  2. $data['user_id'] = 'john1970';
  3. $data['user_api_key'] = '1959caadac9b13dcb3';
  4. $data['account_id'] = 'greatwidgets';
  5. $data['type'] = 'transaction_fields';
  6. $data['action'] = 'list';

 

Success XML Response (lists ONLY the custom fields added):

  1. <response status="success">
  2. <account>
  3. <account_id>test2009050502</account_id>
  4. <fields>
  5. <field>
  6. <name>custom_field_1</name>
  7. <label>Customer ID</label>
  8. <show>Y</show>
  9. <type>Text</type>
  10. <unique>Yes</unique>
  11. </field>
  12. <field>
  13. <name>custom_field_2</name>
  14. <label>Tags</label>
  15. <show>Y</show>
  16. <type>List</type>
  17. <choices>
  18. <choice>Tag A</choice>
  19. <choice>Tag B</choice>
  20. <choice>Tag C</choice>
  21. </choice>
  22. </field>
  23. <field>
  24. <name>custom_field_3</name>
  25. <label>Condition</label>
  26. <show>Y</show>
  27. <type>Pick</type>
  28. <choices>
  29. <choice>New</choice>
  30. <choice>Used</choice>
  31. <choice>Other</choice>
  32. </choice>
  33. </field>
  34. <field>
  35. <name>custom_field_4</name>
  36. <label>Expiration Date</label>
  37. <show>Y</show>
  38. <type>Date</type>
  39. </field>
  40. <field>
  41. <name>custom_field_5</name>
  42. <label>Kilograms</label>
  43. <show>Y</show>
  44. <type>Number</type>
  45. <activity_type>redeem</activity_type>
  46. </field>
  47. </fields>
  48. </account>
  49. </response>

 

NOTE:

  • The <show> response indicates whether or not this field ought to be shown or not. Usually fields with "N" will have nothing in them. However, it is allowed to add content to any defined field through the API regardless of their <show> status.

 

Error XML Response:

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