Record Transaction

Record a transaction for a customer account.

See more

Redemption Transaction

Record a redemption transaction for a customer account.

See more

Batch Transactions

Record a batch of transactions for a customer account, including redemptions.

See more

Delete a Transaction

Deletes a specific transaction in a customer account.

See more
Back to Top

Record Transaction

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_activity Required
account_id 1111222233334444 Required
code
or
card_number
1234567890123456

11112222
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

Fields for Points-Based Campaigns:

field Example Note
campaign_id 1111222233334444 Required
amount 9.95 or 9,95 Optional
promo_id 89 Do not include if none
authorization Custom description Optional
send_transaction_email Y Do not include
if none to be sent.
custom_field_# Store 35 See Notes below.
custom_field_# 238479237t2t3 See Notes below.
...

Fields for Gift-Card Campaigns:

field Example Note
campaign_id 22223333444455555 Required
amount 9.95 or 9,95 Required
authorization Custom description Optional
send_transaction_email Y Do not include
if none to be sent.
custom_field_# Store 35 See Notes below.
custom_field_# 238479237t2t3 See Notes below.
...

Fields for Buy-X-Get-One-Free / Membership Campaigns:

field Example Note
campaign_id 5555666677778888 Required
service_product 96

or

item_identifier

Required
buyx_quantity 10 Optional
authorization Custom description Optional
send_transaction_email Y Do not include
if none to be sent.
custom_field_# Store 35 See Notes below.
custom_field_# 238479237t2t3 See Notes below.
...

Fields for Events (Visits) Based Campaigns:

field Example Note
campaign_id 3333444455556666 Required
authorization Custom description Optional
send_transaction_email Y Do not include
if none to be sent.
custom_field_# Store 35 See Notes below.
custom_field_# 238479237t2t3 See Notes below.
...

Fields for Earn-per-Event (Visits) Campaigns:

field Example Note
campaign_id 4444555566667777 Required
authorization Custom description Optional
send_transaction_email Y Do not include
if none to be sent.
custom_field_# Store 35 See Notes below.
custom_field_# 238479237t2t3 See Notes below.
...

Notes:

  • 'When using this call and using the 'code' parameter to identify a customer, the 'code' MUST be the unique Customer ID that was either
    • passed as 'code=' by your program when the customer record was created previously, or
    • the 16-digit number that was generated by us when the customer account was created and returned to you in the API response.
    Otherwise, pass the customer's card number or memnbership identifier as the 'card_number'.
  • If you don't know what either the code or card_number are, you can search for a customer using any of their information (like phone #, or other custom field marked as "searchable" by using the customer_search or customer_find API calls to retrieve the customer's code.
  • New customer accounts are automatically created when a transaction is received and the account/card code is not in the system already.
  • The field values promo_id for Points campaigns and service_product for BuyX campaigns can be found by calling the Campaign Promotions and BuyX Campaign Items List API calls.
  • For coalition accounts, the balance for each campaign will be the coalition balance, not the individual campaign balance. Hence the totals of the transactions for each campaign may not add up to the coalition balance, since the customer may have multiple transactions in multiple campaign(s).
  • To know what the custom_field_# of a custom field is, issue the Transactions Fields - List API call to get a list of the current defined custom transaction fields.

Example PHP Request for Points-Based Campaign:

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


              $data['user_id'] = 'john1970';
              $data['user_password'] = '1959caadac9b13dcb3'; 
              $data['type'] = 'record_activity';
              $data['account_id'] = 'greatwidgets';
              $data['code'] = '1234567890123456';
              $data['campaign_id'] = '1111222233334444';
              $data['amount'] = '9.95';
              $data['promo_id'] = '89';
              $data['authorization'] = 'Custom description';
              $data['custom_field_2'] = 'Store 35';
              $data['custom_field_5'] = 'Some other data';
              $data['send_transaction_email'] = 'Y';
          

Success XML Response for Points Campaign:

