Membership Programs - Create New
Create a new Membership Program for a business (client account). After creating a membership program you can proceed to create multiple membership levels (e.g. Basic, Silver, Gold) for that program.
The data to be submitted to the API is composed of the following fields:
|
|
field |
|
Example |
|
Note |
|
|
|
API |
|
1.5 |
|
Required |
|
|
|
user_id |
|
john1970 |
|
Required |
|
|
|
user_api_key |
|
1959caadac9b13dcb3 |
|
Required |
|
|
|
type |
|
manage_memberships |
|
Required |
|
|
|
action |
|
new |
|
Required |
|
|
|
account_id |
|
greatwidgets |
|
Required |
|
|
|
membership_program_name |
|
Amazing Rewards |
|
Required |
|
|
|
membership_style |
|
A, or B |
|
Required See notes |
|
|
|
membership_time_range |
|
6 |
|
Required |
|
|
|
membership_time_unit |
|
M |
|
Required D=Days M=Months Y=Years |
|
|
|
membership_custom_qualifier_name |
|
Nights |
|
Required only for membership type B |
|
|
|
membership_campaigns_included |
|
all, or campaign ID |
|
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:
- Membership types available: A = Based on Points Accrued (amount of points earned by the customer over a period of time). B = Based on Custom Qualifier (allows you to define a particular activity that is being tracked, example: number of nights that a customer is staying at a hotel).
- Membership customer qualifier name: The membership custom qualifier name is only requierd for membership type "B". Example: membership_custom_qualifier_name= Nights (if you are tracking how many nights a customer needs to stay at a hotel in order to qualify for a higher membership level.)
- Time range: number of days (D), months (M), or years (Y) that you want to include in order to define which customers qualify for each membership level.
- Time unit: D for days, M for months, and Y for years.
Example PHP Request:
If you are using PHP, the $data array would look like this:
- $data['API'] = '1.5';
- $data['user_id'] = 'john1970';
- $data['user_api_key'] = '1959caadac9b13dcb3';
- $data['account_id'] = 'greatwidgets';
- $data['type'] = 'manage_memberships';
- $data['action'] = 'new';
- $data['membership_program_name'] = 'Amazing Rewards'
- $data['membership_style'] = 'A';
- $data['membership_time_range'] = '12';
- $data['membership_time_unit'] = 'M';
- $data['membership_campaigns_included'] = 'all';
Success XML Response:
- <response status="success">
- <membership_program_id>5208143496464281</membership_program_id>
- </response>
Error XML Response:
- <response status="error">
- <error>Error message</error>
- </response>
|