Overview
The POS Kasir system tracks all transactions through the order lifecycle. Every completed (paid) order becomes a transaction record with detailed information about items, payments, and totals.Transaction Structure
Transactions in POS Kasir are represented by orders withpaid status. Each transaction includes:
- Order details (ID, type, timestamps)
- Customer information (if applicable)
- Line items with quantities and prices
- Payment method and payment details
- Discounts and promotions applied
- Gross total, discount amount, and net total
Viewing Transactions
Get Transaction History
Retrieve transaction history using the orders list endpoint with status filter. Endpoint:GET /orders?statuses=paid
Required Role: Admin, Manager, Cashier
Query Parameters:
page- Page number (default: 1)limit- Items per page (default: 10, max: 100)statuses- Filter by statuses (usepaidfor transactions)user_id- Filter by cashier/user ID
Get Transaction Details
Retrieve detailed information for a specific transaction. Endpoint:GET /orders/{id}
Required Role: Admin, Manager, Cashier
Response:
Transaction Components
Order Information
- id - Unique transaction identifier (UUID)
- user_id - Cashier who processed the transaction
- type - Order type (dine_in, takeaway)
- status - Always
paidfor completed transactions - queue_number - Order queue number for customer reference
- created_at - Transaction creation timestamp
- updated_at - Last update timestamp
Financial Details
- gross_total - Total before discounts (in cents/smallest currency unit)
- discount_amount - Total discount applied
- net_total - Final amount paid by customer
- applied_promotion_id - ID of promotion used (if any)
Payment Information
- payment_method_id - Payment method (1=Cash, 2=QRIS, 3=GoPay)
- cash_received - Amount received for cash payments
- change_due - Change returned to customer
- payment_gateway_reference - Midtrans transaction ID for digital payments
Line Items
Each transaction includes detailed line items:internal/orders/dto.go:64-72
- price_at_sale - Price snapshot at transaction time (historical price)
- subtotal - Line item total (quantity × price_at_sale + options)
- options - Product variants/add-ons with their prices at sale time
Receipt Generation
Receipt Data Structure
Use transaction details to generate receipts:Generating Receipt from API
-
Get Transaction Details
-
Format Receipt
- Parse transaction data
- Format currency values
- Generate receipt text/HTML/PDF
-
Print or Display
- Send to thermal printer
- Display on screen
- Email to customer
Transaction Queries
Filter by Date Range
While there’s no dedicated date range endpoint, you can filter transactions using pagination and timestamps:Filter by Cashier
Filter by Payment Method
The API doesn’t have a direct payment method filter. Retrieve transactions and filter client-side:Transaction Analytics
For detailed transaction analytics, use the Reports API:- Sales Reports - Aggregated sales data by date
- Product Performance - Best-selling products
- Payment Method Performance - Payment method usage
- Cashier Performance - Transactions per cashier
Price Snapshots
Historical Pricing
Transactions storeprice_at_sale for each item, preserving pricing at transaction time:
- Accurate historical reporting
- Price change tracking
- Audit trail for accounting
- Protection against retroactive price changes
Transaction List Response
internal/orders/dto.go:92-102
Common Use Cases
Daily Transaction Summary
End of Shift Report
Transaction Receipt Printer
Best Practices
- Price Consistency - Always use
price_at_salefrom transactions, not current product prices - Currency Handling - Store amounts in smallest unit (cents) to avoid float precision issues
- Receipt Storage - Consider storing formatted receipts for quick reprints
- Pagination - Use pagination for large transaction lists to improve performance
- Date Filtering - For date range queries, use Reports API instead of filtering all transactions
- Audit Trails - Transactions are immutable; use activity logs to track any modifications
- Receipt Printing - Implement retry logic for printer failures
- Transaction Export - Provide CSV/Excel export for accounting software integration
Related Features
- Orders & POS - Order creation and management
- Payments - Payment processing details
- Reports & Analytics - Transaction analytics and reporting
- Activity Logs - Audit trails for transaction modifications