Skip to main content

Get All Shopping Lists

This API endpoint retrieves a list of shopping lists from the server, allowing you to filter results by various criteria such as company, customer, corporate company, and pagination parameters.

HTTP Request

  • URL: /shoppingList/all
  • Method: GET
  • Headers:
    • accessToken: Required. This is your access token for authenticating the request.

Query Parameters

To effectively retrieve and manage shopping lists, you can include the following query parameters:

ParameterTypeDescription
pageIntegerThe page number to retrieve; defaults to 1 if not specified.
limitIntegerThe number of items to retrieve per page; defaults to 10.
companyStringThe unique identifier of the company whose shopping lists you want to retrieve.
customerStringThe unique identifier of the customer whose shopping lists you want to retrieve.
corporateCompanyStringThe unique identifier of the corporate company for filtering shopping lists.

cURL Example

Below is a sample cURL command that demonstrates how to make a request to the API endpoint:

curl --location '<BASE_URL>/shoppingList/all?page=1&limit=10&company=<COMPANY_ID>&customer=<CUSTOMER_ID>&corporateCompany=<CORPORATE_COMPANY_ID>' \
--header 'accessToken: <ACCESS_TOKEN>'

Response

  • 200 OK: The request was successful, and the server returned a list of shopping lists.
  • 4XX: Client errors indicating issues such as an invalid access token or missing parameters.
  • 5XX: Server errors indicating that something went wrong on the server's end.

Sample JSON Response

Below is an example of the JSON response you might receive from making a request to this endpoint:

{
"success": true,
"data": [
{
"id": "7312abc1648b4f3a8dfd7e89",
"name": "Weekly Grocery List",
"company": "65ba028af764f931f1c7c18b",
"customer": "66d07121db294e0b70180bf6",
"corporateCompany": "71fc71e33e1c4b1576e1a659",
"isLocked": false,
"status": "pending",
"products": [
{
"productId": "65b88ef6045a7d009e79c829",
"quantity": 3
},
{
"productId": "65b88ef6045a7d009e79c829",
"variantId": "66d5a286fcb786834cebb168",
"quantity": 2
}
],
"createdAt": "2024-01-07T10:00:00Z",
"updatedAt": "2024-01-08T12:00:00Z"
}
// Additional shopping lists omitted for brevity...
],
"pagination": {
"page": 1,
"total": 100,
"count": 10
}
}

Response Details

KeyTypeDescription
successBooleanIndicates if the request was successful.
dataArray of ObjectsList of shopping lists.
paginationObjectProvides pagination details.

Shopping List Data

FieldTypeDescription
idStringThe unique identifier of the shopping list.
nameStringName of the shopping list.
companyStringThe unique identifier of the associated company.
customerStringThe unique identifier of the associated customer.
corporateCompanyStringThe unique identifier of the corporate company.
isLockedBooleanIndicates if the list is locked from changes.
statusStringCurrent status of the shopping list.
productsArray of ObjectsList of products in the shopping list.
createdAtStringDate and time the list was created (ISO 8601 format).
updatedAtStringDate and time the list was last updated (ISO 8601 format).

Products Data

FieldTypeDescription
productIdStringUnique identifier for the product.
variantIdStringUnique identifier for the product variant.
quantityNumberQuantity of the product or variant in the list.

Pagination Details

KeyTypeDescription
pageIntegerCurrent page number.
totalIntegerTotal number of items available.
countIntegerNumber of items returned in this response.

Notes

  • Ensure that the accessToken provided is valid and has not expired.
  • The query parameters can help filter and paginate the list of shopping lists effectively.