Note: The response XML will include information that can be used to print a receipt:


              <response status="success">
                  <receipt>
                      <account_name>Demo Business</account_name>
                      <campaign>
                          <id>1111222233334444</id>
                          <name>Widget Rewards</name>
                      </campaign>
                      <customer>
                          <first_name>John</first_name>
                          <last_name>Smmith</last_name>
                          <card_number>11112222</card_number>
                          <phone>555-5555</phone>
                          <email>jsmith@workemail.com</email>
                          <custom_field>He likes cheese</custom_field>
                          <custom_date>1970-07-14</custom_date>
                      </customer>
                      <transaction>
                          <id>1234</id>
                          <purchase>
                              <amount>9.95</amount>
                              <currency>USD</currency>
                          </purchase>
                          <promotion>
                              <description>Double Points Tuesday</description>
                              <operation>x</operation>
                              <amount>2</amount>
                          </promotion>
                          <recorded>
                              <points>1990</points>
                              <description>Optional note here</description>
                          </recorded>
                          <balance>
                              <points>4590</points>
                              <monetary>4.75</monetary>
                              <currency>USD</currency>
                          </balance>
                          <cumulative_balance>
                              <points>78390</points>
                              <monetary>43.50</monetary>
                              <currency>USD</currency>
                          </cumulative_balance>
                      </transaction>
                  </receipt>
              </response>
          

Notes:

  • 'The operation in the promotion describes either a multiplication (x) or addition (+)

Success XML Response for Gift Card Campaign:

Note: The response XML will include information that can be used to print a receipt:


              <response status="success">
                  <receipt>
                      <account_name>Demo Business</account_name>
                      <campaign>
                          <id>2222333344445555</id>
                          <name>Gift Card</name>
                      </campaign>
                      <customer>
                          <first_name>John</first_name>
                          <last_name>Smmith</last_name>
                          <card_number>11112222</card_number>
                          <phone>555-5555</phone>
                          <email>jsmith@workemail.com</email>
                          <custom_field>He likes cheese</custom_field>
                          <custom_date>1970-07-14</custom_date>
                      </customer>
                      <transaction>
                          <id>1234</id>
                          <add>
                              <amount>9.95</amount>
                              <currency>USD</currency>
                              <description>Optional note here</description>
                          </add>
                          <balance>
                              <amount>48.75</amount>
                              <currency>USD</currency>
                          </balance>
                          <cumulative_balance>
                              <amount>413.50</amount>
                              <currency>USD</currency>
                          </cumulative_balance>
                      </transaction>
                  </receipt>
              </response>
          

Success XML Response for Events Campaign:

Note: The response XML will include information that can be used to print a receipt:


              <response status="success">
                  <receipt>
                      <account_name>Demo Business</account_name>
                      <campaign>
                          <id>3333444455556666</id>
                          <name>Frequent Shopper</name>
                      </campaign>
                      <customer>
                          <first_name>John</first_name>
                          <last_name>Smmith</last_name>
                          <card_number>11112222</card_number>
                          <phone>555-5555</phone>
                          <email>jsmith@workemail.com</email>
                          <custom_field>He likes cheese</custom_field>
                          <custom_date>1970-07-14</custom_date>
                      </customer>
                      <transaction>
                          <id>1234</id>
                          <event>
                              <description>Optional note here</description>
                              <amount>9.95</amount>
                          </event>
                          <balance>
                            <events>12</events>
                          </balance>
                          <cumulative_balance>
                            <events>25</events>
                          </cumulative_balance>
                      </transaction>
                  </receipt>
              </response>
          

Success XML Response for Earn-per-Event Campaign:

Note: The response XML will include information that can be used to print a receipt:


              <response status="success">
                  <receipt>
                      <account_name>Demo Business</account_name>
                      <campaign>
                          <id>4444555566667777</id>
                          <name>GateKeeper Rewards</name>
                      </campaign>
                      <customer>
                          <first_name>John</first_name>
                          <last_name>Smmith</last_name>
                          <card_number>11112222</card_number>
                          <phone>555-5555</phone>
                          <email>jsmith@workemail.com</email>
                          <custom_field>He likes cheese</custom_field>
                          <custom_date>1970-07-14</custom_date>
                      </customer>
                      <transaction>
                          <id>1234</id>
                          <event>
                            <description>Optional note here</description>
                          </event>
                          <earn>
                              <amount>4.50</amount>
                              <currency>USD</currency>
                          </earn>
                          <balance>
                              <amount>22.50</amount>
                              <currency>USD</currency>
                          </balance>
                          <cumulative_balance>
                              <amount>45.00</amount>
                              <currency>USD</currency>
                        </cumulative_balance>
                      </transaction>
                  </receipt>
              </response>
          

