create_promotion_m Sample Call and Response
This example shows a call to create_promotion_m that creates a new promotion code and attaches it to an existing promotional plan set, with an expiration window instead of a fixed usage count. It is based on methods_m_r73.yml, Admin Tools API.
This example covers the promotion code, its description, the promotional plan set it belongs to, and its validity window; it does not cover create_promo_plan_set_m, the separate method used to create the plan set that promo_plan_set_no references, which must already exist before this call succeeds.
Sample call
{
"rest_call": "create_promotion_m",
"output_format": "json",
"client_no": 10023,
"auth_key": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
"promo_cd": "WINTER2026",
"promo_desc": "Winter 2026 bundle discount promotion",
"promo_plan_set_no": 6612,
"start_date": "2026-12-01",
"exp_date": "2027-01-31"
}
The fields rest_call and output_format are REST-layer additions that sit outside the method’s own documented arguments in the yml; you supply rest_call with the method name and output_format with json to request a JSON response. The required fields are promo_cd, promo_desc, and promo_plan_set_no, along with the standard client_no and auth_key credentials. The yml describes no_of_uses and the start_date and exp_date pair as alternatives to each other: if no_of_uses is set, the promotion expires after that many uses and neither date needs to be set, whereas if start_date and exp_date are set instead, as in this example, the promotion is valid only between those two dates. This example therefore omits no_of_uses and instead defines a validity window running from December first, 2026 through January thirty-first, 2027.
Sample response
{
"error_code": 0,
"error_msg": "OK",
"promo_cd": "WINTER2026"
}
An error_code value of zero, together with an error_msg value of "OK", indicates that Aria created the promotion successfully. Unlike most create methods in this family, create_promotion_m echoes back the promo_cd value you supplied rather than returning a new Aria-assigned number, since the promotion code itself is the client-supplied unique identifier. This example does not attempt to show a failure response, such as one where promo_plan_set_no did not reference an existing promotional plan set.