Home > Aria6 User Documentation > Aria6 admintools api > create_coupon

create_coupon

Creates a coupon

Note: The previously existing input and/or output fields <client_item_id>, <client_item_id_out> and/or <filter_client_item_id> were removed from this API call in Release 47.

Input Arguments

Req Field Name Field Type Max Length Description
Asterisk_0807a.jpg client_no long 22 Aria-assigned unique identifier indicating the Aria client providing service to this account.
Asterisk_0807a.jpg auth_key string 32 Aria-assigned unique key to be passed with each method call for authenticating the validity of the requestor.
Asterisk_0807a.jpg coupon_cd string 30 Specifies Coupon Code
  coupon_desc string 200 Specifies Coupon description. Translatable.
  coupon_msg string 300 Specifies Coupon Message. Translatable.
  status_ind int 1 Specifies Coupon status.  

Allowable values for status_ind

Values Description
1 Active
0 Inactive
  no_of_uses int 8 Specifies number of uses after which coupon get expires. Related to coupon expiry detail.
  start_date string   Specifies start date. The date is in the format "yyyy-mm-dd"Related to coupon expiry detail
  end_date string   Specifies start date. The date is in the format "yyyy-mm-dd"Related to coupon expiry detail
  template array   Either template, or discount_rule, or discount_bundle is required if not using an existing_template.
Asterisk_0807a.jpg brd_arrow.gifcredit_template_name string 300 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.
  brd_arrow.gifclient_credit_template_id string 100 Client defined unique id
  brd_arrow.gifeligible_plan_no int 8 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.
  OR      
  brd_arrow.gifeligible_client_plan_id string 100 Specifies Client defined unique id
  brd_arrow.gifeligible_service_no int 12 Eligible service number
  OR      
  brd_arrow.gifeligible_client_service_id string 100 Specifies Client defined unique id
  brd_arrow.gifeligible_service_types string array 2 Service type code for which the credit is applicable.  

Allowable values for eligible_service_type

Values Description
RC Recurring Service
RA Recurring Arrears Service
SC Surcharge Service
US Usage Service
AC Activation Service
MS Miscellaneous Service
CN Cancellation Service
OR Order Based Service
MN Minimum Service Fee
Asterisk_0807a.jpg brd_arrow.gifdiscount_type int 1 Specifies discount type. Valid values are [1 or 2] 1 - Indicates flat rate 2 - Indicates percentage
Asterisk_0807a.jpg brd_arrow.gifdiscount_amt float 12 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.
  brd_arrow.gifno_of_credits int 2 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.
  brd_arrow.gifcredit_interval_months int 3 Time interval between credits in months
  brd_arrow.gifpercentage_plan_no int 8 Specifies Percentage plan number. This value is only set if discount_type is 2 i.e. discount type is Percentage
  OR      
  brd_arrow.gifpercentage_client_plan_id string 100 Specifies Client defined unique id
  brd_arrow.gifpercentage_service_no int 12 Specifies Percentage service number. This value is only set if discount_type is 2 i.e. discount type is Percentage
  OR      
  brd_arrow.gifpercentage_client_service_id string 100 Specifies Client defined unique id
  brd_arrow.gifalt_service_no int 12 Specifies Alternative service number. If this value is null, then for coupon can be Service code to use is standard
  OR      
  brd_arrow.gifalt_client_service_id string 100 Specifies Client defined unique id
  brd_arrow.gifcurrency_cd string 3 Specifies the currency code of Template
  discount_rule array   Either discount_rule, or template, or discount_bundle is required if not using an existing_discount_rule.
Asterisk_0807a.jpg brd_arrow.giflabel string 30 Specifies Discount Rule Name. Translatable.
Asterisk_0807a.jpg brd_arrow.gifrule_id string 30 Specifies client rule id for Discount Rule
Asterisk_0807a.jpg brd_arrow.gifdescription string 300 Specifies description for the Discount Rule. Translatable.
Asterisk_0807a.jpg brd_arrow.gifext_description string 300 Specifies description that can be added to invoice/statment and is visible to account holder. Translatable.
Asterisk_0807a.jpg brd_arrow.gifflat_percent_ind string 1 Specifies whether the discount is going to be flat or percentage based.  

Allowable values for flat_percent_ind

Values Description
P Percentage discount type
F Fixed discount type
Asterisk_0807a.jpg brd_arrow.gifamount float 12 Specifies the amount of discount.
Asterisk_0807a.jpg brd_arrow.gifcurrency string 3 Specifies the currency code of the rule
Asterisk_0807a.jpg brd_arrow.gifduration_type_ind string 1 Specifies the duration type. Valid values are [ U, M] for uses and months  

Allowable values for duration_type_ind

Values Description
U Number of uses
M Duration in months
I Never expires
  brd_arrow.gifmax_applicable_months int 8 Specifies the duration of the discount in months.
  brd_arrow.gifmax_applications_per_acct int 8 Specifies the number of times the discount can be applied.
Asterisk_0807a.jpg brd_arrow.gifinline_offset_ind string 1 Specifies how the discount will be displayed in the invoice.Valid values are [I, O]
Asterisk_0807a.jpg brd_arrow.gifdiscount_behavior_type_ind string 1 Specifies the discount scope for a discount rule.Valid values are [G, N]
  brd_arrow.gifservice_code_to_use int 1 Specifies which service code to use.  

