https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42784
Bug ID: 42784
Summary: REST API: Add endpoint for patron-optional POS sales
to support external payment system integration
Initiative type: ---
Sponsorship ---
status:
Product: Koha
Version: Main
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P5 - low
Component: REST API
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]
CC: [email protected]
Koha's Point of Sale module already supports counter-sales without a patron
(via Koha::Charges::Sales, which creates accountlines rows with NULL
borrowernumber, journaled to a cash register). However, this functionality is
only accessible through the staff web interface รข there is no REST API
equivalent.
External self-service systems (kiosks, vending machines, third-party payment
terminals like Bibliotheca/Netloan) need a way to POST payment records directly
into Koha's POS cash register without those payments being tied to a specific
patron. Currently the only REST API endpoints for payments require a patron_id
in the path (/patrons/{patron_id}/account/credits), making anonymous/non-patron
transactions impossible via the API.
A new endpoint such as:
POST /cash_registers/{cash_register_id}/sales
...that accepts a debit_type, amount, description, and payment_type (and
creates both the debit and credit lines atomically, journaled to the specified
register) would allow:
- External kiosks to push their daily takings into Koha's POS automatically
- Library staff to use Koha POS as a central banking/cash-up system for all
income streams
- Elimination of manual keying of external system income at end of day
This is the missing REST API surface over the existing Koha::Charges::Sales
code path.
Use case example: A Bibliotheca kiosk with Netloan integration collects
payments for bookings and printing. There is a SIP2 connection to Koha for
patron authentication, but income not tied to a specific patron (or where the
patron context is irrelevant to the income recording) cannot currently be
pushed into Koha's cash register via API. Staff must run a z-report from the
kiosk and manually enter totals into POS each night.
Test plan:
1. Ensure you have at least one cash register configured in Koha
2. Send a POST request to /api/v1/cash_registers/{id}/sales with a valid
debit_type, amount, description, and payment_type
3. Confirm a debit and credit line are created in accountlines with NULL
borrowernumber and the correct register_id
4. Open the POS cashing-up view and confirm the transaction appears in the
register's daily total
--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/