Skip to main content

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_SHOPPINGLIST or READ_WRITE_SHOPPINGLIST

Query Parameters​

ParameterTypeDescription
pageIntegerPage number to retrieve. Default is 1.
limitIntegerNumber of shopping lists per page. Default is 10.
corporateCompanyStringReturn only lists for this corporate company ID. Takes priority over company.
companyStringReturn only lists for this company ID.
customerStringReturn 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​

FieldTypeDescription
successBooleanWhether the request was successful.
dataArrayList of shopping lists.
paginationObjectPagination details. See below.

Shopping List Data​

Each shopping list has the same fields as described in Get Single Shopping List.

Pagination Details​

FieldTypeDescription
countIntegerNumber of shopping lists returned on this page.
pageIntegerCurrent page number.
totalIntegerTotal number of shopping lists matching the filters.