|
Update Existing BuyX Campaign Item
Update an existing item in a "Buy X Get 1 Free" 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 |
|
|
|
type |
|
campaign_update |
|
Required |
|
|
|
action |
|
item |
|
Required |
|
|
|
account_id |
|
greatwidgets |
|
Required |
|
|
|
campaign_id |
|
1234567890123456 |
|
Required |
|
|
|
item_id |
|
234 |
|
Required |
|
|
|
new_reward_level |
|
10 |
|
Optional |
|
|
|
new_item_description |
|
Coffee or Tea |
|
Optional |
|
|
|
new_item_identifier |
|
1DF34S1 |
|
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:
- The ability to update items is based on the permissions of the user_id that is making the call.
- Only one item can be updated at a time. Loop this call in your program to add multiple items at the same time.
- This call applies only to "Buy X Get 1 Free" campaigns.
- The new_reward_level is the quantity of items that need to be purchased before the next one is free.
- If changing the Item Description by providing a new_item_description this will also update all past transactions so that it will look like previous transactions were for the same newly updated item. To keep the old description just create a new item instead.
- The new_item_identifier is an optional field that lets you specify an item ID such as a SKU.
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'] = 'campaign_update';
- $data['action'] = 'item';
- $data['account_id'] = 'greatwidgets';
- $data['campaign_id'] = '1234567890123456';
- $data['item_id'] = '234';
- $data['new_reward_level'] = '11';
- $data['new_item_description'] = 'Coffee or Tea';
- $data['new_item_identifier'] = '1DF345S1';
Success XML Response:
- <response status="success">
- <item status="updated">
- <id>14</id>
- </item>
- </response>
Note:
- A successful result will return the item_id of the item. This id can also be retrieved with the Campaign - List BuyX Items API call.
Error XML Response:
- <response status="error">
- <error>Error message</error>
- </response>
|
|