Skip to main content

POS Profile API

The POS Profile API provides endpoints for managing POS (Point of Sale) profiles within a store. Profiles represent user accounts or cashier identities associated with a specific store.
All POS Profile API endpoints require authentication and automatically use the authenticated store ID.

Overview

Each profile:
  • Belongs to one store
  • Has a unique name within that store
  • Stores a hashed password
  • Can be created, updated, listed, or deleted via these endpoints

Endpoint Details

Base URL: /pos-shift
Content-Type: application/json

Required Headers

All routes require a valid storeId which is automatically injected via the @StoreId() decorator. Passwords are never returned in API responses.

Entity: POS Profile


Create POS Profile

POST /pos-shift/create-shift Creates a new POS profile under the authenticated store. The password is securely hashed before saving. Requires Authentication: Bearer token in Authorization header

Request Body

Success Response

Status Code: 201 Created

Possible Errors

Example Request


Get All POS Profiles

GET /pos-shift/profiles Retrieves all POS profiles for the current store, excluding passwords. Requires Authentication: Bearer token in Authorization header

Success Response

Status Code: 200 OK

Response Fields

Profile Object

Response Object

Possible Errors

Example Request


Update POS Profile

PATCH /pos-shift/profile/:profileId Updates a profile’s name and/or password for a given store. Requires Authentication: Bearer token in Authorization header

Path Parameters

Request Body

Note: At least one field (name or password) must be provided.

Success Response

Status Code: 200 OK

Possible Errors

Example Request


Delete POS Profile

DELETE /pos-shift/profile/:profileId Deletes a POS profile permanently. If related records exist, they are deleted via database cascade. Requires Authentication: Bearer token in Authorization header

Path Parameters

Success Response

Status Code: 200 OK

Possible Errors

Example Request


Security & Validation

  • All routes require a valid storeId (automatically injected via @StoreId() decorator)
  • Passwords are hashed using bcrypt with SALT_ROUNDS = 10
  • Input validation prevents empty fields or weak passwords
  • Duplicate profile names within the same store are disallowed
  • No password is ever returned in API responses

Data Transfer Objects (DTOs)

posProfileDto


Business Logic

Profile Creation

  • Profile name must be unique within the store
  • Password is automatically hashed before storage
  • Store ID is automatically associated from the authenticated context

Profile Updates

  • Either name or password (or both) can be updated
  • Name uniqueness is validated within the store scope
  • Password updates trigger re-hashing with bcrypt

Profile Deletion

  • Deletion is permanent (not soft delete)
  • Related records (if any) are deleted via database cascade
  • Profile ID and Store ID validation prevents unauthorized deletions

Password Security

  • All password operations (create/update/verify) are performed in the service layer
  • Passwords are hashed using bcrypt with 10 salt rounds
  • Raw passwords are never stored or returned in responses
  • Minimum password length is 6 characters

Notes for Developers

  • All password operations (create/update/verify) are performed in the service layer
  • No password is ever returned in API responses
  • Profiles can later be linked to shift or POS session logic
  • The verifyProfilePassword() method exists in the service but is not yet exposed as an endpoint

Error Responses

Common Error Codes

Error Response Format