Price List API
Audience: Frontend engineers managing price lists for stores.- Base URL:
https://jethings-backend.fly.dev - Content-Type:
application/json
Conventions
- All responses are JSON.
- Errors follow standard HTTP status codes with
{ message: string }body. - Unless noted, successful responses are
200 OK. - All endpoints require authentication via Bearer token.
- All endpoints require
x-store-idheader to scope requests to a specific store. - Access is controlled through user-store relationships.
Headers
| Header | Type | Required | Description |
|---|---|---|---|
x-store-id | string | ✅ | Store ID associated with the current request |
Authorization | string | ✅ | Bearer token for authentication (e.g., Bearer <token>) |
Get All Price Lists
GET/price-lists
Requires Authentication: Bearer token in Authorization headerRequires Header:
x-store-id
Retrieve a paginated list of price lists for a store with support for filtering, searching, and sorting.
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
isActive | boolean | No | — | Filter by active status |
search | string | No | — | Filter price lists by name |
page | number | No | 1 | Current page |
limit | number | No | 10 | Number of results per page |
sortBy | string | No | createdAt | Field to sort by |
sortOrder | asc / desc | No | desc | Sorting order |
Success Response
Possible Errors
401 Unauthorized: Missing or invalid authentication token403 Forbidden: No store access500 Internal Server Error: Server error
Example Request
Create Price List
POST/price-lists
Requires Authentication: Bearer token in Authorization headerRequires Header:
x-store-id
Create a new price list under a specific store. The new list is automatically associated with the store specified in the x-store-id header.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name of the price list |
description | string | No | Description (max 1000 chars) |
isBuying | boolean | No | Whether the list is for buying |
isSelling | boolean | No | Whether the list is for selling |
Request Body Example
Success Response
Possible Errors
400 Bad Request: Invalid input or validation errors401 Unauthorized: Missing or invalid authentication token403 Forbidden: No store access500 Internal Server Error: Server error
Example Request
Update Price List
PUT/price-lists/:id
Requires Authentication: Bearer token in Authorization headerRequires Header:
x-store-id
Update a specific price list by its ID.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Price list ID |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | New name |
description | string | No | Updated description |
isActive | boolean | No | Activate/deactivate |
isBuying | boolean | No | Mark as buying list |
isSelling | boolean | No | Mark as selling list |
Request Body Example
Success Response
Possible Errors
400 Bad Request: Invalid input or validation errors401 Unauthorized: Missing or invalid authentication token404 Not Found: Price list not found500 Internal Server Error: Server error
Example Request
Delete Multiple Price Lists
DELETE/price-lists
Requires Authentication: Bearer token in Authorization headerRequires Header:
x-store-id
Delete multiple price lists by their IDs.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
ids | string[] | Yes | Array of price list IDs to delete |
Request Body Example
Success Response
Possible Errors
400 Bad Request: No IDs provided401 Unauthorized: Missing or invalid authentication token404 Not Found: No valid price lists found500 Internal Server Error: Server error
Example Request
To manage item prices within price lists, see the Item Price API.
DTOs Overview
CreatePriceListDto
UpdatePriceListDto
DeletePriceListsDto
GetPriceListsDto
PriceListResponseDto
PaginatedPriceListsResponseDto
Business Logic
Price List Creation Flow
- User creates a price list with name and optional description
- Price list is automatically associated with the store from
x-store-idheader - Price list is created with
isActive: trueby default - Can be marked as buying list, selling list, or both
Access Control
- All endpoints require the
x-store-idheader - Users must have access to the store specified in the header
- Access is controlled through user-store relationships
Price List Updates
- Users can update any field of price lists in stores they have access to
isActivefield controls whether the price list is active- Supports buying/selling list types
Price List Deletion
- Multiple price lists can be deleted in a single request
- Returns count of successfully deleted price lists
- Only accessible to users with store access
Error Responses
Common Error Codes
400 Bad Request: Invalid request data or validation errors401 Unauthorized: Missing or invalid authentication token403 Forbidden: No access to the specified store404 Not Found: Price list not found500 Internal Server Error: Server error