Overview
You need to create a charge request using the Charging API and you are looking for instructions on how to do so.
Solution
In order to make the requests to the Charging API, the information below is required. See Understanding the 5G/Charging API for further details.
- The Provider ID.
- An Access Token using the credentials from the Infra/Charging user.
- The ID of the device. This ID is used/returned when the device is first created (see Create a Device using the API for further details).
The endpoint to use for making these requests is https://5g.produseast1.api.totogi.com/nchf-convergedcharging/v3/chargingData, and below is an example of the process to follow to create a charge request.
- Create a file called
charge-request.json
with the following data. Alternatively, use the data as the JSON payload for the request.
{
"invocationSequenceNumber": 1,
"tenantIdentifier": "<providerId>",
"subscriberIdentifier": "<deviceId>",
"multipleUnitUsage": [{
"requestedUnit": {
"serviceSpecificUnits": 10
},
"ratingGroup": 1
}],
"locationReportingChargingInformation": {
"psCellInformation": {
"nrcgi": {
"nrCellId": "11",
"nid": "12",
"pinnId": {
"mcc": "310",
"mnc": "170"
}
}
}
},
"nfConsumerIdentification": {"nodeFunctionality": "SMF"},
"invocationTimeStamp": "2022-03-23T00:38:10.057Z"
}
Below are some details on the payload.
- The tenantidentifier is the same as the providerid.
- The susbscriberidentifier is the same as the deviceid
- The usage units are 10.
- The rating group is 1 indicating this is a Voice charge.
- The location reporting maps the device location.
- The timestamp should follow the ISO-8601 format.
- Execute the following command from a terminal in order to send the request.
Note: If you are using a different tool, make sure HTTP/2 is supported.
curl -X POST -H "Content-Type: application/json" -H "Authorization:Bearer [IdToken obtained in the first section]" -d @charge-request.json https://5g.produseast1.api.totogi.com/nchf-convergedcharging/v3/chargingData
- If the request is successful, the following response will be received.