API DOCUMENTATION Last Update: July 2025

Create New Campaign Promotion

Add a new promotion to an existing Points-based campaign.

 

Headers

  Key   Value   Note
api_access_key user_api_key Optional

 

 

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 if not included in the headers
type campaign_new Required
action promo Required
account_id greatwidgets Required
campaign_id 1234567890123456 Required
promo_operation x or + Required
promo_amount 1.25 or 100 Required
promo_description Pre-booking bonus Required
promo_custom_id XFA-275 Optional
promo_start_date 2013-08-01 00:00:00 Optional
promo_end_date 2013-08-15 23:59:59 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:

  • Headers: the user_api_key value can be included in either the header section or the body of the request. If the key is provided in both locations, the API will process and validate only the value provided in the headers.

  • The ability to create promotions is based on the permissions of the user_id that is making the call.
  • The promo_amount is based on the promo_operation chosen:
    • The "x" operation is a multiplier, so the promo_amount given will multiply the amount of points earned. For example:
      • A value of "1.25" is equivalent to adding 25% more points (100pts becomes 125pts)
      • A value of "0.5" is quivlaent to having the amount of points earned (100pts becomes 50pts)
    • The "+" operation adds the promo_amount to the points earned. For example:
      • A value of "100" will add 100 points to the amount of points earned.
      • A value of "-50" will subtract 50 points from the amount of points earned.
  • The promo_description is required in order to properly show some decriptive text in lists of promotions.
  • Only one promotion can be added at a time. Loop this call in your program to add multiple promotions at the same time.

     

    Example PHP Request:

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

    1. $data['user_id'] = 'john1970';
    2. $data['user_password'] = '1959caadac9b13dcb3';
    3. $data['type'] = 'campaign_new';
    4. $data['action'] = 'promo';
    5. $data['account_id'] = 'greatwidgets';
    6. $data['campaign_id'] = '1234567890123456';
    7. $data['promo_operation'] = 'x';
    8. $data['promo_amount'] = '1.25';
    9. $data['promo_description'] = 'Pre-booking bonus (25%)';

     

    Success XML Response:

    1. <response status="success">
    2. <campaign>
    3. <promo>
    4. <id>14</id>
    5. </promo>
    6. </campaign>
    7. </response>

    Note:

    • A successful result will return the promo_id of the promotion. This id can also be retrieved with the Campaign - List Promotions API call.

     

    Error XML Response:

    1. <response status="error">
    2. <error>Error message</error>
    3. </response>