Balance API
TPOSS Balance API allows you to read and manage balances using these RPC methods:
- Charging.Balance.Add - to provision the new balance
- Charging.Balance.VolumeUpgrade - to upgrade the existing balance
- Charging.Balance.Delete - to mark the existing balance as deleted
- Charging.Balance.Read - to fetch the existing balance by the given identifier
- Charging.Balance.List - to fetch the list of balances filtered by the given criteria
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:
Example of the successful response:
In the case of an error, the response contains the error object with an error code and message:
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 givenBalanceIdalready 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:
ChargingAccountIdIMSICarrierGroupId
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:
Example of the successful response:
In the case of an error, the response contains the error object with the error code and message:
The following error codes may be returned:
-31804- There is no charging account with the given account identifier.-31805- A balance with the givenBalanceIdalready 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:
Example of the successful response:
In the case of an error, the response contains the error object with an error code and message:
The following error codes may be returned:
-31806- There is no balance object with the givenBalanceId.-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:
Example of the successful response:
In the case of an error, the response contains the error object with an error code and message:
The following error codes may be returned:
-31806- Balance with the givenBalanceIdis 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.List 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 toneq- not equal tolte- lower than or equal togt- greater thanlt- lower thangte- greater than or equal tostarts_with- match objects which start with the given patternends_with- match objects which end with the given patterncontains- 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:
Example of the successful response:
In the case of an error, the response contains the error object with an error code and message:
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.