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
Starting cash amount in the register (minimum 0)
User password for verification
Response
User UUID who started the shift
Timestamp when shift was started
Timestamp when shift was ended (null if still open)
Expected cash at end of shift (calculated)
Actual cash counted at end of shift
Difference between actual and expected (actual - expected)
Shift status: open or closed
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 amount counted at end of shift (minimum 0)
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
Transaction amount (minimum 1)
Transaction type:
cash_in - Cash added to register
cash_out - Cash removed from register
Transaction category (e.g., “Cash Drop”, “Expense”, “Change”)
Optional description of the transaction
Response
Show CashTransactionResponse
User UUID who created the transaction
Transaction type: cash_in or cash_out
Optional transaction description
Timestamp when transaction was created
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.