Success XML Response for Buy-X-Get-One-Free Campaign:

Note: The response XML will include information that can be used to print a receipt:


              <response status="success">
                  <receipt>
                      <account_name>Demo Business</account_name>
                      <campaign>
                          <id>5555666677778888</id>
                          <name>Widget Rewards</name>
                      </campaign>
                      <customer>
                          <first_name>John</first_name>
                          <last_name>Smmith</last_name>
                          <card_number>11112222</card_number>
                          <phone>555-5555</phone>
                          <email>jsmith@workemail.com</email>
                          <custom_field>He likes cheese</custom_field>
                          <custom_date>1970-07-14</custom_date>
                      </customer>
                      <transaction>
                          <id>1234</id>
                          <purchase>
                              <item>Books</item>
                              <quantity>2</quantity>
                              <description>Optional note here</description>
                          </purchase>
                          <balances>
                              <item>
                                  <name>Books</name>
                                  <current>14</current>
                                  <cumulative>14</cumulative>
                              </item>
                              <item>
                                  <name>Coffees & Teas</name>
                                  <current>6</current>
                                  <cumulative>43</cumulative>
                              </item>
                              <item>
                                  <name>Cakes & Cookies</name>
                                  <current>2</current>
                                  <cumulative>12</cumulative>
                              </item>
                              ...
                          </balances>
                      </transaction>
                  </receipt>
              </response>
          

Error XML Response:


              <response status="error">
                <error>Error message</error>
              </response>
          
Back to Top

Redemption Transaction

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 redeem 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

Fields for Points-Based Campaigns:

field Example Note
campaign_id 1111222233334444 Required
custom_points_redeem 100 \
\ Required: At least
/ one of these three
./
custom_dollars_redeem 9.95 or 9,95
reward_to_redeem 98
authorization Custom description Optional

Note: Use the campaign_rewards API call to list the available rewards and their IDs

Fields for Gift-Card Campaigns:

field Example Note
campaign_id Gift Basket Required
reward_to_redeem 9.95 or 9,95 Required
authorization Custom description Optional

Fields for Buy-X-Get-One-Free / Membership Campaigns:

field Example Note
campaign_id Club Fantastic Required
reward_to_redeem 96 (the item_id)

or

[item_identifier]

Required
See note below
authorization Custom description Optional

Note: Use the buyx_items_list API call to list available items and their IDs.

Fields for Events (Visits) Based Campaigns:

field Example Note
campaign_id Frequent Shopper Required
reward_to_redeem 41 Required
See note below
authorization Custom description Optional

Note: Use the campaign_rewards API call to list the available rewards and their IDs

Fields for Earn-per-Event (Visits) Campaigns:

field Example Note
campaign_id Referral Rewards Required
reward_to_redeem 9.95 or 9,95 Required
authorization Custom description Optional

Notes:

  • 'When using this call, the 'code' MUST be the unique Customer ID that was either
    • passed as 'code' by your program when the customer record was created previously, or
    • the 16-digit number that was generated by us and returned to you in the API response.
  • Before making this call, you should check whether the customer balance is greater than the amount to be redeemed.
  • The reward_to_redeem field value is the <id> parameter that is returned in the response of the Campaign Rewards call -- OR the optional <reward_id> that is defined in the Campaign - New BuyX Item and Campaign - Edit BuyX Item API calls.
  • For coalition accounts, the balance for each campaign will be the coalition balance, not the individual campaign balance. Hence the totals of the transactions for each campaign may not add up to the coalition balance, since the customer may have multiple transactions in multiple campaign(s).

Example PHP Requests:

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

Points-Based Campaign - Pre-defined Reward:


              $data['user_id'] = 'john1970';
              $data['user_password'] = '1959caadac9b13dcb3'; 
              $data['type'] = 'redeem';
              $data['account_id'] = 'greatwidgets';
              $data['code'] = '1234567890123456';
              $data['campaign_id'] = '546734563456';
              $data['reward_to_redeem'] = '98';
              $data['authorization'] = 'Custom description';
          

