apply_coupon_to_acct_m Sample Call and Response
This example shows you how to assign a coupon code to a master plan instance so that its associated service credits apply to that subscription, using the plsql_m_r73.yml definition for release seventy-three of the Aria Billing Cloud Core API.
This example covers coupon assignment at the master plan instance level. It does not cover coupon assignment at the individual plan instance level through coupon_assignment_plan_instance_no, and it does not cover the override_discount_rule_scope structure, which lets you override the discount rule scope configured in the marketing catalog.
Sample call
{
"rest_call": "apply_coupon_to_acct_m",
"output_format": "json",
"client_no": 3001,
"auth_key": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
"acct_no": 5544332,
"master_plan_instance_no": 8891234,
"coupon_code": "SUMMER26",
"coupon_assignment_reason_cd": 4,
"coupon_assignment_comments": "Applied as a retention offer during the customer's renewal call.",
"coupon_assignment_effective_date": "2026-08-01"
}
The master_plan_instance_no field targets the coupon at the master plan instance level; it belongs to a group of four alternative fields consisting of master_plan_instance_no, client_master_plan_instance_id, coupon_assignment_plan_instance_no, and coupon_assignment_client_plan_instance_id, and this example supplies only master_plan_instance_no. As the method description notes, when you supply a master plan instance value, Aria applies the coupon at the master plan instance stack level, taking precedence over any plan instance level value. The coupon_assignment_reason_cd, coupon_assignment_comments, and coupon_assignment_effective_date fields are optional and record why the coupon was applied, additional notes, and the date the coupon takes effect, respectively.
Sample response
{
"user_success_msg": "Your coupon has been applied successfully.",
"error_code": 0,
"error_msg": "OK",
"coupon_assignment_no": 330219,
"coupon_assignment_effective_date": "2026-08-01"
}
An error_code value of zero, together with an error_msg value of "OK", indicates that Aria applied the coupon successfully. The user_success_msg field contains the message you can display to the account holder confirming the coupon application. The coupon_assignment_no field identifies this specific coupon assignment, and coupon_assignment_effective_date confirms the date the coupon takes effect. This method also defines an error_details field in its returns, but Aria marks that field nonpublic, so this example leaves it out entirely.