Overview
Transactions in POS Kasir are managed through two main systems:
- Order Transactions - Handled via the Orders API (see Orders documentation)
- Cash Transactions - Cash-in and cash-out operations during shifts
This page documents the cash transaction endpoints for managing money flow during shifts.
Create Cash Transaction
Create a cash in/out transaction during an active shift.Authentication Required: YesRoles: admin, manager, cashier
Request Body
Transaction type: cash_in or cash_out
Transaction amount (minimum 1)
Transaction category (e.g., “expense”, “drop”, “refund”)
Transaction description/notes
Response
User who created the transaction
Example - Cash Out (Expense)
curl -X POST https://localhost:8080/api/v1/shifts/cash-transaction \
-H "Content-Type: application/json" \
-H "Cookie: access_token=YOUR_TOKEN" \
-d '{
"type": "cash_out",
"amount": 50000,
"category": "expense",
"description": "Office supplies purchase"
}'
{
"message": "Cash transaction created successfully",
"data": {
"id": "111e4567-e89b-12d3-a456-426614174100",
"shift_id": "222e4567-e89b-12d3-a456-426614174200",
"type": "cash_out",
"amount": 50000,
"category": "expense",
"description": "Office supplies purchase",
"user_id": "550e8400-e29b-41d4-a716-446655440000",
"created_at": "2024-03-03T14:30:00Z"
}
}
Example - Cash In (Drop)
curl -X POST https://localhost:8080/api/v1/shifts/cash-transaction \
-H "Content-Type: application/json" \
-H "Cookie: access_token=YOUR_TOKEN" \
-d '{
"type": "cash_in",
"amount": 200000,
"category": "drop",
"description": "Cash drop to safe"
}'
Start Shift
Start a new shift with opening cash balance.Authentication Required: YesRoles: admin, manager, cashier
Request Body
Starting cash amount (minimum 0)
User password for verification
Response
Example
curl -X POST https://localhost:8080/api/v1/shifts/start \
-H "Content-Type: application/json" \
-H "Cookie: access_token=YOUR_TOKEN" \
-d '{
"start_cash": 500000,
"password": "userpassword123"
}'
{
"message": "Shift started successfully",
"data": {
"id": "222e4567-e89b-12d3-a456-426614174200",
"user_id": "550e8400-e29b-41d4-a716-446655440000",
"start_cash": 500000,
"status": "open",
"start_time": "2024-03-03T08:00:00Z"
}
}
End Shift
End the current shift and record closing cash balance.Authentication Required: YesRoles: admin, manager, cashier
Request Body
User password for verification
Actual cash counted at shift end (minimum 0)
Response
Expected ending cash (calculated)
Actual ending cash (counted)
Difference (actual - expected)
Example
curl -X POST https://localhost:8080/api/v1/shifts/end \
-H "Content-Type: application/json" \
-H "Cookie: access_token=YOUR_TOKEN" \
-d '{
"password": "userpassword123",
"actual_cash_end": 1450000
}'
{
"message": "Shift ended successfully",
"data": {
"id": "222e4567-e89b-12d3-a456-426614174200",
"user_id": "550e8400-e29b-41d4-a716-446655440000",
"start_cash": 500000,
"expected_cash_end": 1475000,
"actual_cash_end": 1450000,
"difference": -25000,
"status": "closed",
"start_time": "2024-03-03T08:00:00Z",
"end_time": "2024-03-03T18:00:00Z"
}
}
Get Active Shift
Get information about the currently active shift for the authenticated user.Authentication Required: YesRoles: admin, manager, cashier
Response
Active shift information (null if no active shift)
Example
curl -X GET https://localhost:8080/api/v1/shifts/active \
-H "Cookie: access_token=YOUR_TOKEN"
{
"message": "Active shift retrieved successfully",
"data": {
"id": "222e4567-e89b-12d3-a456-426614174200",
"user_id": "550e8400-e29b-41d4-a716-446655440000",
"start_cash": 500000,
"status": "open",
"start_time": "2024-03-03T08:00:00Z"
}
}
Transaction Types
Cash Out Types
- expense - General business expenses (supplies, utilities, etc.)
- drop - Cash removed from register for safekeeping
- refund - Customer refund
- other - Other cash outflows
Cash In Types
- opening - Opening cash balance
- deposit - Cash added to register
- other - Other cash inflows
Order Payment Transactions
For order payment transactions, please refer to the Orders API documentation. Order payments are automatically tracked and included in shift calculations.
POST /api/v1/orders/{id}/pay/manual - Process cash/card payment
POST /api/v1/orders/{id}/pay/midtrans - Process QRIS/e-wallet payment
GET /api/v1/payment-methods - Get available payment methods