Points-Based Campaign - Custom Points:


              $data['user_id'] = 'john1970';
              $data['user_password'] = '1959caadac9b13dcb3'; 
              $data['type'] = 'redeem';
              $data['account_id'] = 'greatwidgets';
              $data['code'] = '1234567890123456';
              $data['campaign_id'] = '546734563456';
              $data['custom_points_redeem'] = '100';
              $data['authorization'] = 'Custom description';
          

Points-Based Campaign - Monetary Amount:

Note: This capability is available ONLY if you have set a Spend-to-Reward Ratio in the point campaign's preferences.


              $data['user_id'] = 'john1970';
              $data['user_password'] = '1959caadac9b13dcb3'; 
              $data['type'] = 'redeem';
              $data['account_id'] = 'greatwidgets';
              $data['code'] = '1234567890123456';
              $data['campaign_id'] = '546734563456';
              $data['custom_dollars_redeem'] = '9.95';
              $data['authorization'] = 'Custom description';
          

Points-Based Campaign - Combination of reward types:

Note: Only one of each type can be used per call, abs the custom_dollars_redeem capability is available ONLY if you have set a Spend-to-Reward Ratio in the point campaign's preferences.


              $data['user_id'] = 'john1970';
              $data['user_password'] = '1959caadac9b13dcb3'; 
              $data['type'] = 'redeem';
              $data['account_id'] = 'greatwidgets';
              $data['code'] = '1234567890123456';
              $data['campaign_id'] = '546734563456';
              $data['reward_to_redeem'] = '98';
              $data['custom_points_redeem'] = '100';
              $data['custom_dollars_redeem'] = '9.95';
              $data['authorization'] = 'Custom description';
          

Gift Card Campaign:


              $data['user_id'] = 'john1970';
              $data['user_password'] = '1959caadac9b13dcb3'; 
              $data['type'] = 'redeem';
              $data['account_id'] = 'greatwidgets';
              $data['code'] = '1234567890123456';
              $data['campaign_id'] = '83635463645756';
              $data['reward_to_redeem'] = '9.95';
              $data['authorization'] = 'Custom description';
          

Buy-X-Get-One-Free Campaign:


              $data['user_id'] = 'john1970';
              $data['user_password'] = '1959caadac9b13dcb3'; 
              $data['type'] = 'redeem';
              $data['account_id'] = 'greatwidgets';
              $data['code'] = '1234567890123456';
              $data['campaign_id'] = '763446467657';
              $data['reward_to_redeem'] = '96';
              $data['authorization'] = 'Custom description';
          

Events-Based Campaign:


              $data['user_id'] = 'john1970';
              $data['user_password'] = '1959caadac9b13dcb3'; 
              $data['type'] = 'redeem';
              $data['account_id'] = 'greatwidgets';
              $data['code'] = '1234567890123456';
              $data['campaign_id'] = '763446467657';
              $data['reward_to_redeem'] = '41';
              $data['authorization'] = 'Custom description';
          

Earn-per-Event Campaign:


              $data['user_id'] = 'john1970';
              $data['user_password'] = '1959caadac9b13dcb3'; 
              $data['type'] = 'redeem';
              $data['account_id'] = 'greatwidgets';
              $data['code'] = '1234567890123456';
              $data['campaign_id'] = '2355464634565';
              $data['reward_to_redeem'] = '9.95';
              $data['authorization'] = 'Custom description';
          

Success XML Responses

Note: The response XML will include information that can be used to print a receipt.

