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
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
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
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
Request Body
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
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