Update Existing Campaign Depreciation
Update a campaign depreciation in an existing account.
The data to be submitted to the API is composed of the following fields:
|
|
field |
|
Example |
|
Note |
|
|
|
API |
|
1.1 |
|
Required |
|
|
|
user_id |
|
john1970 |
|
Required |
|
|
|
user_password |
|
1959caadac9b13dcb3 |
|
Required |
|
|
|
type |
|
depreciation_update |
|
Required |
|
|
|
account_id |
|
greatwidgets |
|
Required |
|
|
|
campaign_id |
|
1234567890123456 |
|
Required |
|
|
|
depreciation_id |
|
346 |
|
Required |
|
|
|
depreciation_type |
|
per_transaction or
last_transaction |
|
Optional |
|
|
|
depreciation_interval |
|
18 |
|
Optional |
|
|
|
depreciation_interval_type |
|
days or
months or
years
|
|
Optional |
|
|
|
depreciation_percentage |
|
100 |
|
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 edit existing depreciations is based on the permissions of the user_id that is making the call.
- Only one depreciation can be updated at a time.
- Depreciations can only be created for Points and GiftCard (stored value) type of campaigns.
- The depreciation_interval and depreciation_interval_type specify the amount of time until points earned or stored value balance depreciate. For example "18" + "months" means that after 18 months the depreciation will apply. Or to put another way, when looking at a list of transactions, those that are over 18 months old will have the depreciation applied to them when calculating the current balance.
- The depreciation_percentage specify the percentage by which the points or stored value amount will be reduced. For example, specifying "100" means that after the depreciation interval, 100% of the earned points in an affected transaction will be depreciated (in this case, leaving the user with a balance of 0 points. Specifying two depreciations, for example, one for 25% after 1 year and another for 50% after 2 years, means that after 1 year the original amount will be depreciated by 25% (so for example, 100 points will now be worth only 75 points) and after two years, the original amount -- not the already depreciated amount -- will be depreciated by 50% (ex: the 100 points which were previously depreciated to 75 points will now be worth 50 points.)
- IMPORTANT: Please note that because a customer's transaction history will likely have redemptions of rewards mixed in with earnings of points, or stored value reductions (payments) mixed in with (re)loadings, the calculation of the current balance can get pretty complicated: Redemptions and payments are based on the balance at the time of redemption or payment and thus the amount of points needed to redeem, or stored value needed to pay, are taken from the pool of available points or stored value on a first-earned/loaded-first-used basis, NOT a first-earned/loaded-last-used basis. Once those points are used for a redemption, or stored value used for a payment, they are no longer depreciated, only the remaining available points (or stored value amount) are depreciated.
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'] = 'depreciation_update';
- $data['account_id'] = 'greatwidgets';
- $data['campaign_id'] = '1234567890123456';
- $data['depreciation_id'] = '543';
- $data['depreciation_type'] = 'last_transaction';
- $data['depreciation_interval'] = '18';
- $data['depreciation_interval_type'] = 'months';
- $data['depreciation_percentage'] = '100';
Success XML Response:
- <response status="success">
- <depreciation status="updated">
- <id>543</id>
- <type>last_transaction</type>
- <interval>18</interval>
- <interval_type>months</interval_type>
- <percentage>100</percentage>
- </depreciation>
- </response>
Error XML Response:
- <response status="error">
- <error>Error message</error>
- </response>
|