For Points Campaign:


              <response status="success">
                  <receipt>
                      <account_name>Demo Business</account_name>
                      <agency>
                          <id>acmemktg</id>
                          <name>ACME Marketing</name>
                          <email>server@acmemarkting.com</email>
                      </agency>
                      <campaign>
                          <id>463789753832</id>
                          <name>Widget Rewards</name>
                      </campaign>
                      <customer>
                          <first_name>Jane</first_name>
                          <last_name>Doe</last_name>
                          <card_number>11112222</card_number>
                          <phone>555-5555</phone>
                          <email>jdoe@workemail.com</email>
                          <custom_field>She likes cheese</custom_field>
                          <custom_date>1970-07-14</custom_date>
                      </customer>
                      <transaction>
                          <id>1234</id>
                          <description>Optional note here</description>
                          <reward>
                              <id>98</id>
                              <points>100</points>
                              <description>Free Widget!</description>
                          </reward>
                          <custom>
                            <points>150</points>
                          </custom>
                          <monetary>
                              <amount>9.90</points>
                              <currency>USD</currency>
                              <points>1990</points>
                          </monetary>
                          <balance>
                              <points>4590</points>
                              <monetary>4.75</monetary>
                              <currency>USD</currency>
                          </balance>
                          <cumulative_balance>
                              <points>78390</points>
                              <monetary>43.50</monetary>
                              <currency>USD</currency>
                          </cumulative_balance>
                      </transaction>
                  </receipt>
              </response>
          

For Gift Card Campaign:


              <response status="success">
                  <receipt>
                      <account_name>Demo Business</account_name>
                      <agency>
                          <id>acmemktg</id>
                          <name>ACME Marketing</name>
                          <email>server@acmemarkting.com</email>
                      </agency>
                      <campaign>
                          <id>7456756743563456</id>
                          <name>Gift Card</name>
                      </campaign>
                      <customer>
                          <first_name>Jane</first_name>
                          <last_name>Doe</last_name>
                          <card_number>11112222</card_number>
                          <phone>555-5555</phone>
                          <email>jdoe@workemail.com</email>
                          <custom_field>She likes cheese</custom_field>
                          <custom_date>1970-07-14</custom_date>
                      </customer>
                      <transaction>
                          <id>1234</id>
                          <deduct>
                              <amount>14.95</amount>
                              <currency>USD</currency>
                              <description>Optional note here</description>
                          </deduct>
                          <balance>
                              <amount>40.75</amount>
                              <currency>USD</currency>
                          </balance>
                          <cumulative_balance>
                              <amount>413.50</amount>
                              <currency>USD</currency>
                          </cumulative_balance>
                      </transaction>
                  </receipt>
              </response>
          

For Events Campaign:


              <response status="success">
                  <receipt>
                      <account_name>Demo Business</account_name>
                      <agency>
                          <id>acmemktg</id>
                          <name>ACME Marketing</name>
                          <email>server@acmemarkting.com</email>
                      </agency>
                      <campaign>
                          <id>6576327476742</id>
                          <name>Frequent Shopper</name>
                      </campaign>
                      <customer>
                          <first_name>Jane</first_name>
                          <last_name>Doe</last_name>
                          <card_number>11112222</card_number>
                          <phone>555-5555</phone>
                          <email>jdoe@workemail.com</email>
                          <custom_field>She likes cheese</custom_field>
                          <custom_date>1970-07-14</custom_date>
                      </customer>
                      <transaction>
                          <id>1234</id>
                          <description>Optional note here</description>
                          <reward>
                              <id>41</id>
                              <amount>9</amount>
                              <description>Free Widget!</description>
                          </reward>
                          <balance>
                            <events>12</events>
                          </balance>
                          <cumulative_balance>
                            <events>25</events>
                          </cumulative_balance>
                      </transaction>
                  </receipt>
              </response>
          

For Earn-per-Event Campaign:


              <response status="success">
                  <receipt>
                      <account_name>Demo Business</account_name>
                      <agency>
                          <id>acmemktg</id>
                          <name>ACME Marketing</name>
                          <email>server@acmemarkting.com</email>
                      </agency>
                      <campaign>
                          <id>8875483453453</id>
                          <name>GateKeeper Rewards</name>
                      </campaign>
                      <customer>
                          <first_name>Jane</first_name>
                          <last_name>Doe</last_name>
                          <card_number>11112222</card_number>
                          <phone>555-5555</phone>
                          <email>jdoe@workemail.com</email>
                          <custom_field>She likes cheese</custom_field>
                          <custom_date>1970-07-14</custom_date>
                      </customer>
                      <transaction>
                          <id>1234</id>
                          <deduct>
                              <amount>14.95</amount>
                              <currency>USD</currency>
                            <description>Optional note here</description>
                          </deduct>
                          <balance>
                              <amount>22.50</amount>
                              <currency>USD</currency>
                          </balance>
                          <cumulative_balance>
                              <amount>45.00</amount>
                              <currency>USD</currency>
                          </cumulative_balance>
                      </transaction>
                  </receipt>
              </response>
          

