A set of xmlapi methods to manage Tariffs


Related documentation:

Tariff's Rates Management

XML-RPC API - Getting Rates of an Account

Tariffs and Rates

Understanding Rating and Billing

XML-RPC API - Data types specifications


Implementation details

All applications support trusted mode in which case i_customer (integer) parameter should be supplied.


createTariff()

Create a new tariff.


Mandatory parameters

  • name - tariff name. String
  • currency - ISO4217 currency code, i.e. 'USD'. String

Optional parameters

  • i_tariff_type - tariff type, see getDictionary() with name=tariff_types. Integer. Default is 1.
  • connect_fee - connect fee. Double. Default is 0
  • free_seconds - free seconds. Integer. Default is 0
  • post_call_surcharge - post call surcharge, fraction part. Double. Default is 0
  • grace_period - grace period. Integer. Default is 0
  • loss_protection - is loss protection enabled. Boolean. Default is FALSE
  • max_loss - max loss, fraction part. Double.
  • cost_round_up - if call cost is rounded up. If set to 0, default Round is applied to call cost. Boolean. Default is FALSE
  • decimal_precision - cost decimal precision. Integer. Default is 20
  • average_duration - average call duration (ACD). Integer. Default is 200
  • local_calling - is local calling enabled. Boolean. Default is FALSE
  • local_calling_cli_validation_rule - CLI validation rule for local calling. String.

Returns

  • result - OK means that operation successful. String.
  • i_tariff - Id of added tariff. Integer.
  • XMLRPC fault in case of any error.



updateTariff()

Update an existing tariff.


Mandatory parameters

  • i_tariff - tariff Id. Integer.

Optional parameters

  • all parameters listed in createTariff().


NOTE: currency and i_tariff_type can not be changed after creation of Tariff.


Returns

  • result - OK means that operation successful. String.
  • XMLRPC fault in case of any error.



deleteTariff()

Delete an existing tariff.


Mandatory parameters

  • i_tariff - tariff Id. Integer.

Returns

  • result - OK means that operation successful. String.
  • XMLRPC fault in case of any error.



getTariffInfo()

Get tariff parameters.


Mandatory parameters

  • i_tariff - tariff Id. Integer.

Returns

  • result - OK means that operation successful. String.
  • tariff - structure of tariff parameters:
    • i_tariff - tariff identifier. Integer.
    • name - tariff name. String.
    • currency - ISO4217 currency code, e.g. USD. String.
    • i_tariff_type - tariff type, as returned by getDictionary() with name=tariff_types. Integer.
    • connect_fee - connect fee. Double.
    • free_seconds - free seconds. Integer.
    • post_call_surcharge - post-call surcharge, fractional part. Double.
    • grace_period - grace period in seconds. Integer.
    • loss_protection - whether loss protection is enabled. Boolean.
    • max_loss - maximum loss, fractional part. Double.
    • cost_round_up - whether call cost is rounded up. Boolean.
    • decimal_precision - call cost decimal precision. Integer.
    • average_duration - average call duration in seconds. Integer.
    • local_calling - whether local calling is enabled. Boolean.
    • local_calling_cli_validation_rule - CLI validation rule for local calling. String; empty when unset.


  • XMLRPC fault in case of any error.



getTariffsList()

Get list of tariffs.


Optional parameters

  • name_pattern - pattern to filter by tariff name (SQL syntax for the ILIKE operator is used). String.
  • currency - filter tariffs by currency ISO4217 code, e.g. USD.  String. Since 2025 version
  • i_tariff_type - filter by tariff type, see getDictionary() with name=tariff_types. Integer.
  • offset - skip first offset records. Integer.
  • limit - return only limit records. Integer.

Returns

  • result - OK means that operation successful. String.
  • tariffs - array of tariffs (i_tariff, name, currency, i_tariff_type)


  • XMLRPC fault in case of any error.