Record a transaction for a customer account.
See moreRecord a redemption transaction for a customer account.
See moreRecord a batch of transactions for a customer account, including redemptions.
See moreDeletes a specific transaction in a customer account.
See more 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 |
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:
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:
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>
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 |
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:
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>
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:
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:
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:
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:
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:
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:
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>
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:
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>