Skip to main content

Fetch usage processing status

This topic is about Metered usage V2. Marketplaces use the Metered usage V1 API, Metered usage V2 API, or both, to support metered usage billing. See also: Metered usage V1.

Description: Retrieve the status of metered usage events submitted with Billing Usage v2 requests (see Send preconfigured metered usage and Send preconfigured and custom metered usage). To do so, reference the response for the Billing Usage v2 request and either

  • use the unique, preformatted URL provided in the response
  • insert the requestId, which uniquely identifies the request and events submitted with it, from the response, in this endpoint

Endpoint URL: {base marketplace URL}/api/integration/v2/billing/usage/requests/{requestId}

The {base marketplace URL} is the base URL for the marketplace that hosts the user account.

Request operation: GET

Mandatory parameters in the request:

  • requestId—Unique system-assigned identifier for the API request used to submit the metered usage; returned with the Billing Usage v2 submission response.

Response

The response includes, but is not limited to, the following information:

  • status—Status of the call
  • totalUsagesCount—Number of usage events submitted
  • processedUsagesCount—Number of usage events for which processing was successful
  • failedUsagesCount—Number of usage events for which processing failed
  • failedUsages—An array of failed usage events with event identifiers, error codes, and error descriptions

The statuses are defined as follows:

  • Successful—Processing for all preconfigured and custom pricing usage events sent with the request was successful
  • Failed—Processing for at least one preconfigured and custom pricing usage event sent with the request failed
  • Ready—Volume pricing usage events were saved, ready for processing at the end of the billing period when the total volume is rated
  • Processing—Event processing is in progress

Response examples

The following JSON response examples are for calls made to fetch the status of metered usage events for the following request identifiers:

  • 8153589e-f024-477e-96af-1a8fe12a33c7
  • 8153589e-f024-477e-96af-1a8fe12a33c8
  • 8153589e-f024-477e-96af-1a8fe12a33c9
  • 8153589e-f024-477e-96af-1a8fe12a33d0

In this scenario, 11 events were sent. The request status is SUCCESSFUL because processing for all the events was successful.

{
"requestId": "8153589e-f024-477e-96af-1a8fe12a33c7",
"idempotencyKey": "1234567ABCDEFG",
"status": "SUCCESSFUL",
"totalUsagesCount": "11",
"processedUsagesCount": "11",
"failedUsagesCount": "0",
"failedUsages":[]
}

Was this page helpful?