Bug 13927

Summary: Add API route to check hold capabilities
Product: Koha Reporter: Julian Maurice <julian.maurice>
Component: Web servicesAssignee: Julian Maurice <julian.maurice>
Status: RESOLVED DUPLICATE QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: chris, lari.taskula, mail, ztajoli
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 13903    
Bug Blocks: 16652    
Attachments: Bug 13927: Add API route to check hold capabilities

Description Julian Maurice 2015-03-30 12:40:54 UTC
Often when a 3rd-party application want to deal with reserves in Koha, it must know in advance if the reserve is allowed (for example to hide the "place hold" link if hold is not allowed)

This new route does just that, telling if a given hold is allowed for a given patron.

Moreover, it also returns a list of available pickup locations (restricting to only the borrower's branch if IndependentBranches is set).

Depends on bug 13903.
Comment 1 Julian Maurice 2015-03-30 12:41:31 UTC
Created attachment 37365 [details] [review]
Bug 13927: Add API route to check hold capabilities

OPTIONS /borrowers/{borrowernumber}/reserves

Request body should contain biblionumber or itemnumber, and response
tells us if reserve is allowed, and which pickup locations are available
Comment 2 Jiri Kozlovsky 2016-07-31 10:05:01 UTC
Well, the bug 13903 changed in the meanwhile. How about changing the route to:

GET /holds?borrowernumber=X&biblionumber=X
GET /holds?borrowernumber=X&itemnumber=X
Comment 3 Jiri Kozlovsky 2016-07-31 10:17:25 UTC
Or even better to do it same way as is bug 16826:

GET /availability/items?borrowernumber=&itemnumber=123
GET /availability/items?borrowernumber=&biblionumber=123

Could be quite good if the output was the same as in mentioned bug
Comment 4 Julian Maurice 2020-05-22 09:35:10 UTC
Marked as duplicate of bug 16826

*** This bug has been marked as a duplicate of bug 16826 ***