Start Rating and Refund Request

The following sections describe sample rating requests and responses for a charge and a refund.

The extended MtxDiamRoMsg MATRIXX Data Container (MDC), CUSTDiamRoMsg, includes private fields. For more information about custom MDCs, see the discussion about MATRIXX data containers in MATRIXX Configuration.

Start Rating Request

Start Rating Request shows a rating request for a text charge. If MultiServiceList is included in RatingRequest, you must define RequestedQuantity.
Table 1. Start Rating Request
URI
POST http://host:port/rsgateway/data/json/service/device/0-1-5-15/rating/start
Request Body
"RatingRequest": {
       "$": "CUSTDiamRoMsg",
       "APartyMccMnc":"26001",
       "CalledStationId":"48",
       "EventTime": "2018-06-28T14:33:30.000000+02:00",
       "mscAddress": "48",
       "MultiServiceList": [
           {
               "$": "MtxMultiServiceData",
               "RequestedQuantity": {
                   "$": "MtxQuantityData",
                   "Quantity": "1",
               },
               "ServiceId": 1,
               "RatingGroupId": 1,
           }
       ],
       "RequestedAction": 0,
       "ServiceContextId": "Region1",
       "ServiceTypeObjectId": 4,
       "SessionId": "228170497",
       "Op": 1
   }
}

Start Rating Response

The following example shows the response for the rating request for a text charge.
{
    "$": "ResponseRating",
    "RatingResponse": {
        "$": "CUSTDiamRoMsg",
        "APartyCountry": "Polska",
        "APartyMccMnc": "26001",
        "AccountingSessionId": "C4AF38D5",
        "ApplicationId": 4,
        "BPartyCountry": "Polska",
        "BalanceActionList": [
            {
                "$": "MtxBalanceActionData",
                "Amount": 0.1,
                "BalanceClassId": 985
            }
        ],
        "BaringStatus": "Not Barred",
        "CallUsageType": "SMS_PR 70",
        "CalledStationId": "48",
        "CallingStationId": "10",
        "ChrgInQueueId": 0,
        "ContentType": 0,
        "DeviceObjectId": "0-1-5-475",
        "EventTime": "2018-06-28T14:33:30.000000+02:00",
        "ExternalBillingId": "10",
        "ExternalServiceType": 1,
        "Imsi": 10,
        "MultiServiceList": [
            {
                "$": "MtxMultiServiceData",
                "AuthQuantity": {
                    "$": "MtxQuantityData",
                    "Quantity": 1.0
                },
                "AuthResultType": 0,
                "LastReservationList": [
                    {
                        "$": "MtxReservationData",
                        "Amount": 0.1,
                        "BalanceSetEntryId": 2,
                        "IntervalId": 0,
                        "LastGrossAmount": -1000.0,
                        "WalletId": "0-1-5-474"
                    }
                ],
                "RatingGroupId": 1,
                "RatingQuantityType": 7,
                "RefundInfo": "228170497-0-1",
                "RequestedQuantity": {
                    "$": "MtxQuantityData",
                    "Quantity": 1.0
                },
                "ServiceId": 1
            }
        ],
        "MultiServiceSupported": 1,
        "NormalizedSessionId": 3299817685,
        "Op": 1,
        "OriginalServiceProviderSchemaVersion": 3,
        "OriginalSysSchemaVersion": 5061,
        "PricingDatabaseVersion": 1,
        "RatingAuditList": [
            {
                "$": "MtxRatingAuditData",
                "PricingVersionId": 0,
                "SegmentList": [
                    {
                        "$": "MtxRatingAuditSegmentData",
                        "ComponentList": [
                            {
                                "$": "MtxRatingAuditComponentData",
                                "ComponentId": 1688849860264361,
                                "MatrixCellIndex": 109,
                                "MatrixIndex": 1,
                                "ProductOfferId": 1407374883553305,
                                "ProductOfferVersion": 0,
                                "PurchasedOfferContainerId": "0-1-5-473",
                                "PurchasedOfferResourceId": 10
                            }
                        ],
                        "Size": 1.0
                    }
                ]
            },
            {
                "$": "MtxRatingAuditData",
                "PricingVersionId": 0,
                "SegmentList": [
                    {
                        "$": "MtxRatingAuditSegmentData",
                        "ComponentList": [
                            {
                                "$": "MtxRatingAuditComponentData",
                                "ComponentId": 1688849860264361,
                                "MatrixCellIndex": 109,
                                "MatrixIndex": 1,
                                "ProductOfferId": 1407374883553305,
                                "ProductOfferVersion": 0,
                                "PurchasedOfferContainerId": "0-1-5-473",
                                "PurchasedOfferResourceId": 10
                            }
                        ],
                        "Size": 1.0
                    }
                ]
            }
        ],
        "RequestedAction": 0,
        "Result": 0,
        "ResultText": "OK",
        "ServiceContextId": "Region1",
        "ServiceTypeObjectId": 4,
        "SessionId": "228170497",
        "SubscriberId": "0-1-5-473",
        "TextOverageAllowedID": "1",
        "TimeArray": [
            1530189212931973,
            1530189212932262,
            1530189212932341,
            1530189212932440,
            1530189212932762,
            1530189212933105,
            1530189212933108,
            1530189212995988,
            1530189212997503,
            1530189212997538,
            1530189212997774,
            1530189212997945,
            1530189212997956,
            1530189212998090,
            1530189212998135,
            1530189212998163,
            1530189212998656
        ],
        "TimerId": 153,
        "WalletId": "0-1-5-474",
        "iddCCNumber": "48",
        "iddCCRegion": "Polska",
        "mscAddress": "48",
        "originationCCNumber": "48",
        "originationCCRegion": "Polska"
    },
    "Result": 0,
    "ResultText": "OK",
    "_resultCode": 0,
    "_resultText": "OK",
    "_resultType": "create"
}

