Create a Usage Consumption Object

post

{apiRoot}/queryUsageConsumption

Creates a usage consumption object.

Request

There are no request parameters for this operation.

Supported Media Types
Request Body - application/json;charset=utf-8 ()
Root Schema : schema
Type: object
A usage consumption request.
Show Source
Nested Schema : partyAccount
Type: array
A reference to the account that owns the bucket.
Show Source
Nested Schema : relatedParty
Type: array
The reference and role of the related parties for which usage consumption is requested.
Show Source
Nested Schema : UsageConsumption
Type: object
A usage consumption object, which contains the current balance and consumption counters for a subscriber's service type, such as SMS, Voice, and Data. The balance and consumption counters can be calculated for a device identified by a public key (such as an MSISDN number for a mobile device, or a PSTN or VOIP number for a fixed device).
Show Source
Nested Schema : PartyAccountRef
Type: object
A party account reference, which is an arrangement that a party has with an enterprise that provides products to the party.
Show Source
Nested Schema : RelatedParty
Type: object
A related party, which defines the party or party role linked to a specific entity.
Show Source
Nested Schema : bucketRefOrValue
Type: array
The buckets included in the subscribed offer.
Show Source
  • BucketRefOrValue
    A bucket (called UsageVolumProduct in the SID Model), which represents and tracks a quantity of remaining or consumed usage. It could be either a quantity or an amount in a currency. It can represent a fixed number of SMS, MMS, call minutes, quantity of data, and so on.
Nested Schema : logicalResource
Type: array
Show Source
Nested Schema : partyAccount
Type: array
The account that owns the bucket.
Show Source
Nested Schema : product
Type: array
Show Source
Nested Schema : relatedParty
Type: array
The reference and role of the related parties for which the usage consumption is requested.
Show Source
Nested Schema : service
Type: array
Show Source
Nested Schema : TimePeriod
Type: object
A time period, as an end time, a start time, or both.
Show Source
Nested Schema : BucketRefOrValue
Type: object
A bucket (called UsageVolumProduct in the SID Model), which represents and tracks a quantity of remaining or consumed usage. It could be either a quantity or an amount in a currency. It can represent a fixed number of SMS, MMS, call minutes, quantity of data, and so on.
Show Source
Nested Schema : bucketCounter
Type: array
Show Source
Nested Schema : bucketRelationship
Type: array
Show Source
Nested Schema : logicalResource
Type: array
Show Source
Nested Schema : product
Type: array
Show Source
Nested Schema : relatedParty
Type: array
Information about an entity related to the balance. For example, to define a customer hierarchy for the balance, such as customerId or userId.
Show Source
Nested Schema : Quantity
Type: object
An amount in a specified unit.
Show Source
Nested Schema : reserveBalance
Type: array
Show Source
Nested Schema : service
Type: array
Show Source
Nested Schema : ConsumptionSummary
Type: object
Details about a consumption counter (called ConsumptionSummary in the SID model).
Show Source
Nested Schema : BucketRelationship
Type: object
A linked bucket.
Show Source
Nested Schema : UsageConsumptionLogicalResourceRef
Type: object
A logical resource.
Show Source
Nested Schema : consumptionSummary
Type: array
Show Source
Nested Schema : UsageConsumptionProductRef
Type: object
Show Source
Nested Schema : consumptionSummary
Type: array
Show Source
Nested Schema : ReserveBalanceRef
Type: object
A reserve balance resource, which allows adjustments to be made to the original balance topup.
Show Source
Nested Schema : ServiceRef
Type: object
A service reference.
Show Source
Back to Top

Response

Supported Media Types

201 Response

The usage consumption object was created successfully.
Body ()
Root Schema : QueryUsageConsumption
Type: object
A usage consumption request.
Show Source
Nested Schema : partyAccount
Type: array
A reference to the account that owns the bucket.
Show Source
Nested Schema : relatedParty
Type: array
The reference and role of the related parties for which the usage consumption is requested.
Show Source
Nested Schema : UsageConsumption
Type: object
A usage consumption object, which contains the current balance and consumption counters for a subscriber's service type, such as SMS, Voice, and Data. The balance and consumption counters can be calculated for a device identified by a public key (such as an MSISDN number for a mobile device, or a PSTN or VOIP number for a fixed device).
Show Source
Nested Schema : usageConsumption
Type: array
A usage consumption report with the current counters and balances.
Show Source
  • UsageConsumption
    A usage consumption object, which contains the current balance and consumption counters for a subscriber's service type, such as SMS, Voice, and Data. The balance and consumption counters can be calculated for a device identified by a public key (such as an MSISDN number for a mobile device, or a PSTN or VOIP number for a fixed device).
Nested Schema : PartyAccountRef
Type: object
A party account reference, which is an arrangement that a party has with an enterprise that provides products to the party.
Show Source
Nested Schema : RelatedParty
Type: object
A related party, which defines the party or party role linked to a specific entity.
Show Source
Nested Schema : bucketRefOrValue
Type: array
The buckets included in the subscribed offer.
Show Source
  • BucketRefOrValue
    A bucket (called UsageVolumProduct in the SID Model), which represents and tracks a quantity of remaining or consumed usage. It could be either a quantity or an amount in a currency. It can represent a fixed number of SMS, MMS, call minutes, quantity of data, and so on.
