Ready to Learn?Ex Libris products all provide open APIs

renew

General Purpose

This service renews the loan of a given item for a given patron.

The X-Service renews the loan only if it can be done. If, for example, there is a delinquency on the patron, the service does not renew the loan.

 

Interface Type

X-Service

 

Product Version Compatibility

Version 18 and later

 

Input Parameters

1. LIBRARY - X (5).
2. REC_KEY.
3. DOC_NUMBER - 9 (9).
4. ITEM_SEQUENCE . 9 (6).
5. ITEM_BARCODE . X (20).
6. BOR_ID . X (12).

NOTE:
For REC-KEY, only one of the DOC_NUMBER or ITEM_SEQUENCE parameters is required.
 

  • Library: The library of the loaned Item.
  • Rec_Key: Document Number + Item Sequence (Key of Z30).
  • Item_Barcode: ID of the item (Z30).
  • Bor_Id / Identification/ Id: Borrower ID (Patron) for renewing.---Optional

 

Output XML Format

The XML output includes the new due date and due hour if renew goes well. If the loan is overdue, the XML includes an indication that the loan is overdue and that a fine has been incurred as a result.

Example:
To renew a loan for patron 1975 for document number 444, item sequence 10, and item barcode 32044024520025, enter the following URL:

http://ram19:8995/X?op=renew&doc_number=000000444&item_sequence=000010&bor_id=1975&library=usm50


The following URL produces the same results since the barcode is a unique identifier just like the combination of document number and item sequence:

http://ram19:8995/X?op=renew&item_barcode=32044024520025&bor_id=1975&library=usm50


If successful, the XML output is:

<?xml
version="1.0" encoding="UTF-8" ?>
- <renew>
<reply>ok</reply>
<due-date>20040615</due-date>
<due-hour>2400</due-hour>
<session-
id>DFDXTD74JRF9KQL9XV33D8BB1UKP9U31L64FHRGYDH5LIQ5H23</session-id>
</renew>

 

Possible Error Codes

1. If the X-Service is activated without a document number + item sequence or item barcode having been given, the following error message appears in the XML output:

< error>Both Doc number and item sequence should be filled OR item barcode
only.</error>

2. If the number of renewal limit has been reached, the following error message appears in the XML output:

< error-text-1>Renewal limit reached - No. of renews: 07 Limit: 05.</error-text-1>

3. If the renew request is for a loan declared lost, the following error message appears in the XML output:

< error-text-2>Loan has been declared lost.</error-text-2>

4. If a library has not been given:

< error>Library must be included in service params.</error>

5. If the document number has not been given, and the barcode has been provided (for example, 39999024520025), but it does not exist in Z30:

< error>Item barcode: 39999024520025 can not be found in library USM50</error>

6. If the given document number and item sequence (or barcode) given by user are not in the loan 1record:

< error>Doc Num: 000000444 Item sequence: 000010 is not Loaned in library
USM50</error>

7. If the Local record (Z305) cannot be found for the patron:

< error>Patron ID: 1975 Sub Library: WID has no Local Information.</error>

8. If the item cannot be found in the library (Z30):

< error>Doc Num: 000000444 Item sequence: USM50 can not be found in library</error>

9. If the new given due date (after renewal) is earlier than the current loan's due date:

< error>New due date must be bigger than current loan's due date</error>

10. If the provided patron ID does not match the borrower's ID of the given item:

< error>Item provided is not loaned by given bor_id: 000000036</error>