Introduction
Beginning in release 24D, Oracle CPQ customers can download daily business metrics to either a CSV file or as JSON via a new REST API endpoint. Previously, CPQ site metrics were reported to the Oracle Cloud My Account Portal but form now on this self-service capability enables customers to gain insight into their CPQ application and the business impact over time.
You can review the feature download business metrics to a CSV file in the 24D What’s New documentation. This post will focus on how you can use the new Metrics REST API.
Available Business Metrics
There are a number of types of values that are available via the Metrics REST API including API, Login, and Quoting metrics. You can find a list of all the available metrics Oracle CPQ documentation. Metrics are listed below with the name as it appears in the Metrics REST API JSON response
API Metrics
| Name | Display Name | Description |
|---|---|---|
|
APILICENSES
|
API Licenses | Total number of consumed API licenses by web services users during the specified time range |
|
ECOMMERCEINTERACTIONS
|
eCommerce Interactions |
Total number of eCommerce interactions collected during the specified time range. |
|
DISKSPACE
|
Disk Space |
Combined disk space size of all Commerce attachment attribute values and file manager files in Gigabytes (GB) |
Login Metrics
| Name | Display Name | Description |
|---|---|---|
|
INTERNALUSERS
|
Internal Users | Total number of active internal users |
|
REMAININGINTERNALLICENSES
|
Internal Licenses |
Number of licenses remaining for internal users |
|
INTERNALUSERSLOGGEDIN
|
Internal Users Logged In |
Total number of unique internal users that have logged in during the specified time range |
|
PERCENTINTERNALUSERSLOGGEDIN
|
Percentage of Internal Users Logged In |
Percentage of all internal users that have logged in during the specified time range |
|
PARTNERUSERS
|
Partner Users |
Total number of active partner users |
|
PARTNERUSERSLOGGEDIN
|
Partner Users Logged In |
Number of licenses remaining for partner users |
|
PERCENTPARTNERUSERSLOGGEDIN
|
Percentage of Partner Users Logged In |
Percentage of all partner users that have logged in during the specified time range |
Quote & Quote Performance Metrics
| Name | Display Name | Description |
|---|---|---|
|
QUOTES
|
Quotes | Total number of new quotes that were both created and saved at least once during the specified time range |
|
INTERNALQUOTES
|
Internal Quotes | Total number of internal quotes created during the specified time range |
|
PARTNERQUOTES
|
Partner Quotes | Total number of partner quotes created during the specified time range |
|
NEWQUOTEAVGRESPONSETIME
|
Average Time to Create a Quote |
Average time (ms) it took to create a new quote during the specified time range |
|
NEWQUOTE90RESPONSETIME
|
Ninetieth Percentile Response Time To Create a New Quote |
90th percentile response time (ms) to create a new quote during the specified time range |
REST API Endpoint Usage
Use the Metrics REST API endpoint to retrieve all business metrics in a 24-hour UTC interval, where {{host}} is your Oracle CPQ host and {{version}} your supported version (v17+)
GET https://{{host}}/rest/{{version}}/metrics
The endpoint supports the q parameter which declares a query specification expression in MongoDB format. See MongoDB Query Specifications for more information in how to user the syntax.
Example Requests
Some example use cases for employing the q parameter to filter the results are:
- All relevant metrics are calculated once per day so retrieve one day’s worth of metrics by querying the dateAdded attribute.
-
{$and:[{dateAdded:{$gt:"2025-02-18"}},{dateAdded:{$lt:"2025-02-19"}}]}
-
- Get metrics by type and date added
-
{$and:[{name:"NEWQUOTE90RESPONSETIME"},{dateAdded:{$gt:"2025-01-01"}},{dateAdded:{$lt:"2025-01-31"}}]}
-
- Get all metrics based on start and end times. Note, the start and end times are not consistent across all metrics.
-
{$and:[{startTime:{$gte:"2025-02-19T00:00:00.000Z"}},{endTime:{$lte:"2025-02-19T23:59:59.000Z"}}]}
-
- Get all metrics by type
-
{name:"NEWQUOTE90RESPONSETIME"}
-
- Get all metrics by multiple types
-
{name:{$in:["NEWQUOTE90RESPONSETIME", "NEWQUOTEAVGRESPONSETIME"]}}
-
Example Response
So that you know what you’ll be working with, here’s an example response for the request:
GET https://{{host}}/rest/{{version}}/metrics?offset=0&limit=1000&q={name:\”NEWQUOTE90RESPONSETIME\”}&totalResults=true
{
"items": [
{
"metricsId": "1000000163",
"name": "NEWQUOTE90RESPONSETIME",
"value": "8322",
"startTime": "2025-02-18T00:00:00.000Z",
"endTime": "2025-02-18T23:59:59.000Z",
"dateModified": "2025-02-19T14:00:06.000Z",
"dateAdded": "2025-02-19T14:00:06.000Z"
},
{
"metricsId": "1000000163",
"name": "NEWQUOTE90RESPONSETIME",
"value": "6436",
"startTime": "2025-02-17T00:00:00.000Z",
"endTime": "2025-02-17T23:59:59.000Z",
"dateModified": "2025-02-18T14:00:07.000Z",
"dateAdded": "2025-02-18T14:00:07.000Z"
}
],
"offset": 0,
"limit": 1000,
"count": 2,
"totalResults": 2,
"hasMore": false,
"links": [
{
"rel": "canonical",
"href": "https://{{host}}/rest/{{version}}/metrics"
},
{
"rel": "self",
"href": "https://{{host}}/rest/{{version}}/metrics?offset=0&limit=1000&q={name:\"NEWQUOTE90RESPONSETIME\"}&totalResults=true"
}
]
}
Summary
Remember if you want to simply download a CSV file with the business metrics, follow the instructions in the steps to enable. However, if you want to script the regular download of metrics so you can integrate with other business reporting, the Metrics REST API is the way to go.
Happy hunting!
~sn
