Create a Usage Consumption Object
{apiRoot}/queryUsageConsumption
Request
There are no request parameters for this operation.
- application/json;charset=utf-8
object
-
@baseType: string
When sub-classing, this defines the super-class.
-
@schemaLocation: string
(uri)
A URI to a JSON-schema file that defines additional attributes and relationships.
-
@type: string
When sub-classing, this defines the sub-class extension name.
-
partyAccount: array
partyAccount
A reference to the account that owns the bucket.
-
queryUsageConsumptionDate: string
(date-time)
The date when the usage consumption query was submitted.
- relatedParty: array relatedParty
-
searchCriteria(required): object
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).
array
-
Array of:
object PartyAccountRef
A party account reference, which is an arrangement that a party has with an enterprise that provides products to the party.
object
-
@baseType: string
When sub-classing, this defines the super class.
-
@schemaLocation: string
(uri)
The URI to a JSON schema file that defines additional attributes and relationships.
-
@type: string
When sub-classing, this defines the sub-class extension name.
-
bucketRefOrValue: array
bucketRefOrValue
The buckets included in the subscribed offer.
-
creationDate: string
(date-time)
The date and time that the usage consumption object was created.
-
description: string
A brief description of the usage consumption object.
-
href: string
(uri)
The usage consumption object's hyperlink reference.
-
id: string
The ID of the usage consumption object.
-
lastUpdate: string
(date-time)
The date and time when the object's status was last changed.
-
logicalResource: array
logicalResource
-
name: string
The name of the usage consumption object.
-
partyAccount: array
partyAccount
The account that owns the bucket.
-
product: array
product
- relatedParty: array relatedParty
-
service: array
service
-
state: string
Allowed Values:
[ "accepted", "terminatedWithError", "inProgress", "done" ]
The task state. -
validPeriod: object
TimePeriod
A time period, as an end time, a start time, or both.
object
-
@baseType: string
When sub-classing, this defines the super-class.
-
@referredType: string
The actual type of target instance when needed for disambiguation.
-
@schemaLocation: string
(uri)
A URI to a JSON-schema file that defines additional attributes and relationships.
-
@type: string
When sub-classing, this defines the sub-class extension name.
-
description: string
A detailed description of the party account.
-
href: string
A reference to the party account.
-
id(required): string
The ID of the party account.
-
name: string
The name of the party account.
-
status: string
The condition of the account, such as due, paid, or in arrears.
object
-
@baseType: string
When sub-classing, this defines the super-class.
-
@referredType(required): string
The target instance's actual type (when needed for disambiguation).
-
@schemaLocation: string
(uri)
A URI to a JSON-schema file that defines additional attributes. and relationships
-
@type: string
When sub-classing, this defines the sub-class extension name.
-
href: string
(uri)
The hyperlink reference.
-
id(required): string
The ID of the related party.
-
name: string
The name of the related entity.
-
role: string
The role played by the related party.
array
-
Array of:
object 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.
array
-
Array of:
object UsageConsumptionLogicalResourceRef
A logical resource.
array
-
Array of:
object PartyAccountRef
A party account reference, which is an arrangement that a party has with an enterprise that provides products to the party.
object
-
endDateTime: string
(date-time)
The end of the time period, using IETC-RFC-3339 format.Example:
1985-04-12T23:20:50.520Z
-
startDateTime: string
(date-time)
The start of the time period, using IETC-RFC-3339 format.Example:
1985-04-12T23:20:50.520Z
object
-
@baseType: string
When sub-classing, this defines the super-class.
-
@schemaLocation: string
(uri)
A URI to a JSON-schema file that defines additional attributes. and relationships
-
@type: string
When sub-classing, this defines the sub-class extension name.
-
bucketCounter: array
bucketCounter
-
bucketRelationship: array
bucketRelationship
-
description: string
A description of the bucket's contents.
-
href: string
The hyperlink reference to the bucket resource.
-
id: string
The ID of the bucket.
- isShared: boolean
-
logicalResource: array
logicalResource
-
name: string
The friendly name for the bucket.
-
partyAccount: object
PartyAccountRef
A party account reference, which is an arrangement that a party has with an enterprise that provides products to the party.
-
product: array
product
- relatedParty: array relatedParty
-
remainingValue: object
Quantity
An amount in a specified unit.
-
remainingValueName: string
The bucket's remaining amount, in a formatted string. For example, 1.9 Gb. This formatted string could be used for display.
-
reserveBalance: array
reserveBalance
-
reservedValue: object
Quantity
An amount in a specified unit.
-
service: array
service
-
status: string
The bucket's status, such as active, expired, or suspended.
-
usageType: string
The type of balance, such as data, voice, or a currency.
-
validFor: object
TimePeriod
A time period, as an end time, a start time, or both.
array
-
Array of:
object ConsumptionSummary
Details about a consumption counter (called ConsumptionSummary in the SID model).
array
-
Array of:
object BucketRelationship
A linked bucket.
array
-
Array of:
object UsageConsumptionLogicalResourceRef
A logical resource.
object
-
amount: number
(float)
Default Value:
1
The numeric value for a specified unit. -
units: string
The unit.
array
-
Array of:
object ReserveBalanceRef
A reserve balance resource, which allows adjustments to be made to the original balance topup.
object
-
@baseType: string
When sub-classing, this defines the super-class.
-
@schemaLocation: string
(uri)
A URI to a JSON-schema file that defines additional attributes and relationships.
-
@type: string
When sub-classing, this defines the sub-class extension name.
-
consumptionPeriod: object
TimePeriod
A time period, as an end time, a start time, or both.
-
counterType: string
The type of consumption counter. For example: counterType=used or counterType=outOfBucket.
-
href: string
(uri)
The hyperlink reference to the summary usage consumption report.
-
id: string
The ID of the summary usage consumption report.
-
level: string
The counter level. The counter can be provided for the bucket globally across all users, detailed by user, or detailed by network product.
-
user: object
RelatedParty
A related party, which defines the party or party role linked to a specific entity.
-
value: object
Quantity
An amount in a specified unit.
-
valueName: string
The value of the counter, in a formatted string used for display.
object
-
@baseType: string
When sub-classing, this defines the super-class.
-
@schemaLocation: string
(uri)
A URI to a JSON-schema file that defines additional attributes and relationships.
-
@type: string
When sub-classing, this defines the sub-class extension name.
-
bucketRefOrValue(required): object
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.
-
relationshipType(required): string
The type of bucket relationship, such as isAggregated if the bucket is a part of another bucker or aggregator if the bucket holds other buckets.
object
-
@baseType: string
When sub-classing, this defines the super class.
-
@referredType: string
The actual type of the target instance (when needed for disambiguation).
-
@schemaLocation: string
(uri)
The URI to the JSON schema file that defines additional attributes and relationships.
-
@type: string
When sub-classing, this defines the sub-class extension name.
-
consumptionSummary: array
consumptionSummary
-
href: string
(uri)
The usage consumption logical resource's href.
-
id(required): string
The ID of the usage consumption logical resource.
-
name: string
The name of the consumption logical resource's hyperlink reference.
array
-
Array of:
object ConsumptionSummary
Details about a consumption counter (called ConsumptionSummary in the SID model).
object
-
@baseType: string
When sub-classing, this defines the super class.
-
@referredType: string
The target instance's actual type (when needed for disambiguation).
-
@schemaLocation: string
(uri)
The URI to the JSON-schema file that defines additional attributes.
-
@type: string
When sub-classing, this defines the sub-class extension name.
-
consumptionSummary: array
consumptionSummary
-
href: string
(uri)
The usage consumption product's hyperlink reference.
-
id(required): string
The ID of the usage consumption product.
-
name: string
The name of the usage consumption product.
array
-
Array of:
object ConsumptionSummary
Details about a consumption counter (called ConsumptionSummary in the SID model).
object
-
@baseType: string
When sub-classing, this defines the super class.
-
@referredType: string
The target instance's actual type (when needed for disambiguation).
-
@schemaLocation: string
(uri)
The URI to a JSON schema file that defines additional attributes and relationships.
-
@type: string
When sub-classing, this defines the sub-class extension name.
-
href: string
(uri)
The reserve balance resource's hyperlink reference.
-
id(required): string
The ID of the reserve balance resource.
-
name: string
The name of the reserve balance resource.
object
-
@baseType: string
When sub-classing, this defines the super class.
-
@referredType: string
The target instance's actual type (when needed for disambiguation).
-
@schemaLocation: string
(uri)
The URI to a JSON schema file that defines additional attributes and relationships.
-
@type: string
When sub-classing, this defines the sub-class extension name.
-
href: string
(uri)
The service's hyperlink reference.
-
id(required): string
The ID of the service.
-
name: string
The name of the service.
Response
- application/json;charset=utf-8
201 Response
object
-
@baseType: string
When sub-classing, this defines the super-class.
-
@schemaLocation: string
(uri)
A URI to a JSON-schema file that defines additional attributes and relationships.
-
@type: string
When sub-classing, this defines the sub-class extension name.
-
href: string
(uri)
A hyperlink reference.
-
id: string
The ID of the usage consumption object.
-
partyAccount: array
partyAccount
A reference to the account that owns the bucket.
-
queryUsageConsumptionDate: string
(date-time)
The date when the request was submitted.
- relatedParty: array relatedParty
-
searchCriteria: object
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).
-
usageConsumption: array
usageConsumption
A usage consumption report with the current counters and balances.
array
-
Array of:
object PartyAccountRef
A party account reference, which is an arrangement that a party has with an enterprise that provides products to the party.
object
-
@baseType: string
When sub-classing, this defines the super class.
-
@schemaLocation: string
(uri)
The URI to a JSON schema file that defines additional attributes and relationships.
-
@type: string
When sub-classing, this defines the sub-class extension name.
-
bucketRefOrValue: array
bucketRefOrValue
The buckets included in the subscribed offer.
-
creationDate: string
(date-time)
The date and time that the usage consumption object was created.
-
description: string
A brief description of the usage consumption object.
-
href: string
(uri)
The usage consumption object's hyperlink reference.
-
id: string
The ID of the usage consumption object.
-
lastUpdate: string
(date-time)
The date and time when the object's status was last changed.
-
logicalResource: array
logicalResource
-
name: string
The name of the usage consumption object.
-
partyAccount: array
partyAccount
The account that owns the bucket.
-
product: array
product
- relatedParty: array relatedParty
-
service: array
service
-
state: string
Allowed Values:
[ "accepted", "terminatedWithError", "inProgress", "done" ]
The task state. -
validPeriod: object
TimePeriod
A time period, as an end time, a start time, or both.
array
-
Array of:
object 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).
object
-
@baseType: string
When sub-classing, this defines the super-class.
-
@referredType: string
The actual type of target instance when needed for disambiguation.
-
@schemaLocation: string
(uri)
A URI to a JSON-schema file that defines additional attributes and relationships.
-
@type: string
When sub-classing, this defines the sub-class extension name.
-
description: string
A detailed description of the party account.
-
href: string
A reference to the party account.
-
id(required): string
The ID of the party account.
-
name: string
The name of the party account.
-
status: string
The condition of the account, such as due, paid, or in arrears.
object
-
@baseType: string
When sub-classing, this defines the super-class.
-
@referredType(required): string
The target instance's actual type (when needed for disambiguation).
-
@schemaLocation: string
(uri)
A URI to a JSON-schema file that defines additional attributes. and relationships
-
@type: string
When sub-classing, this defines the sub-class extension name.
-
href: string
(uri)
The hyperlink reference.
-
id(required): string
The ID of the related party.
-
name: string
The name of the related entity.
-
role: string
The role played by the related party.
array
-
Array of:
object 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.
array
-
Array of:
object UsageConsumptionLogicalResourceRef
A logical resource.
array
-
Array of:
object PartyAccountRef
A party account reference, which is an arrangement that a party has with an enterprise that provides products to the party.
object
-
endDateTime: string
(date-time)
The end of the time period, using IETC-RFC-3339 format.Example:
1985-04-12T23:20:50.520Z
-
startDateTime: string
(date-time)
The start of the time period, using IETC-RFC-3339 format.Example:
1985-04-12T23:20:50.520Z
object
-
@baseType: string
When sub-classing, this defines the super-class.
-
@schemaLocation: string
(uri)
A URI to a JSON-schema file that defines additional attributes. and relationships
-
@type: string
When sub-classing, this defines the sub-class extension name.
-
bucketCounter: array
bucketCounter
-
bucketRelationship: array
bucketRelationship
-
description: string
A description of the bucket's contents.
-
href: string
The hyperlink reference to the bucket resource.
-
id: string
The ID of the bucket.
- isShared: boolean
-
logicalResource: array
logicalResource
-
name: string
The friendly name for the bucket.
-
partyAccount: object
PartyAccountRef
A party account reference, which is an arrangement that a party has with an enterprise that provides products to the party.
-
product: array
product
- relatedParty: array relatedParty
-
remainingValue: object
Quantity
An amount in a specified unit.
-
remainingValueName: string
The bucket's remaining amount, in a formatted string. For example, 1.9 Gb. This formatted string could be used for display.
-
reserveBalance: array
reserveBalance
-
reservedValue: object
Quantity
An amount in a specified unit.
-
service: array
service
-
status: string
The bucket's status, such as active, expired, or suspended.
-
usageType: string
The type of balance, such as data, voice, or a currency.
-
validFor: object
TimePeriod
A time period, as an end time, a start time, or both.
array
-
Array of:
object ConsumptionSummary
Details about a consumption counter (called ConsumptionSummary in the SID model).
array
-
Array of:
object BucketRelationship
A linked bucket.
array
-
Array of:
object UsageConsumptionLogicalResourceRef
A logical resource.
object
-
amount: number
(float)
Default Value:
1
The numeric value for a specified unit. -
units: string
The unit.
array
-
Array of:
object ReserveBalanceRef
A reserve balance resource, which allows adjustments to be made to the original balance topup.
object
-
@baseType: string
When sub-classing, this defines the super-class.
-
@schemaLocation: string
(uri)
A URI to a JSON-schema file that defines additional attributes and relationships.
-
@type: string
When sub-classing, this defines the sub-class extension name.
-
consumptionPeriod: object
TimePeriod
A time period, as an end time, a start time, or both.
-
counterType: string
The type of consumption counter. For example: counterType=used or counterType=outOfBucket.
-
href: string
(uri)
The hyperlink reference to the summary usage consumption report.
-
id: string
The ID of the summary usage consumption report.
-
level: string
The counter level. The counter can be provided for the bucket globally across all users, detailed by user, or detailed by network product.
-
user: object
RelatedParty
A related party, which defines the party or party role linked to a specific entity.
-
value: object
Quantity
An amount in a specified unit.
-
valueName: string
The value of the counter, in a formatted string used for display.
object
-
@baseType: string
When sub-classing, this defines the super-class.
-
@schemaLocation: string
(uri)
A URI to a JSON-schema file that defines additional attributes and relationships.
-
@type: string
When sub-classing, this defines the sub-class extension name.
-
bucketRefOrValue(required): object
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.
-
relationshipType(required): string
The type of bucket relationship, such as isAggregated if the bucket is a part of another bucker or aggregator if the bucket holds other buckets.
object
-
@baseType: string
When sub-classing, this defines the super class.
-
@referredType: string
The actual type of the target instance (when needed for disambiguation).
-
@schemaLocation: string
(uri)
The URI to the JSON schema file that defines additional attributes and relationships.
-
@type: string
When sub-classing, this defines the sub-class extension name.
-
consumptionSummary: array
consumptionSummary
-
href: string
(uri)
The usage consumption logical resource's href.
-
id(required): string
The ID of the usage consumption logical resource.
-
name: string
The name of the consumption logical resource's hyperlink reference.
array
-
Array of:
object ConsumptionSummary
Details about a consumption counter (called ConsumptionSummary in the SID model).
object
-
@baseType: string
When sub-classing, this defines the super class.
-
@referredType: string
The target instance's actual type (when needed for disambiguation).
-
@schemaLocation: string
(uri)
The URI to the JSON-schema file that defines additional attributes.
-
@type: string
When sub-classing, this defines the sub-class extension name.
-
consumptionSummary: array
consumptionSummary
-
href: string
(uri)
The usage consumption product's hyperlink reference.
-
id(required): string
The ID of the usage consumption product.
-
name: string
The name of the usage consumption product.
array
-
Array of:
object ConsumptionSummary
Details about a consumption counter (called ConsumptionSummary in the SID model).
object
-
@baseType: string
When sub-classing, this defines the super class.
-
@referredType: string
The target instance's actual type (when needed for disambiguation).
-
@schemaLocation: string
(uri)
The URI to a JSON schema file that defines additional attributes and relationships.
-
@type: string
When sub-classing, this defines the sub-class extension name.
-
href: string
(uri)
The reserve balance resource's hyperlink reference.
-
id(required): string
The ID of the reserve balance resource.
-
name: string
The name of the reserve balance resource.
object
-
@baseType: string
When sub-classing, this defines the super class.
-
@referredType: string
The target instance's actual type (when needed for disambiguation).
-
@schemaLocation: string
(uri)
The URI to a JSON schema file that defines additional attributes and relationships.
-
@type: string
When sub-classing, this defines the sub-class extension name.
-
href: string
(uri)
The service's hyperlink reference.
-
id(required): string
The ID of the service.
-
name: string
The name of the service.
400 Response
object
-
@baseType: string
When sub-classing, this defines the super class.
-
@schemaLocation: string
(uri)
The URI to a JSON-schema file that defines additional attributes and relationships.
-
@type: string
When sub-classing, this defines the sub-class entity name.
-
code(required): string
The error code, which contains application-relevant detail.
-
message: string
Additional details about the error as well as possible corrective actions.
-
reason(required): string
The reason for the error that can be shown to a client user.
-
referenceError: string
(uri)
The URI to the documentation describing the error.
-
status: string
The HTTP error code extension.
401 Response
object
-
@baseType: string
When sub-classing, this defines the super class.
-
@schemaLocation: string
(uri)
The URI to a JSON-schema file that defines additional attributes and relationships.
-
@type: string
When sub-classing, this defines the sub-class entity name.
-
code(required): string
The error code, which contains application-relevant detail.
-
message: string
Additional details about the error as well as possible corrective actions.
-
reason(required): string
The reason for the error that can be shown to a client user.
-
referenceError: string
(uri)
The URI to the documentation describing the error.
-
status: string
The HTTP error code extension.
403 Response
object
-
@baseType: string
When sub-classing, this defines the super class.
-
@schemaLocation: string
(uri)
The URI to a JSON-schema file that defines additional attributes and relationships.
-
@type: string
When sub-classing, this defines the sub-class entity name.
-
code(required): string
The error code, which contains application-relevant detail.
-
message: string
Additional details about the error as well as possible corrective actions.
-
reason(required): string
The reason for the error that can be shown to a client user.
-
referenceError: string
(uri)
The URI to the documentation describing the error.
-
status: string
The HTTP error code extension.
405 Response
object
-
@baseType: string
When sub-classing, this defines the super class.
-
@schemaLocation: string
(uri)
The URI to a JSON-schema file that defines additional attributes and relationships.
-
@type: string
When sub-classing, this defines the sub-class entity name.
-
code(required): string
The error code, which contains application-relevant detail.
-
message: string
Additional details about the error as well as possible corrective actions.
-
reason(required): string
The reason for the error that can be shown to a client user.
-
referenceError: string
(uri)
The URI to the documentation describing the error.
-
status: string
The HTTP error code extension.
409 Response
object
-
@baseType: string
When sub-classing, this defines the super class.
-
@schemaLocation: string
(uri)
The URI to a JSON-schema file that defines additional attributes and relationships.
-
@type: string
When sub-classing, this defines the sub-class entity name.
-
code(required): string
The error code, which contains application-relevant detail.
-
message: string
Additional details about the error as well as possible corrective actions.
-
reason(required): string
The reason for the error that can be shown to a client user.
-
referenceError: string
(uri)
The URI to the documentation describing the error.
-
status: string
The HTTP error code extension.
500 Response
object
-
@baseType: string
When sub-classing, this defines the super class.
-
@schemaLocation: string
(uri)
The URI to a JSON-schema file that defines additional attributes and relationships.
-
@type: string
When sub-classing, this defines the sub-class entity name.
-
code(required): string
The error code, which contains application-relevant detail.
-
message: string
Additional details about the error as well as possible corrective actions.
-
reason(required): string
The reason for the error that can be shown to a client user.
-
referenceError: string
(uri)
The URI to the documentation describing the error.
-
status: string
The HTTP error code extension.
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.