Overview
You need to create a credit 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 credit request.
- Create a file called credit-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": 100
},
"usedUnitContainer": [{
"serviceSpecificUnits": 0
}],
"ratingGroup": 2
}],
"oneTimeEvent": true,
"oneTimeEventType": "IEC",
"requestedAction": "TOP_UP",
"nfConsumerIdentification": {"nodeFunctionality": "SMF"},
"invocationTimeStamp": "2022-03-05:03:36.683Z"
}
Below are some details on the payload.
- The tenantidentifier is the same as the providerid.
- The susbscriberidentifier is the same as the deviceid
- The requested units are 100.
- The rating group is 2 indicating this is a Text credit.
- The type of action in this case is a credit one (TOP_UP)
- 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 @credit-request.json https://5g.produseast1.api.totogi.com/nchf-convergedcharging/v3/chargingData
- If the call is successful, the following response will be received.