Skip to main content

Get All Price Lists

The GET endpoint retrieves all price lists available in the system.

Endpoint

  • URL: /priceList/all
  • Method: GET

Authentication

  • Header: accessToken
  • Type: Bearer Token
  • Value: <ACCESS-TOKEN>

Request Headers

HeaderTypeDescription
accessTokenstringAccess token for authentication. (required)

Response

  • Status Code: 200 OK

Sample Response Body

{
"success": true,
"data": [
{
"_id": "66ad153dbf8641f96544341d",
"name": "Pharma Price List",
"status": true,
"products": [
{
"product": "663a0cbe516313e5bc94aa8c",
"variants": [],
"discount": 10,
"price": 58.5,
"tierPrice": [],
"_id": "66fe7afb32aceb199725ae1c"
},
{
"product": "663a0cbe516313e5bc94aa90",
"variants": [],
"discount": 10,
"price": 36,
"tierPrice": [],
"_id": "66fe7afb32aceb199725ae1d"
}
],
"createdAt": "2024-08-02T17:19:57.270Z",
"updatedAt": "2024-10-03T11:07:39.081Z",
"id": "66ad153dbf8641f96544341d"
},
{
"_id": "66d0f6973560dad7cf821e95",
"name": "samsung",
"status": true,
"products": [],
"createdAt": "2024-08-29T22:30:47.429Z",
"updatedAt": "2024-09-06T10:00:01.593Z",
"__v": 0,
"id": "66d0f6973560dad7cf821e95"
}
],
"pagination": {
"page": 1,
"total": 2,
"count": 2
}
}

Success Response Fields

FieldTypeDescription
successbooleanIndicates the status of the request, typically true if successful.
dataarrayA list of price list objects.
paginationobjectPagination information.

Data Array:

Each item in the data array represents a price list with the following fields:

FieldTypeDescription
_idstringUnique identifier of the price list.
namestringThe name of the price list.
statusbooleanCurrent status of the price list.
productsarrayList of products included in the price list.
createdAtstringTimestamp when the price list was created.
updatedAtstringTimestamp when the price list was last updated.
idstringDuplicate of _id, unique identifier.

Products Array:

Each item in the products array represents a product and can include the following fields:

FieldTypeDescription
productstringUnique identifier of the product.
variantsarrayVariants associated with the product.
discountnumberDiscount applied to the product.
pricenumberPrice of the product.
tierPricearrayTier pricing details associated with the product.
_idstringUnique identifier of the product entry.

Tier Price Array:

Each item in the tierPrice array provides tier pricing details with the following fields:

FieldTypeDescription
quantitynumberMinimum quantity required for this tier pricing.
discountnumberDiscount percentage or amount for this tier.
pricenumberTier-specific price for the product.
tierPricingTypestringType of tier pricing, e.g., "discount" or "fixed".

Pagination Object:

FieldTypeDescription
pageintCurrent page number.
totalintTotal number of price lists.
countintNumber of price lists on this page.

Error Responses

Status CodeDescription
400Bad Request: Invalid input data.
401Unauthorized: Access token is invalid or missing.
500Internal Server Error: An error occurred on the server.

Notes

  • Ensure you provide a valid and active access token in the request header to authenticate your request.
  • The response includes pagination details to help with handling large sets of data.