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
| Header | Type | Description |
|---|---|---|
accessToken | string | Access 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
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates the status of the request, typically true if successful. |
data | array | A list of price list objects. |
pagination | object | Pagination information. |
Data Array:
Each item in the data array represents a price list with the following fields:
| Field | Type | Description |
|---|---|---|
_id | string | Unique identifier of the price list. |
name | string | The name of the price list. |
status | boolean | Current status of the price list. |
products | array | List of products included in the price list. |
createdAt | string | Timestamp when the price list was created. |
updatedAt | string | Timestamp when the price list was last updated. |
id | string | Duplicate of _id, unique identifier. |
Products Array:
Each item in the products array represents a product and can include the following fields:
| Field | Type | Description |
|---|---|---|
product | string | Unique identifier of the product. |
variants | array | Variants associated with the product. |
discount | number | Discount applied to the product. |
price | number | Price of the product. |
tierPrice | array | Tier pricing details associated with the product. |
_id | string | Unique identifier of the product entry. |
Tier Price Array:
Each item in the tierPrice array provides tier pricing details with the following fields:
| Field | Type | Description |
|---|---|---|
quantity | number | Minimum quantity required for this tier pricing. |
discount | number | Discount percentage or amount for this tier. |
price | number | Tier-specific price for the product. |
tierPricingType | string | Type of tier pricing, e.g., "discount" or "fixed". |
Pagination Object:
| Field | Type | Description |
|---|---|---|
page | int | Current page number. |
total | int | Total number of price lists. |
count | int | Number of price lists on this page. |
Error Responses
| Status Code | Description |
|---|---|
| 400 | Bad Request: Invalid input data. |
| 401 | Unauthorized: Access token is invalid or missing. |
| 500 | Internal 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.