Allowable values for service_code_to_use

Values Description
0 Uses same service as the 'charge' line item
1 Uses a specific service
  brd_arrow.gifalt_service_no_2_apply int 12 Specifies the specific service code to use.
  OR      
  brd_arrow.gifalt_service_id_2_apply string 100 Client defined unique identifier
  brd_arrow.gifapplicable_trans_scope string 1 Specifies whether the discount is applied to each or all transactions.  

Allowable values for applicable_trans_scope

Values Description
E Applies discount to each transaction on the invoice (current behavior)
M Applies discount to all the transaction on the invoice. Any remaining credit will be carried over to next month.
Asterisk_0807a.jpg brd_arrow.gifscope_no int 2 Specifies the charges eligible for the discount.  

Allowable values for scope_no

Values Description
0 All Charges
10 All Plan Charges, All Plans
11 All Plan Charges, Specified Plans
12 All Plans, Specified Service Charges
13 Specified Plan/Service Charges
21 All Recurring Service Charges
22 All Usage Service Charges
23 All Activation Service Charges
30 All Item Charges
31 Specified Item Charges
  brd_arrow.gifplan_no int array 12 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: plan_no[0]=1002&plan_no[1]=1003 etc
  brd_arrow.gifclient_plan_id string array 100 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: client_plan_id[0]=1002&client_plan_id[1]=1003 etc
  brd_arrow.gifservice_no int array 12 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_no[0]=1002&service_no[1]=1003 For scope 13 service_no[0][0]=10002&service[0][1]=1001&service[1][0]=100&service[1][1]=103
  brd_arrow.gifclient_service_id string array 100 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 client_service_id[0]=1002&client_service_id[1]=1003 For scope 13 client_service_id[0][0]=10002
  brd_arrow.gifitem_no int array 12 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_no[0]=1002&item_no[1]=103
  brd_arrow.gifclient_sku string array 100 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: client_sku[0]=1002&client_sku[1]=103
  brd_arrow.gifuse_all_or_nth_subs_rule string 5 Specifies whether to apply discount when 'all' the plans are under the account or 'some' of the plans are are under the account.  

Allowable values for use_all_or_nth_subs_rule

Values Description
1 Apply discount when 'all' the plans are under the account
  Apply discount when 'some' the plans are under the account
  discount_bundle array   Either discount_bundle, or template, or discount_rule is required if not using an existing_discount_bundle.
Asterisk_0807a.jpg brd_arrow.gifbundle_name string 300 Specifies the name for the discount bundle.
Asterisk_0807a.jpg brd_arrow.gifbundle_id string 30 Specifies bundle id for discount Bundle
Asterisk_0807a.jpg brd_arrow.gifbundle_description string 300 Specifies description for the discount Bundle
Asterisk_0807a.jpg brd_arrow.gifallow_overlap_ind string 1 Specifies if the rules in the bundle can overlap or not.  

Allowable values for allow_overlap_ind

Values Description
Y Yes
N No
  brd_arrow.gifrules int array 12 Specifies the rules to be grouped in this bundle. REST input arrays should be passed in the following format: rules[1]=1002&rules[2]=103
  brd_arrow.gifrule_ids string array 100 Specifies the rules to be grouped in this bundle. REST input arrays should be passed in the following format: rule_ids[1]=1002&rule_ids[2]=103
  brd_arrow.gifexisting_template int array 12 Specifies existing templates to be associated with the coupon. REST input arrays should passed in the following format: existing_template[0]=1243& existing_template[1]=1002 etc.
  brd_arrow.gifexisting_template_id string array 100 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_id[0]=1243& existing_template_id[1]=1002 etc.
  brd_arrow.gifexisting_discount_rule int array 12 Specifies existing rules to be associated with the coupon. REST input arrays should passed in the following format: existing_rule[0]=1243& existing_rule[1]=1002 etc.
  brd_arrow.gifexisting_discount_rule_id string array 100 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_id[0]=1243& existing_discount_rule_id[1]=1002 etc.
  brd_arrow.gifexisting_discount_bundle int array 12 Specifies existing bundles to be associated with the coupon. REST input arrays should passed in the following format: existing_discount_bundle[0]=1243& existing_discount_bundle[1]=1002 etc.
  brd_arrow.gifexisting_discount_bundle_id string array 100 Specifies existing bundles to be associated with the coupon. REST input arrays should passed in the following format: existing_discount_bundle_id[0]=1243& existing_discount_bundle_id[1]=1002 etc.
  coupon_scope int 1 Specifies the coupon application. The parameter is required for EOM Clients  

Allowable values for coupon_scope

Values Description
1 Coupon can be applied to Account only
2 Coupon can be applied to Master plan instance only
3 Coupon can be applied to Account & Master plan instance
 

Output Arguments

Field Name Field Type Description
error_code long Aria-assigned error identifier. 0 indicates no error.
error_msg string Textual description of any error that occurred. "OK" if there was no error.
coupon_cd string Coupon Code
 
 
 
Last modified

Tags

This page has no custom tags.

Classifications

This page has no classifications.