Refund Request

The following example shows a refund request using the RefundInfo value from the rating response (228170497-0-1 for session ID 228170497).
{
"RatingRequest": {
       "$": "CUSTDiamRoMsg",
       "APartyMccMnc":"26001",
       "CalledStationId":"48",
       "EventTime": "2018-06-28T14:33:30.000000+02:00",
        "mscAddress": "48",
       "MultiServiceList": [
           {
               "$": "MtxMultiServiceData",
               "RequestedQuantity": {
                   "$": "MtxQuantityData",
                   "Quantity": "1",
               },
               "ServiceId": 1,
               "RatingGroupId": 1,
               "RefundInfo": 228170497-0-1,
           }
       ],
       "RequestedAction": 1,
       "ServiceContextId": "Region1",
       "ServiceTypeObjectId": 4,
       "SessionId": "228170497",
       "Op": 1
   }
}

Refund Response

The following example shows the refund response.
{
    "$": "ResponseRating",
    "RatingResponse": {
        "$": "CUSTDiamRoMsg",
        "APartyMccMnc": "26001",
        "AccountingSessionId": "C4AF38D5",
        "ApplicationId": 4,
        "BalanceActionList": [
            {
                "$": "MtxBalanceActionData",
                "Amount": -0.1,
                "BalanceClassId": 985
            }
        ],
        "CalledStationId": "48",
        "CallingStationId": "10",
        "ChrgInQueueId": 0,
        "ContentType": 0,
        "DeviceObjectId": "0-1-5-475",
        "EventTime": "2018-06-28T14:33:30.000000+02:00",
        "ExternalBillingId": "10",
        "ExternalServiceType": 1,
        "Imsi": 10,
        "MultiServiceList": [
            {
                "$": "MtxMultiServiceData",
                "AuthQuantity": {
                    "$": "MtxQuantityData",
                    "Quantity": 1.0
                },
                "RatingGroupId": 1,
                "RatingQuantityType": 7,
                "RefundInfo": "228170497-0-1",
                "RequestedQuantity": {
                    "$": "MtxQuantityData",
                    "Quantity": 1.0
                },
                "ServiceId": 1
            }
        ],
        "MultiServiceSupported": 1,
        "NormalizedSessionId": 3299817685,
        "Op": 1,
        "OriginalServiceProviderSchemaVersion": 3,
        "OriginalSysSchemaVersion": 5061,
        "PricingDatabaseVersion": 1,
        "RatingAuditList": [
            {
                "$": "MtxRatingAuditData",
                "PricingVersionId": 0
            }
        ],
        "RequestedAction": 1,
        "Result": 0,
        "ResultText": "OK",
        "ServiceContextId": "Region1",
        "ServiceTypeObjectId": 4,
        "SessionId": "228170497",
        "SubscriberId": "0-1-5-473",
        "TimeArray": [
            1530189213950513,
            1530189213950601,
            1530189213950680,
            1530189213950690,
            1530189213951009,
            1530189213951296,
            1530189213951298,
            1530189213955400,
            1530189213956472,
            1530189213956555,
            1530189213956788,
            1530189213956863,
            1530189213956872,
            1530189213956978,
            1530189213957009,
            1530189213957030,
            1530189213957451
        ],
        "TimerId": 154,
        "WalletId": "0-1-5-474",
        "mscAddress": "48"
    },
    "Result": 0,
    "ResultText": "OK",
    "_resultCode": 0,
    "_resultText": "OK",
    "_resultType": "create"
}