apply_coupon_to_acct_m
Summary
| API Name | apply_coupon_to_acct_m |
|---|---|
| Class | account_services_m |
| Update Version | 43 |
Description
This API assigns a coupon code to a specified account or master plan instance. The appropriate service credits will then be applied to the account or master plan instance based on the credit template associated with the coupon code. This API includes coupon assignment at the Plan Instance level (coupon_assignment_plan_instance_no/coupon_assignment_client_plan_instance_id input) as well as Master Plan Instance level (master_plan_instance_no/client_master_plan_instance_id input). When the API is called by passing a value to the Master Plan Instance (MPI) level, it will apply on the MPI stack level coupon. If the API is called passing a value to the new Plan Instance (PI) level, then it will operate on the PI level coupon. If the API caller passes values at both the Plan Instance and Master Plan Instance level, then the Master Plan Instance inputs take precedence over the specific Plan Instance inputs.
Inputs
| Name | Type | Length | Required | Description |
|---|---|---|---|---|
| client_no | long | 22 | Yes |
Aria-assigned unique identifier indicating the Aria client providing service to this account. |
| auth_key | string | 32 | No |
Aria-assigned unique key for authenticating the validity of the requestor. This key is passed with each method call. |
| acct_no | long | 22 | Yes |
Aria-assigned account identifier. This value is unique across all Aria-managed accounts. Alternative required field: client_acct_id |
| client_acct_id | string | 50 | Yes |
Client-defined account identifier. Alternative required field: acct_no |
| master_plan_instance_no | long | 22 | No |
The Master Subscription plan instance number. Alternative field: client_master_plan_instance_id, coupon_assignment_plan_instance_no, or coupon_assignment_client_plan_instance_id |
| client_master_plan_instance_id | string | 100 | No |
Client-defined Master plan Subscription plan instance ID. Alternative field: master_plan_instance_no, coupon_assignment_plan_instance_no, or coupon_assignment_client_plan_instance_id |
| coupon_code | string | 30 | Yes |
The code of the coupon to which to apply the discount. If code is not valid for any reason, an appropriate error code is returned and the entire transaction (including the supp plan assignment and any possible invoice creation) is rolled back. |
| coupon_assignment_reason_cd | long | 22 | No |
The code of the reason the coupon is being applied. |
| coupon_assignment_comments | string | No | ||
| coupon_assignment_effective_date | string | 10 | No |
The date the coupon will take effect on the account/plan instance, in yyyy-mm-dd format. |
| override_discount_rule_scope | object | No |
This field overrides the discount rule scope set at "Marketing Catalog". |
|
| coupon_assignment_plan_instance_no | long | 22 | No |
The Aria-assigned unique identifier of the plan instance to which the coupon is to be assigned. Alternative field: coupon_assignment_client_plan_instance_id, master_plan_instance_no, or client_master_plan_instance_id |
| coupon_assignment_client_plan_instance_id | string | 100 | No |
The client-defined unique identifier of the plan instance to which the coupon is to be assigned. Alternative field: coupon_assignment_plan_instance_no, master_plan_instance_no, or client_master_plan_instance_id |
override_discount_rule_scope.plan_service_detail.service_detail fields
| Name | Type | Length | Required | Description |
|---|---|---|---|---|
| service_no | long | 22 | No |
Aria unique catalog service no. |
| client_service_id | string | 100 | No |
CLient defined service identifier. |
override_discount_rule_scope.plan_service_detail fields
| Name | Type | Length | Required | Description |
|---|---|---|---|---|
| plan_no | long | 22 | No |
Aria unique catalog plan no. |
| client_plan_id | string | 100 | No |
Client defined plan identifier. |
| service_detail | object | No |
List of services under the plan no. |
override_discount_rule_scope.item_detail fields
| Name | Type | Length | Required | Description |
|---|---|---|---|---|
| item_no | long | 22 | No |
Aria unique item no. |
| client_sku | string | 100 | No |
Client defined item id. |
override_discount_rule_scope fields
| Name | Type | Length | Required | Description | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| rule_no | long | 22 | No |
Discount rule no associated to the coupon. |
||||||||||||||||||||||
| client_rule_id | string | 100 | No |
Client defined rule id associated to the coupon. |
||||||||||||||||||||||
| scope_no | long | 22 | No |
Override scope number Allowed values:
|
||||||||||||||||||||||
| plan_service_detail | object | No |
Array of plans which can be overridden. For scope_no 11, only plan_no information will be considered and service_detail will be ignored. For scope_no 12, only service_details will be considered. plan_no, client_plan_Id will be ignored. For scope_no 13, both plan_no detail and service_detail will be considered and validated. For all other scopes, thie plan_details will be ignored. |
|||||||||||||||||||||||
| item_detail | object | No |
Array of plans which can be overridden. Supply the array for scope_no 31. |
Outputs
| Name | Type | Length | Required | Description |
|---|---|---|---|---|
| user_success_msg | string | No |
The message to display to account the holder upon successful application of the coupon code they've provided. |
|
| error_code | long | No |
Aria-assigned error identifier. 0 indicates no error. |
|
| error_msg | string | No |
Description of any error that occurred. "OK" if there was no error. |
|
| coupon_assignment_no | long | 22 | No |
The ID assigned to the coupon. |
| coupon_assignment_effective_date | string | 10 | No |
The date the coupon will take effect on the account/plan instance, in yyyy-mm-dd format. |