For Buy-X-Get-One-Free Campaign:


              <response status="success">
                  <receipt>
                      <account_name>Demo Business</account_name>
                      <agency>
                          <id>acmemktg</id>
                          <name>ACME Marketing</name>
                        <email>server@acmemarkting.com</email>
                      </agency>
                      <campaign>
                          <id>67434675463456</id>
                          <name>Frequent Buyer Rewards</name>
                      </campaign>
                      <customer>
                          <first_name>Jane</first_name>
                          <last_name>Doe</last_name>
                          <card_number>11112222</card_number>
                          <phone>555-5555</phone>
                          <email>jdoe@workemail.com</email>
                          <custom_field>She likes cheese</custom_field>
                          <custom_date>1970-07-14</custom_date>
                      </customer>
                      <transaction>
                          <id>1234</id>
                          <description>Optional note here</description>
                          <reward>
                              <service_product>Books</service_product>
                              <deduct>10</deduct>
                          </reward>
                          <balances>
                              <item>
                              <name>Books</name>
                                  <current>14</current>
                                  <cumulative>14</cumulative>
                              </item>
                              <item>
                                  <name>Coffees & Teas</name>
                                  <current>6</current>
                                  <cumulative>43</cumulative>
                              </item>
                              <item>
                                  <name>Cakes & Cookies</name>
                                  <current>2</current>
                                  <cumulative>12</cumulative>
                              </item>
                              ...
                          </balances>
                      </transaction>
                  </receipt>
              </response>
          

Error XML Response:


              <response status="error">
                <error>Error message</error>
              </response>
          
Back to Top

Batch Transactions

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

field Example Note
API 1.5
user_id john1970 Required
user_api_key 1959caadac9b13dcb3 Required
account_id greatwidgets Required
type batch_transactions Required
Required
delimiter pipe or comma or tab Required
apply_ratio yes or no Optional: See Notes
allow-undo yes Optional: 'yes' or don't include.
send_transaction_email Y Optional: 'Y' 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

General Notes:

  • If apply_ratio is not given or is set to "no":
    • Points Campaigns:
      • Add transaction: amount = points
      • Redemptions: amount = points
    • Giftcard Campaigns:
      • Add transaction: amount = monetary value.
      • Redemptions: amount = monetary value.
    • Events Campaigns:
      • Add transaction: amount = number of events.
      • Redemptions: amount = number of events.
    • Earned Campaigns:
      • Add transaction: amount = monetary value.
      • Redemptions: amount = monetary value.
    • BuyX Campaings:
      • Add transaction: amount = number of items purchased
      • Redemptions: amount = accumulated items to deduct, NOT: number of items redeemed.
  • If apply_ratio is given as "yes":
    • Points Campaigns:
      • Add transaction: amount = monetary value (which will be converted into points)
      • Redemptions: amount = reward unique_id or reward_id (which will be converted into points)
    • Giftcard Campaigns:
      • (apply_ratio not applicable.)
    • Event Campaigns:
      • Add transaction: amount = number of events.
      • Redemptions: amount = reward unique_id or reward_id (which will be converted into accumulated events to be deducted)
    • Earned Campaigns:
      • Add transaction: amount = events (which will be converted into monetary value)
      • Redemptions: amount = monetary value.
    • BuyX Campaings: amount given will be assumed to be:
      • Purchases: amount = number of items purchased
      • Redemptions: amount = number of items redeemed (which will be converted into accumulated items to be deducted)
  • Unless there's a good reason, don't include the 'allow-undo' = 'yes' directive, otherwise every batch will be listed as an "undo-able" entry in the Manage Customer Records section of the Dashboard.
  • Dates should be provided in ISO format: YYYY-MM-DD (ISO-8601)

Fields for Points-Based Campaigns:

