Skip to main content

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-id header 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 header
Requires 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 token
  • 403 Forbidden: No store access
  • 500 Internal Server Error: Server error

Example Request


Create Price List

POST /price-lists Requires Authentication: Bearer token in Authorization header
Requires 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 errors
  • 401 Unauthorized: Missing or invalid authentication token
  • 403 Forbidden: No store access
  • 500 Internal Server Error: Server error

Example Request


Update Price List

PUT /price-lists/:id Requires Authentication: Bearer token in Authorization header
Requires 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 errors
  • 401 Unauthorized: Missing or invalid authentication token
  • 404 Not Found: Price list not found
  • 500 Internal Server Error: Server error

Example Request


Delete Multiple Price Lists

DELETE /price-lists Requires Authentication: Bearer token in Authorization header
Requires 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 provided
  • 401 Unauthorized: Missing or invalid authentication token
  • 404 Not Found: No valid price lists found
  • 500 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

  1. User creates a price list with name and optional description
  2. Price list is automatically associated with the store from x-store-id header
  3. Price list is created with isActive: true by default
  4. Can be marked as buying list, selling list, or both

Access Control

  • All endpoints require the x-store-id header
  • 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
  • isActive field 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 errors
  • 401 Unauthorized: Missing or invalid authentication token
  • 403 Forbidden: No access to the specified store
  • 404 Not Found: Price list not found
  • 500 Internal Server Error: Server error

Error Response Format