Nested Schema : logicalResource
Type: array
Show Source
Nested Schema : partyAccount
Type: array
The account that owns the bucket.
Show Source
Nested Schema : product
Type: array
Show Source
Nested Schema : relatedParty
Type: array
The reference and role of the related parties for which the usage consumption is requested.
Show Source
Nested Schema : service
Type: array
Show Source
Nested Schema : TimePeriod
Type: object
A time period, as an end time, a start time, or both.
Show Source
Nested Schema : BucketRefOrValue
Type: object
A bucket (called UsageVolumProduct in the SID Model), which represents and tracks a quantity of remaining or consumed usage. It could be either a quantity or an amount in a currency. It can represent a fixed number of SMS, MMS, call minutes, quantity of data, and so on.
Show Source
Nested Schema : bucketCounter
Type: array
Show Source
Nested Schema : bucketRelationship
Type: array
Show Source
Nested Schema : logicalResource
Type: array
Show Source
Nested Schema : product
Type: array
Show Source
Nested Schema : relatedParty
Type: array
Information about an entity related to the balance. For example, to define a customer hierarchy for the balance, such as customerId or userId.
Show Source
Nested Schema : Quantity
Type: object
An amount in a specified unit.
Show Source
Nested Schema : reserveBalance
Type: array
Show Source
Nested Schema : service
Type: array
Show Source
Nested Schema : ConsumptionSummary
Type: object
Details about a consumption counter (called ConsumptionSummary in the SID model).
Show Source
Nested Schema : BucketRelationship
Type: object
A linked bucket.
Show Source
Nested Schema : UsageConsumptionLogicalResourceRef
Type: object
A logical resource.
Show Source
Nested Schema : consumptionSummary
Type: array
Show Source
Nested Schema : UsageConsumptionProductRef
Type: object
Show Source
Nested Schema : consumptionSummary
Type: array
Show Source
Nested Schema : ReserveBalanceRef
Type: object
A reserve balance resource, which allows adjustments to be made to the original balance topup.
Show Source
Nested Schema : ServiceRef
Type: object
A service reference.
Show Source

400 Response

The request isn't valid.
Body ()
Root Schema : Error
Type: object
An error.
Show Source

401 Response

The client doesn't have the correct privileges.
Body ()
Root Schema : Error
Type: object
An error.
Show Source

403 Response

The request wasn't authorized.
Body ()
Root Schema : Error
Type: object
An error.
Show Source

405 Response

This request method isn't supported for the requested resource.
Body ()
Root Schema : Error
Type: object
An error.
Show Source

409 Response

The request couldn't be processed due to a conflict. An item already exists.
Body ()
Root Schema : Error
Type: object
An error.
Show Source

500 Response

An internal server error occurred.
Body ()
Root Schema : Error
Type: object
An error.
Show Source
Back to Top

Examples

The following example shows how to create a usage consumption object by submitting a POST request on the REST resource using cURL. For more information about cURL, see "Use cURL".

The -d option specifies the file to attach as the request body.

curl -X POST 'apiRoot/queryUsageConsumption" -H "accept: */*" -H "Content-Type: application/json;charset=utf-8" -d @file.json

where:

  • apiRoot is for accessing the HTTP Gateway server at either http://hostname:httpPort or https://hostname:httpsPort.

  • file.json is the JSON file that specifies the usage consumption object to create.

Example of Request Body

The following is an example of the contents of file.json sent as the request body:

{ 
   "partyAccount": [{
      "id": "6500000427",
      "name": "Test 1",
      "status": "Active"
   }],
   "searchCriteria": {},
   "queryUsageConsumptionDate": "2022-07-12T04:32:10.703Z"
}

Example of Response Body

If successful, the response code 201 is returned along with a header and a response body. The following shows sample header contents:

connection: keep-alive
content-type: application/json;charset=utf-8
date: Tue, 12 Jul 2022 10:07:16 +0530
transfer-encoding: chunked

The following shows sample response body contents:

{
   "id": "42c65e01-cc53-4a2a-9bce-ce0965958452",
   "href": "apiroot/queryUsageConsumption/42c65e01-cc53-4a2a-9bce-ce0965958452",
   "queryUsageConsumptionDate": "2022-07-12T10:07:16.999+05:30",
   "partyAccount": [
      {
         "id": "6500000427",
         "name": "Test 1",
         "status": "Active"
      }
   ],
   "usageConsumption": [
      {
         "creationDate": "2022-07-12T10:07:17.002+05:30",
         "bucketRefOrValue": [
            {
               "id": "840",
               "remainingValueName": "-10000.0 USD",
               "logicalResource": [
                  {
                     "id": "6500000427"
                  }
               ],
               "partyAccount": {
                  "id": "6500000427"
               },
               "remainingValue": {
                  "amount": -10000,
                  "units": "840"
               }
            }
         ],
         "state": "done"
      }
   ]
}

If the request fails, the response includes the appropriate HTTP code. For a 4xx/5xx code, the message body also contains a ProblemDetails structure with the cause attribute set to the appropriate application error.

Back to Top