For AI agents: this documentation is indexed for you in llms.txt, and all of it in /llms.txt. Every page is also available as markdown: append .md to its address.

You are reading Travelping Open Subscriber Server 6.15, an older release. The newest release is 6.20. Go to 6.20

Balance API

TPOSS Balance API allows you to read and manage balances using these RPC methods:

Data model

A balance is represented by an object with the following properties:

API methods

Charging.Balance.Add

This method allows you to add a balance for the given charging account. If the ValidityTime value is present in the incoming request, the ValidFrom and ValidTill values are calculated based on this value. If ValidFrom and ValidTill are present, theValidityTime value is calculated based on these values. If all three parameters are present in the incoming request or none of them is given, the error message is returned.

You can pass the following parameters in the request:

Example of the request:

bash

Example of the successful response:

json

In the case of an error, the response contains the error object with an error code and message:

json

The following error codes may be returned:

  • -31803 - Either all three validity time parameters are present or none of them.
  • -31804 - There is no charging account with the given account identifier.
  • -31805 - A balance with the given BalanceId already exists.
  • -32700 - Can't decode JSON request body.
  • -30000 - Required field is missing.
  • -33333 - Not authenticated.

Charging.Balance.VolumeUpgrade

You can use this method to extend the allowed volume in the parent balance of the given charging account. TPOSS uses the following parameters to look for a parent balance:

  • ChargingAccountId
  • IMSI
  • CarrierGroupId

The parent balance is referenced by the BalanceId attribute within the Balance object. If the given charging account identifier is not found in the system, the error is returned.

You can pass the following parameters in the request:

Example of the request:

bash

Example of the successful response:

json

In the case of an error, the response contains the error object with the error code and message:

json

The following error codes may be returned:

  • -31804 - There is no charging account with the given account identifier.
  • -31805 - A balance with the given BalanceId already exists.
  • -31807 - There is no existing balance to which you can add volume.
  • -32700 - Can't decode JSON request body.
  • -30000 - Required field is missing.
  • -33333 - Not authenticated.

Charging.Balance.Delete

The method allows you to mark the balance associated with the given identifier as a candidate for deletion. The error is returned if the balance with the given identifier is not found.

Note

The TPOSS CCS subsystem does not delete balances from the database based on the API request. Instead, the objects are only marked in the database as deleted and not further visible to API consumers. An internal process finally deletes these objects from the database.

You can pass the following parameters in the request:

Example of the successful request:

bash

Example of the successful response:

json

In the case of an error, the response contains the error object with an error code and message:

json

The following error codes may be returned:

  • -31806 - There is no balance object with the given BalanceId.
  • -32700 - Can't decode JSON request body.
  • -30000 - Required field is missing.
  • -33333 - Not authenticated.

Charging.Balance.Read

The method allows you to fetch the balance associated with the BalanceId identifier. If the balance is not found in the system, TPOSS returns an error.

You can pass the following parameters in the request:

Example of the request:

bash

Example of the successful response:

json

In the case of an error, the response contains the error object with an error code and message:

json

The following error codes may be returned:

  • -31806 - Balance with the given BalanceId is not found.
  • -30000 - Required field is missing.
  • -33333 - Not authenticated.
  • -32700 - Can't decode JSON request body.

Charging.Balance.List

This method is similar to the Charging.Balance.Read API call. The difference is that the Charging.Balance.Read method allows you to fetch multiple balances at once and apply a filter based on the provided criteria.

You can pass the following parameters in the request:

The Filter field allows you to filter the balances. The format of the filter is: FilterKey:FilterOperator:FilterValue. The FilterKey represents the field name of a balance or ChargingAccountId. The possible fields are listed in the data model section. The value of the FilterOperator parameter can be one of the following:

  • is - equal to
  • neq - not equal to
  • lte - lower than or equal to
  • gt - greater than
  • lt - lower than
  • gte - greater than or equal to
  • starts_with - match objects which start with the given pattern
  • ends_with - match objects which end with the given pattern
  • contains - match objects which contain the given pattern

The value of the FilterValue parameter specifies what you want to filter from the results.

Example of the request:

bash

Example of the successful response:

json

In the case of an error, the response contains the error object with an error code and message:

json

The following error codes may be returned:

  • -31411 - Invalid filter.
  • -30000 - Required field is missing.
  • -31810 - Validation error.
  • -33333 - Not authenticated.
  • -32700 - Can't decode JSON request body.