All applications below support trusted mode, i_customer should be supplied in that mode.
createServicePlan()
Available since version Softswitch 2025 and FreightSwitch 2025.
Creates a new service plan for the customer. The plan currency is derived from the assigned tariff, or from the customer's base currency when no tariff is supplied.
Parameters:
- name - Service plan name (max 128 chars). String. Required.
- description - Service plan description (max 256 chars). String. Optional.
- i_tariff - Tariff identifier; -1 for the customer's own tariff. Integer. Optional.
- i_onnet_tariff - On-net tariff identifier; nil for none. Must match the plan currency. Integer. Optional.
- i_billing_plan_suspend_mode - On-billing-failure mode, defaults to 1: 1 = Use Tariff, 2 = Block All Calls, 3 = Block Charged Calls. Integer. Optional.
- billing_cycle - 1 = weekly, 2 = bi-weekly, 3 = monthly. Integer. Optional.
- prepaid - pre-paid plan. Boolean. Optional.
- i_billing_day - billing day; -1 = On Assignment, -2 = On First Use. Integer. Optional.
- round_up - whether call durations are rounded up. Boolean. Optional.
- i_billing_plan - caller-supplied identifier; if omitted, one is generated. Integer. Optional.
Returns:
- result - OK means that the service plan has been created. String.
- i_billing_plan - the identifier assigned to the new service plan. Integer.
Faults:
- 400 - Tariff not found, on-net currency mismatch, or duplicate name.
- 401 - A required parameter is missing or a supplied parameter has an invalid value.
listServicePlans()
Available since version Softswitch 2025 and FreightSwitch 2025.
Allows retrieving service plans that belong to the authenticated customer, or to the customer specified by i_customer in trusted mode.
Parameters:
- i_billing_plan - Filter by service plan identifier. Integer. Optional.
- name_pattern - Case-insensitive SQL pattern applied to the service plan name. String. Optional.
- name_pattern_not - Case-insensitive SQL pattern used to exclude service plan names. String. Optional.
- limit - Maximum number of rows to return. Integer. Optional.
- offset - Number of matching rows to skip before returning results. Integer. Optional.
- with_details - When set, each list row includes extra fields. Boolean. Optional.
Returns:
- result - OK. String.
- list - list of service plan structures ordered by name:
- i_billing_plan - service plan identifier. Integer.
- name - service plan name. String.
- description - service plan description. String.
- i_tariff - tariff identifier. Integer.
- iso_4217 - currency code. String.
- total_price - sum of all prices from related service_charges and service_plans rows. Numeric.
- The following fields are included only when with_details is set:
- billing_cycle - billing cycle of the plan: 1 = weekly, 2 = bi-weekly, 3 = monthly. Integer.
- t_name - name of the assigned tariff; empty when the plan uses the customer's own tariff. String.
- links - whether at least one account is assigned to the plan. Boolean.
- currency_deprecated - whether the plan's currency is marked deprecated. Boolean.
- pagination - pagination metadata:
- page - the current page number (1-based). Integer.
- items_per_page - the requested limit (or the total when no limit is given). Integer.
- total_items - the total number of plans that match the parameter filters, ignoring limit/offset. Integer.
getServicePlanInfo()
Allows retrieving attributes of a single service plan. The service plan must belong to the authenticated customer, unless trusted mode is used.
Parameters:
- i_billing_plan - Service plan identifier. Integer. Required.
Returns:
- result - OK means that the service plan has been found. String.
- service_plan - service plan structure:
- i_billing_plan - service plan identifier. Integer.
- name - service plan name. String.
- description - service plan description. String.
- i_tariff - tariff identifier. Integer.
- iso_4217 - currency code. String.
- total_price - sum of all prices from related service_charges and service_plans rows. Numeric.
- i_onnet_tariff - on-net tariff identifier (nil when no on-net tariff is set). Integer.
- billing_cycle - billing cycle of the plan: 1 = weekly, 2 = bi-weekly, 3 = monthly. Integer.
- i_billing_day - billing day; -1 = On Assignment, -2 On First Use, otherwise the day within the billing cycle. Integer.
- i_billing_plan_suspend_mode - action taken on billing failure: 1 = Use Tariff, 2 = Block All Calls, 3 = Block Charged Calls. Integer.
- prepaid - billing type (true = Pre-Paid, false = Post-Paid). Boolean.
- round_up - calls duration rounding (true = round up). Boolean.
Faults:
- 400 - Service plan was not found.
- 401 - Wrong i_billing_plan parameter.
updateServicePlan()
Available since version Softswitch 2025 and FreightSwitch 2025.
Updates an existing service plan. Only the supplied fields are changed; at least one editable field must be provided. The plan currency cannot be changed after creation.
Parameters:
- i_billing_plan - identifier of the service plan to update. Integer. Required.
- name - new service plan name (max 128 chars). String. Optional.
- description - new plan description (max 256 chars). String. Optional.
- i_tariff - new basic tariff; -1 for the customer's own tariff. A supplied tariff must match the plan currency. Integer. Optional.
- i_onnet_tariff - new on-net tariff identifier; nil for none. Must match the plan currency. Integer. Optional.
- i_billing_plan_suspend_mode - new on-billing-failure mode: 1 = Use Tariff, 2 = Block All Calls, 3 = Block Charged Calls. Integer. Optional.
- billing_cycle - new; 1 = weekly, 2 = bi-weekly, 3 = monthly. Integer. Optional.
- prepaid - new pre-paid flag. Boolean. Optional.
- i_billing_day - new billing day; -1 = On Assignment, -2 = On First Use. Integer. Optional.
- round_up - new round-up flag. Boolean. Optional.
Returns:
- result - OK means the service plan has been updated. String.
Faults:
- 400 - No editable field was supplied (nothing to update) or the service plan was not found.
- 401 - Wrong i_billing_plan parameter.
- 402 - Once assigned to an Account, changes to i_tariff, i_onnet_tariff, billing_cycle, i_billing_day, i_billing_plan_suspend_mode, prepaid, and round_up are rejected. Re-sending a field's current value is not treated as a change and is allowed.
deleteServicePlan()
Available since version Softswitch 2025 and FreightSwitch 2025.
Deletes a service plan together with its child rows (service charges, minute plans, accessibility surcharges). The plan cannot be deleted while any account is assigned to it.
Parameters:
- i_billing_plan - Identifier of the service plan to delete. Integer. Required.
Returns:
- result - OK means that the plan has been deleted. String.
Faults:
- 400 - Service plan was not found.
- 401 - Wrong i_billing_plan parameter.
- 402 - The service plan is currently in use by one or more accounts and was not deleted.