field Example Note
visits_header_1 campaign_id Required
visits_header_2 code Required
visits_header_3 redeemed Required: Y | N
visits_header_4 amount Required: if not used
set value to none
visits_header_5 date Required: if not used
set value to none
visits_header_6 authorization Required: if not used
set value to none
visits_header_7 promo_id Optional. Single ID or
separated by commas
Visits_Data (see below)
Data to be imported in batch: single (text) field with <eol>s at the end of each line:

1111222233334444|12121|N|14,95|2013-0315|API test import 1|123

1111222233334444|12121|N|50|2010-03-15|API test import 2|345,345,354

1111222233334444|12121|N|34.67|2010-03-15|API test import 3

1111222233334444|12121|N|0,50|2010-03-15|API test import 4

1111222233334444|12121|N|.75|2010-03-15|API test import 5

1111222233334444|12121|N|2.00|2010-03-15|API test import 6

1111222233334444|12121|Y|1500|2010-03-15|API test redeem 1

Notes:

  • 'code' is either
    • the unique Customer ID recored in the 'code' field when the customer account was first created AND there was no 'card_number'), or
    • the 'card_number' of the customer.
  • If date is not given, today's date will be used.
  • If promo_id is used, and multiple given and separated by commas, DO NOT USE comma as delimiter (duh!)

Fields for Gift-Card Campaigns:

field Example Note
visits_header_1 campaign_id Required
visits_header_2 code Required
visits_header_3 redeemed Required: Y | N
visits_header_4 amount Required: if not used
set value to none
visits_header_5 date Required: if not used
set value to none
visits_header_6 authorization Required: if not used
set value to none
Visits_Data (see below)
Data to be imported in batch: single (text) field with <eol>s at the end of each line:

1111222233334444|12121|N|14,95|2010-03-15|API test import 1

1111222233334444|12121|N|34.67|2010-03-15|API test import 2

1111222233334444|12121|Y|49.62|2010-03-15|API test redeem 1

Notes:

  • 'code' is either
    • the unique Customer ID recored in the 'code' field when the customer account was first created AND there was no 'card_number'), or
    • the 'card_number' of the customer.
  • If date is not given, today's date will be used.

Fields for Buy-X-Get-One-Free / Membership Campaigns:

field Example Note
visits_header_1 campaign_id Required
visits_header_2 code Required
visits_header_3 redeemed Required: Y | N
visits_header_4 service_product Required
visits_header_5 amount Required: if not used
set value to none
visits_header_6 date Required: if not used
set value to none
visits_header_7 authorization Required: if not used
set value to none
Visits_Data (see below)
Data to be imported in batch: single (text) field with <eol>s at the end of each line:

1111222233334444|12121|N|Coffees|3|2010-03-15|API test import 1

1111222233334444|12121|N|Cakes|1|2010-03-15|API test import 2

1111222233334444|12121|Y|Coffees|1|2010-03-15|API test redeem 1

Notes:

  • 'code' is either
    • the unique Customer ID recored in the 'code' field when the customer account was first created AND there was no 'card_number'), or
    • the 'card_number' of the customer.
  • If date is not given, today's date will be used.
  • 'service_product' is not the "id" but the "description" of the Item returned by the BuyX Campaign Items List API call. This is because some clients import lists of transaction with items they did not pre-enter in the admin interface. Thus, the import does allows new (service_product) items to be used that have not been pre-defined.
  • The caveat is that each service_product name must be exactly spelled and capitalized the same, usually not an issue when that information is taken from another database or output from a POS or inventory management system.

Fields for Events (Visits) Based Campaigns:

field Example Note
visits_header_1 campaign_id Required
visits_header_2 code Required
visits_header_3 redeemed Required: Y | N
visits_header_4 date Required: if not used
set value to none
visits_header_5 authorization Required: if not used
set value to none
visits_header_6 amount If redeemed = Y then Required
else set array key to none
Visits_Data (see below)
Events to be imported in batch: single (text) field with <eol>s at the end of each line:

1111222233334444|12121|N|2010-03-15|API add event

1111222233334444|12121|N|2010-03-15|API add event

