Get All Shopping Lists
Retrieves a list of shopping lists. You can filter the results by company, corporate company or customer and page through them.
HTTP Request
- URL:
/shoppingList/all - Method:
GET - Headers:
accessToken: Required. Your API access token.
- Required scope:
READ_SHOPPINGLISTorREAD_WRITE_SHOPPINGLIST
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page | Integer | Page number to retrieve. Default is 1. |
limit | Integer | Number of shopping lists per page. Default is 10. |
corporateCompany | String | Return only lists for this corporate company ID. Takes priority over company. |
company | String | Return only lists for this company ID. |
customer | String | Return only lists for this customer ID. |
cURL Example
curl --location '<BASE_URL>/shoppingList/all?page=1&limit=10&company=65ba028af764f931f1c7c18b' \
--header 'accessToken: <ACCESS_TOKEN>'
Response
- 200 OK: The list of shopping lists was returned successfully.
- 400 Bad Request: The access token is missing or invalid, does not have the required scope, or a filter ID is not valid.
Sample JSON Response
{
"success": true,
"data": [
{
"_id": "6722d1a4b7c3e85f2a9d0b10",
"id": "6722d1a4b7c3e85f2a9d0b10",
"name": "Monthly Site Supplies",
"company": "65ba028af764f931f1c7c18b",
"customer": "66d07121db294e0b70180bf6",
"corporateCompany": null,
"isLocked": false,
"status": "pending",
"products": [
{
"_id": "6722d1a4b7c3e85f2a9d0b11",
"productId": "65b88ef5045a7d009e79974b",
"quantity": 4
},
{
"_id": "6722d1a4b7c3e85f2a9d0b12",
"productId": "66b4a01249e6ce3d41c428fa",
"variantId": "66d5a286fcb786834cebb16a",
"quantity": 20
}
],
"metaFields": [],
"createdBy": {
"id": "6650c2e9f1a3b84d2e7a9c01",
"name": "ERP Integration",
"type": "api"
},
"order": 0,
"createdAt": "2024-10-31T08:20:52.417Z",
"updatedAt": "2024-10-31T08:20:52.417Z"
}
],
"pagination": {
"count": 1,
"page": 1,
"total": 1
}
}
Response Details
| Field | Type | Description |
|---|---|---|
success | Boolean | Whether the request was successful. |
data | Array | List of shopping lists. |
pagination | Object | Pagination details. See below. |
Shopping List Data
Each shopping list has the same fields as described in Get Single Shopping List.
Pagination Details
| Field | Type | Description |
|---|---|---|
count | Integer | Number of shopping lists returned on this page. |
page | Integer | Current page number. |
total | Integer | Total number of shopping lists matching the filters. |