Get needs summary by product
This endpoint returns the summary of the needs of a product for a specific day.
GET /api/v1/businesses/{businessId}/products/{productId}/needs/summary/{yyyy-MM-dd}
In the request URL, the following parameters must be specified:
-
Business identifier (businessId).
-
Product or section identifier (productId).
-
Date for which the query is made
yyyy-MM-dd
.
If the data included in the request URL is correct, the response will contain the needs of the product or section with all the defined information for them.
Below are some examples (response fragments):
[
{
"location": "HD",
"locationId": "HD",
"locationType": "VARIABLE",
"product": "0001_HD",
"service": "0001",
"timeSlots": [
{
"from": "2024-07-18T17:00:00.000Z",
"to": "2024-07-18T17:15:00.000Z",
"applied": 1,
"real": 1,
"reference": 1
},
{
"from": "2024-07-18T17:15:00.000Z",
"to": "2024-07-18T17:30:00.000Z",
"applied": 1,
"real": 1,
"reference": 1
}
]
}
]
[
{
"location": "SALES",
"locationId": "03",
"locationType": "VARIABLE",
"product": "0001-G",
"service": "0001",
"timeSlots": [
{
"from": "2024-07-19T08:00:00.000Z",
"to": "2024-07-19T08:15:00.000Z",
"real": 5
},
{
"from": "2024-07-19T08:15:00.000Z",
"to": "2024-07-19T08:30:00.000Z",
"real": 5
}
]
},
{
"location": "FITTING ROOMS",
"locationId": "06",
"locationType": "VARIABLE",
"product": "0001-G",
"service": "0001",
"timeSlots": [
{
"from": "2024-07-19T07:00:00.000Z",
"to": "2024-07-19T07:15:00.000Z",
"real": 2
},
{
"from": "2024-07-19T07:15:00.000Z",
"to": "2024-07-19T07:30:00.000Z",
"real": 2
}
]
}
]
As shown in the examples, the response will depend on the business configuration and how the needs have been generated (manually, integration, etc.).
Considerations
The time slots indicate the time period in UTC, that is, the time zone configured for the service is not considered.
If the product specified in the URL does not exist in the business, the request will return a 404 Not Found
error, with the message not exists.
If there are no needs generated for the date specified in the URL, the request will return a 204 No Content
status.
Useful links
What are needs?
What is the structure of the needs summary?