# Query offer statistics per product This endpoint can be used to query offer statistics (e.g. offer count, average price) grouped by product. Only the most recent market data is considered per product and domain. Endpoint: POST /api/v3.1/vendor/contracts/{contractId}/offers/stats/query Version: 0.0.7228 Security: BasicAuth, BearerAuth ## Path parameters: - `contractId` (string, required) Unique identifier of the contract Example: "qbcxvb" ## Request fields (application/json): - `pagination` (object, required) Specifies the pagination details such as the start index and the number of records to fetch (limit). At maximum it's allowed to query 10,000 records. - `pagination.start` (integer, required) - `pagination.limit` (integer, required) - `range` (object, required) Defines the time range for which offer statistics are queried. Note: The maximum time span between the start and end should not exceed 48 hours. - `range.start` (string, required) The starting point of the time range, represented as a timestamp in ISO 8601 format (e.g., "2023-10-19T13:45:30Z") in UTC. - `range.end` (string, required) The ending point of the time range, represented as a timestamp in ISO 8601 format (e.g., "2023-10-19T14:45:30Z") in UTC. - `filter` (object) An optional parameter to further filter the data based on product criteria. - `filter.oneOf` (object, required) The 'oneOf' represents a product query. - `filter.oneOf.field` (string, required) Specifies the attribute to filter by. It accepts two values: - "customerProductId": Your unique identifier for the product. - "productId": Patagona's internal product id (must be a numerical integer). - `filter.oneOf.values` (array, required) An array of strings containing the ids of the products to be queried. ## Response 200 fields (application/json): - `data` (array, required) - `data.productId` (string, required) Pricemonitor's internal unique product identifier. - `data.offerCount` (integer, required) The number of offers found on all domains for the product. - `data.stats` (object, required) The aggregated offer price statistics for the product. - `data.stats.unitPriceStats` (object, required) Offer statistics considering the unit price. - `data.stats.unitPriceStats.min` (number, required) The minimum offer price. - `data.stats.unitPriceStats.avg` (number, required) The average offer price. - `data.stats.unitPriceStats.max` (number, required) The maximum offer price. - `data.stats.unitPriceStats.cheapestShops` (array, required) The shop names that offer for minimum price. - `data.stats.totalPriceStats` (object, required) Offer statistics considering the unit price plus delivery costs. - `data.stats.domainStats` (array, required) A list of offer statistics per domain. Domains without competitor offers are not included in the list. - `data.stats.domainStats.domain` (string, required) This field specifies the domain where the competitor offers are sourced from. It's a string representing the domain name, such as "google.de". - `data.stats.domainStats.competitorOfferCount` (integer, required) The number of competitor offers available in the specified domain. ## Response 400 fields (application/json): - `errors` (array, required) List of errors that occurred during request processing Example: [{"code":"request.invalid","message":"The provided request data is invalid"},{"code":"resource.invalid","message":"The requested resource could not be found"}] - `errors.code` (string, required) Machine-readable error code for programmatic error handling. Typically follows a structured format like 'request.invalid' or 'resource.invalid'. Example: "request.invalid" - `errors.message` (string, required) Human-readable error message providing details about the issue Example: "The provided email address is not in a valid format"