Skip to main content

Start Shift

curl -X POST "http://localhost:8080/api/v1/shifts/start" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "start_cash": 100000,
    "password": "your_password"
  }'
Create a new shift session for the authenticated user. Each user can only have one active shift at a time.

Request Body

start_cash
integer
required
Starting cash amount in the register (minimum 0)
password
string
required
User password for verification

Response

data
object

Roles

Accessible by: admin, manager, cashier

End Shift

curl -X POST "http://localhost:8080/api/v1/shifts/end" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "actual_cash_end": 250000,
    "password": "your_password"
  }'
Close the active shift session for the authenticated user.

Request Body

actual_cash_end
integer
required
Actual cash amount counted at end of shift (minimum 0)
password
string
required
User password for verification

Response

Returns a ShiftResponse object with the completed shift details including the calculated difference between expected and actual cash.

Roles

Accessible by: admin, manager, cashier

Get Current Shift

curl -X GET "http://localhost:8080/api/v1/shifts/current" \
  -H "Authorization: Bearer YOUR_TOKEN"
Check for and retrieve the details of an active shift session for the authenticated user.

Response

Returns a ShiftResponse object if an open shift exists, or 404 error if no open shift is found.

Roles

Accessible by: admin, manager, cashier

Create Cash Transaction

curl -X POST "http://localhost:8080/api/v1/shifts/cash-transaction" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 50000,
    "type": "cash_in",
    "category": "Cash Drop",
    "description": "Midday cash drop to safe"
  }'
Record a manual cash entry or exit within the active shift (e.g., cash drops, expenses, additional cash in).

Request Body

amount
integer
required
Transaction amount (minimum 1)
type
string
required
Transaction type:
  • cash_in - Cash added to register
  • cash_out - Cash removed from register
category
string
required
Transaction category (e.g., “Cash Drop”, “Expense”, “Change”)
description
string
Optional description of the transaction

Response

data
object

Response Example

{
  "message": "Cash transaction created successfully",
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "shift_id": "660e8400-e29b-41d4-a716-446655440001",
    "user_id": "770e8400-e29b-41d4-a716-446655440002",
    "amount": 50000,
    "type": "cash_out",
    "category": "Cash Drop",
    "description": "Midday cash drop to safe",
    "created_at": "2024-01-15T14:30:00Z"
  }
}

Roles

Accessible by: admin, manager, cashier
You must have an active shift open to create cash transactions. Cash transactions affect the expected cash balance at the end of the shift.

Build docs developers (and LLMs) love