Redemptions to be imported in batch: Single (text) field with <eol>s at end of each line:
1111222233334444|12121|Y|2010-03-15|API redeem|2

Notes:

  • 'code' is either
    • the unique Customer ID recored in the 'code' field when the customer account was first created AND there was no 'card_number'), or
    • the 'card_number' of the customer.
  • If date is not given, today's date will be used.

Fields for Earn-per-Event (Visits) Campaigns:

field Example Note
visits_header_1 campaign_id Required
visits_header_2 code Required
visits_header_3 redeemed Required: Y | N
visits_header_4 date Required: if not used
set value to none
visits_header_5 authorization Required: if not used
set value to none
visits_header_6 amount If redeemed = Y then Required
else set array key to none
Visits_Data (see below)
Events to be imported in batch: single (text) field with <eol>s at the end of each line:

1111222233334444|12121|N|2010-03-15|API add event

1111222233334444|12121|N|2010-03-15|API add event

Redemptions to be imported in batch: single (text) field with <eol>s at end of each line:
1111222233334444|12121|Y|2010-03-15|API redeem|46.95

Notes:

  • 'code' is either
    • the unique Customer ID recored in the 'code' field when the customer account was first created AND there was no 'card_number'), or
    • the 'card_number' of the customer.
  • If date is not given, today's date will be used.

Example PHP Request for Points-Based Campaign:

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


              $data['API'] = '1.5';
              $data['user_id'] = 'john1970';
              $data['user_api_key'] = '1959caadac9a8f7e42938a7b13dcb3'; 
              $data['account_id'] = 'greatwidgets';
              $data['type'] = 'batch_transactions';
              $data['delimiter'] = 'pipe';
              $data['apply_ratio'] = 'yes';
              $data['allow-undo'] = 'yes';
              $data['visits_header_1'] = 'campaign_id';
              $data['visits_header_2'] = 'code';
              $data['visits_header_3'] = 'redeemed';
              $data['visits_header_4'] = 'amount';
              $data['visits_header_5'] = 'date';
              $data['visits_header_6'] = 'custom_field_3';
              $data['Visits_Data'] = '
              4638472975924871|12121|N|14,95|2010-03-15|API test import 1
              4638472975924871|12121|N|50|2010-03-15|API test import 2
              4638472975924871|12121|N|34.67|2010-03-15|API test import 3
              4638472975924871|12121|N|0,50|2010-03-15|API test import 4
              4638472975924871|12121|N|.75|2010-03-15|API test import 5
              4638472975924871|12121|N|2.00|2010-03-15|API test import 6
              4638472975924871|12121|Y|1500|2010-03-15|API test redeem 1
              ';
          

Success XML Response:


              <response status="success">
                  <batch status="all_imported">
                    <transactions>7</transactions>
                  </batch>
              </response>
          

Error XML Response:


              <response status="error">
                <error>Error message</error>
              </response>
          
Back to Top

Delete a Transaction

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 transaction_delete Required
account_id greatwidgets Required
campaign_id 4564222953051300 Required
code 1234567890123456 Required
transaction_id 4056 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

Notes:

  • 'When using this call, you need to specificy the campaign_id the transaction belongs to, the customer code the transaction is for, and the transaction_id of the transaction itself to identify the transaction and to avoid accidental removal of the wrong transaction.
  • Deleting transactions can severely mess up a customer's balance IF there are subsequent redemptions that are based on the transaction's impact on the customer balance at the time the redemption occurred. Deleting transactions in an campaign that has depreciation or recurring fees can similarly severly and negatively impact subsequent balances.
  • Transactions that are the result of Depreciations or Recurring Fees CANNOT be deleted as they are created on the fly, and not recorded as a physical event.
  • Only one transaction can be deleted at a time. To delete more than one transaction at a time, use a loop in your code to itterate through each transaction and make the API call to delete it.

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'] = 'transaction_delete';
              $data['account_id'] = 'greatwidgets';
              $data['campaign_id'] = '4564222953051300';
              $data['code'] = '1234567890123456';
              $data['transaction_id'] = '4056';
          

Success XML Response for Points Campaign:


              <response status="success">
              </response>
          

Error XML Response:


              <response status="error">
                <error>Error message</error>
              </response>