Charge subscriber’s account
This POST
operation charges a subscriber’s account based on the supplied rating parameters in the JSON payload. If successful, you receive a returnCode
or 0
in the JSON response.
POST /crs-api/processRating
+ JSON request payload
HEADER INFO
authorisation: HTTP Basic Auth
tenant: <tenantName>
content-type: application/JSON
accept: application/JSON
By default, accept is XML . You must explicitly set accept in your header to application/JSON to receive a JSON response.
|
JSON request payload
The request payload should contain several important items including the subscriber’s msisdn
, ratingParams
, the database lookup
parameters, and any preRating
information.
The preRating information is not required.
|
{
"msisdn": "08712345",
"ratingParams": {
"msisdn": "08712345",
"operationId": "JG123456",
"contentId": "001",
"contentDescription": "PortalSRS",
"lookup": {
"providerId": "6010",
"applicationId": "50000029",
"serviceId": "30000020",
"originId": "9"
"bundleId": "1234"
},
"preRating": {
"totalPrice": "0.2",
"retailPrice": "0.1",
"calculatedTax": "0.0",
"calculatedPromo": "0",
"downloadFeeWot": "0.1"
}
}
}
JSON response
The JSON response contains the return code which is 0
if successful. See the return codes section below for more codes.
{
"returnCode": 0
}
CRS API return codes
|
success |
The transaction was completed successfully. |
||
|
insufficient funds |
The user did not have enough credit available.
|
||
|
invalid number |
The number is invalid or inactive. |
||
|
invalid parameter |
A parameter such as providerId or applicationId was sent incorrectly or does not exist in the system. |
||
|
general LDAP error |
A general LDAP server error not associated with a timeout. |
||
|
no rating match |
The parameters used to describe the rating that charges the user do not correspond to any of the ratings defined in the CRS. |
||
|
rating error |
The rating system experienced an error or unexpected exception. Further detail may be available in the relevant log file. |
||
|
charging error |
The CRS was unable to communicate with the charging/billing system. |
||
|
unknown error |
The CRS encountered an unknown error. |
||
|
internal timeout |
The CRS did not respond within the configured timeout. |
||
|
LDAP timeout |
The SPR did not respond to a request within the configured timeout. |
||
|
invalid exter parameter string |
The Extra Parameter String that was sent is incorrect according to the Extra Parameter XML Definition. |
||
|
invalid |
The string parameter |
||
|
invalid |
The string parameter |
||
|
invalid |
The string parameter |
||
|
invalid |
The string parameter |
||
|
invalid |
The string parameter |
||
|
invalid |
The string parameter |
||
|
invalid |
The string parameter |
||
|
|
The string parameter “totalPrice” is not equal to the sum of values.
|
||
|
missing transport rating ID |
Occurs when a Pre‐rated Rating Request with a downloadFee greater than zero does not have a corresponding Transport Rating. |
||
|
download fee in refund |
The “downloadFee” or |
||
|
refund failed |
The attempt to refund the subscriber failed. |