create_coupon_m
Summary
| API Name | create_coupon_m |
|---|---|
| Class | administration_services_m |
| Update Version | 5.6 |
Description
Creates a coupon
Inputs
| Name | Type | Length | Required | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| client_no | long | 12 | Yes |
Aria-assigned unique identifier indicating the Aria client providing service to this account. |
||||||||||
| auth_key | string | 32 | Yes |
Aria-assigned unique key to be passed with each method call for authenticating the validity of the requestor. |
||||||||||
| coupon_cd | string | 30 | Yes |
Specifies Coupon Code |
||||||||||
| coupon_desc | string | 200 | No |
Specifies Coupon description. Translatable. |
||||||||||
| coupon_msg | string | 300 | No |
Specifies Coupon Message. Translatable. |
||||||||||
| status_ind | int | 1 | No |
Specifies Coupon status. Allowed values:
|
||||||||||
| no_of_uses | int | 8 | No |
Specifies number of uses after which coupon get expires. Related to coupon expiry detail. |
||||||||||
| start_date | string | No |
Specifies start date. The date is in the format "yyyy-mm-dd"Related to coupon expiry detail |
|||||||||||
| end_date | string | No |
Specifies start date. The date is in the format "yyyy-mm-dd"Related to coupon expiry detail |
|||||||||||
| template | object | No |
Either template, or discount_rule, or discount_bundle is required if not using an existing_template. Alternative field: discount_rule or discount_bundle |
|||||||||||
| existing_template | object | No |
The existing_template associated with this method. |
|||||||||||
| discount_rule | object | No |
Either discount_rule, or template, or discount_bundle is required if not using an existing_discount_rule. Alternative field: template or discount_bundle |
|||||||||||
| existing_discount_rule | object | No |
The existing_discount_rule associated with this method. |
|||||||||||
| discount_bundle | object | No |
Either discount_bundle, or template, or discount_rule is required if not using an existing_discount_bundle. Alternative field: template or discount_rule |
|||||||||||
| existing_discount_bundle | object | No |
The existing_discount_bundle associated with this method. |
|||||||||||
| coupon_scope | int | 1 | No |
Specifies the coupon application. The parameter is required for EOM Clients Allowed values:
|
template.eligible_service_types fields
| Name | Type | Length | Required | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| eligible_service_type | string | 2 | No |
Allowed values:
|
template fields
| Name | Type | Length | Required | Description |
|---|---|---|---|---|
| credit_template_name | string | 300 | Yes |
Recurring credit template name. If both an existing template name and a new template name is provided, the new template name will be used to create a new template. |
| client_credit_template_id | string | 100 | No |
Client defined unique id |
| eligible_plan_no | long | 8 | No |
Eligible service plan number. If eligible_plan_no is present then eligible_service_no is also set and vice-versa. This means that coupon can only be applied against a specific type of charge. But If both values are null then it means that coupon can be applied against any change. Alternative field: eligible_client_plan_id |
| eligible_client_plan_id | string | 100 | No |
Specifies Client defined unique id Alternative field: eligible_plan_no |
| eligible_service_no | long | 12 | No |
Eligible service number Alternative field: eligible_client_service_id |
| eligible_client_service_id | string | 100 | No |
Specifies Client defined unique id Alternative field: eligible_service_no |
| eligible_service_types | object | No |
Service type code for which the credit is applicable. |
|
| discount_type | int | 1 | Yes |
Specifies discount type. Valid values are [1 or 2] 1 - Indicates flat rate 2 - Indicates percentage |
| discount_amt | float | 12 | Yes |
Specifies discount amount. If discount_type is set to 1, then this range of valid values of this parameter is > 0 to 9999, but if it's set to "2" then its range is > 0 to 100. |
| no_of_credits | int | 2 | No |
This parameter is related to information about generation frequency. i.e. Number of credits If this value is set along with time_between_credits, then it means that generation frequency is multiple. |
| credit_interval_months | int | 3 | No |
Time interval between credits in months |
| percentage_plan_no | long | 8 | No |
Specifies Percentage plan number. This value is only set if discount_type is 2 i.e. discount type is Percentage Alternative field: percentage_client_plan_id |
| percentage_client_plan_id | string | 100 | No |
Specifies Client defined unique id Alternative field: percentage_plan_no |
| percentage_service_no | long | 12 | No |
Specifies Percentage service number. This value is only set if discount_type is 2 i.e. discount type is Percentage Alternative field: percentage_client_service_id |
| percentage_client_service_id | string | 100 | No |
Specifies Client defined unique id Alternative field: percentage_service_no |
| alt_service_no | long | 12 | No |
Specifies Alternative service number. If this value is null, then for coupon can be Service code to use is standard Alternative field: alt_client_service_id |
| alt_client_service_id | string | 100 | No |
Specifies Client defined unique id Alternative field: alt_service_no |
| currency_cd | string | 3 | No |
Specifies the currency code of Template |
existing_template fields
| Name | Type | Length | Required | Description |
|---|---|---|---|---|
| template_no | long | 12 | No |
Specifies existing templates to be associated with the coupon. REST input arrays should passed in the following format: existing_template[0][template_no]=1243& existing_template[1][template_no]=1002 etc. Alternative field: template_id |
| template_id | string | 100 | No |
Specifies client defined unique identifiers for existing templates to be associated with the coupon. REST input arrays should passed in the following format: existing_template[0][template_id]=1243& existing_template[1][template_id]=1002 etc. Alternative field: template_no |
discount_rule.plans fields
| Name | Type | Length | Required | Description |
|---|---|---|---|---|
| plan_no | long | 12 | Yes |
Specifies the plan that are eligible for the discount. This is mandatory for scope 11 and 13.REST input arrays should be passed in the following format: plans[0][plan_no]=1002&plans[1][plan_no]=1003 etc Alternative required field: client_plan_id |
| client_plan_id | string | 100 | Yes |
Specifies the plan that are eligible for the discount. This is mandatory for scope 11 and 13.REST input arrays should be passed in the following format: plans[0][client_plan_id]=1002&plans[0][client_plan_id]=1003 etc Alternative required field: plan_no |
discount_rule.service fields
| Name | Type | Length | Required | Description |
|---|---|---|---|---|
| service_no | long | 12 | No |
Specifies the services that are eligible for the discount. This is mandatory for scope 12 and 13. REST input arrays should be passed in the following format: For scope 12 service[0][service_no]=1002&service[1][service_no]=1003 For scope 13 service[0][service_no][0]=10002&service[0][service_no][1]=1001&service[1][service_no][0]=100&service[1][service_no][1]=103 Alternative field: client_service_id |
| client_service_id | string | 100 | No |
Specifies the services that are eligible for the discount. This is mandatory for scope 12 and 13. REST input arrays should be passed in the following format: For scope 12 service[0][client_service_id]=1002&service[1][client_service_id]=1003 For scope 13 service[0][client_service_id][0]=10002 Alternative field: service_no |
discount_rule.item fields
| Name | Type | Length | Required | Description |
|---|---|---|---|---|
| item_no | long | 12 | No |
Specifies the inventory items that are eligible for the discount. This is mandatory for scope 31. REST input arrays should be passed in the following format: item[0][item_no]=1002&item[1][item_no]=103 Alternative field: client_sku |
| client_sku | string | 100 | No |
Specifies the inventory items that are eligible for the discount. This is mandatory for scope 31. REST input arrays should be passed in the following format: item[0][client_sku]=example-sku-1&item[0][client_sku]=example-sku-2 Alternative field: item_no |
| client_item_id | string | 100 | No |
Specifies the inventory items that are eligible for the discount. This is mandatory for scope 31. REST input arrays should be passed in the following format: item[0][client_item_id]=1002&item[1][client_item_id]=103 Note: This field was deprecated in version 43. |
discount_rule fields
| Name | Type | Length | Required | Description | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| label | string | 30 | Yes |
Specifies Discount Rule Name. Translatable. |
||||||||||||||||||||||
| rule_id | string | 30 | Yes |
Specifies client rule id for Discount Rule |
||||||||||||||||||||||
| description | string | 300 | Yes |
Specifies description for the Discount Rule. Translatable. |
||||||||||||||||||||||
| ext_description | string | 300 | Yes |
Specifies description that can be added to invoice/statement and is visible to account holder. Translatable. |
||||||||||||||||||||||
| flat_percent_ind | string | 1 | Yes |
Specifies whether the discount is going to be flat or percentage based. Allowed values:
|
||||||||||||||||||||||
| amount | float | 12 | Yes |
Specifies the amount of discount. |
||||||||||||||||||||||
| currency | string | 3 | Yes |
Specifies the currency code of the rule |
||||||||||||||||||||||
| duration_type_ind | string | 1 | Yes |
Specifies the duration type. Valid values are [ U, M] for uses and months Allowed values:
|
||||||||||||||||||||||
| max_applicable_months | int | 8 | No |
Specifies the duration of the discount in months. |
||||||||||||||||||||||
| max_applicable_weeks | int | 8 | No |
Specifies the duration of the discount in weeks. |
||||||||||||||||||||||
| max_applicable_days | int | 8 | No |
Specifies the duration of the discount in days. |
||||||||||||||||||||||
| max_applications_per_acct | int | 8 | No |
Specifies the number of times the discount can be applied. |
||||||||||||||||||||||
| remainder_discount_rule_indicator | int | 3 | No |
When set as 1, it will prorate the discount applied on the initial invoice if the respective charge is prorated and then force the remaining proportion of the discount on its final application. In any of its application, if respective charge is prorated, then the discount also gets prorated. By default it's null. This parameter is applicable only for (a) duration_type_ind = M (months type duration) and (b) duration_type_ind = U (usage count type duration) with flat_percent_ind = F (fixed discount type). |
||||||||||||||||||||||
| inline_offset_ind | string | 1 | Yes |
Specifies how the discount will be displayed in the invoice.Valid values are [I, O] |
||||||||||||||||||||||
| discount_behavior_type_ind | string | 1 | Yes |
Specifies the discount scope for a discount rule.Valid values are [G, N] |
||||||||||||||||||||||
| service_code_to_use | int | 1 | No |
Specifies which service code to use. Allowed values:
|
||||||||||||||||||||||
| alt_service_no_2_apply | int | 12 | No |
Specifies the specific service code to use. Alternative field: alt_service_id_2_apply |
||||||||||||||||||||||
| alt_service_id_2_apply | string | 100 | No |
Client defined unique identifier Alternative field: alt_service_no_2_apply |
||||||||||||||||||||||
| applicable_trans_scope | string | 1 | No |
Specifies whether the discount is applied to each or all transactions. Allowed values:
|
||||||||||||||||||||||
| scope_no | int | 2 | Yes |
Specifies the charges eligible for the discount. Allowed values:
|
||||||||||||||||||||||
| plans | object | No |
The plans associated with this method. |
|||||||||||||||||||||||
| service | object | No |
The service associated with this method. |
|||||||||||||||||||||||
| item | object | No |
The item associated with this method. |
|||||||||||||||||||||||
| use_all_or_nth_subs_rule | string | 5 | No |
Specifies whether to apply discount when 'all' the plans are under the account or 'some' of the plans are are under the account. Allowed values:
|
existing_discount_rule fields
| Name | Type | Length | Required | Description |
|---|---|---|---|---|
| rule_no | long | 12 | No |
Specifies existing rules to be associated with the coupon. REST input arrays should passed in the following format: existing_discount_rule[0][rule_no]=1243& existing_discount_rule[1][rule_no]=1002 etc. Alternative field: rule_id |
| rule_id | string | 100 | No |
Specifies client defined unique identifiers for existing rules to be associated with the coupon. REST input arrays should passed in the following format: existing_discount_rule[0][rule_id]=1243& existing_discount_rule[1][rule_id]=1002 etc. Alternative field: rule_no |
discount_bundle.rules fields
| Name | Type | Length | Required | Description |
|---|---|---|---|---|
| rule_no | long | 12 | No |
Specifies the rules to be grouped in this bundle. REST input arrays should be passed in the following format: rules[1][rule_no]=1002&rules[2][rule_no]=103 Alternative field: rule_id |
| rule_id | string | 100 | No |
Specifies the rules to be grouped in this bundle. REST input arrays should be passed in the following format: rules[1][rule_id]=1002&rules[2][rule_id]=103 Alternative field: rule_no |
discount_bundle fields
| Name | Type | Length | Required | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| bundle_name | string | 300 | Yes |
Specifies the name for the discount bundle. |
||||||
| bundle_id | string | 30 | Yes |
Specifies bundle id for discount Bundle |
||||||
| bundle_description | string | 300 | Yes |
Specifies description for the discount Bundle |
||||||
| allow_overlap_ind | string | 1 | Yes |
Specifies if the rules in the bundle can overlap or not. Allowed values:
|
||||||
| rules | object | No |
The rules associated with this method. |
existing_discount_bundle fields
| Name | Type | Length | Required | Description |
|---|---|---|---|---|
| bundle_no | long | 12 | No |
Specifies existing bundles to be associated with the coupon. REST input arrays should passed in the following format: existing_discount_bundle[0][bundle_no]=1243& existing_discount_bundle[1][bundle_no]=1002 etc. Alternative field: bundle_id |
| bundle_id | string | 100 | No |
Specifies existing bundles to be associated with the coupon. REST input arrays should passed in the following format: existing_discount_bundle[0][bundle_id]=1243& existing_discount_bundle[1][bundle_id]=1002 etc. Alternative field: bundle_no |
Outputs
| Name | Type | Length | Required | Description |
|---|---|---|---|---|
| error_code | long | No |
Aria-assigned error identifier. 0 indicates no error |
|
| error_msg | string | No |
Textual description of any error that occurred. "OK" if there was no error. |
|
| coupon_cd | string | 32 | No |
Coupon Code |