Bug 39905

Summary: Post request to /checkouts results in 500 error
Product: Koha Reporter: Myranda Fuentes <myranda.fuentes>
Component: REST APIAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: tomascohen
Version: 24.11   
Hardware: PC   
OS: Linux   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Myranda Fuentes 2025-05-14 20:26:43 UTC
Making a POST request to /api/v1/checkouts with a body of (for example)
{
"patron_id": 123,
"item_id": 456,
}
Using OAuth and a Bearer token to authenticate is returning a 500 error. This is attempting the request from Aspen Discovery 25.05, for which I've cross created the following issue number, since I can't tell where the problem originates for sure: https://aspen-discovery.atlassian.net/browse/DIS-816.

I didn't see anything come up in api-error.log but plack-api-error.log shows the following: POST /api/v1/checkouts: unhandled exception (Mojo::Exception)<<Can't use an undefined value as a HASH reference at /usr/share/koha/lib/Koha/REST/V1/Checkouts.pm line 143.>>

First time poster here, so please let me know if I can provide any additional details or how to better submit a bug are also appreciated.