Bug 39359 - Lack of REST API Support for Linking Items to Orders
Summary: Lack of REST API Support for Linking Items to Orders
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-17 13:04 UTC by Oswald Kaipainen
Modified: 2025-03-17 13:04 UTC (History)
1 user (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oswald Kaipainen 2025-03-17 13:04:48 UTC
Currently, the Koha REST API does not provide a way to link items to orders. This functionality would be useful for managing acquisitions and ensuring that items are correctly associated with their corresponding orders.

Proposed Changes:
1) Allow specifying order_id when creating or updating items: 
    POST /biblios/{biblio_id}/items: Support an optional order_id field to link the item to an order during creation.
    PUT /biblios/{biblio_id}/items/{item_id}: Allow updating an existing item to set or change its order_id.
2) Enable batch linking of items to orders:
    POST /acquisitions/orders/ and PUT /orders/{order_id} should accept an array of item IDs in the request body:
    {"items": [12345, 12346]}
This would allow multiple items to be linked to an order in a single request.
3) Validation Requirement:
    Ensure that an item is not already linked to another order