Declaring the sale of a publication for lending purposes is very similar to the procedure for selling products to the general public, described in Integrating ebook selling to a website. You can therefore refer to this documentation, taking into account the following few parameters, which differ in their use.
Name | Mandatory | Description |
---|
isbn | Yes | Identifier of the library offer received in the ONIX stream (not the ISBN/EAN of the consumer product). |
protection | No | Unlike the mainstream market Sales API, the protection setting is not required to sell a library product. The Adobe time-limited protection will be automatically applied to each loan. |
loan | No | This parameter is obsolete; it is no longer required for the sale of library products. |
output | Yes | Indicates in which format the loan link information will be returned. Possible values: xml, json. |
Format | Response |
---|
XML | <?xml version="1.0" encoding="UTF-8"?>
<sale> <loan-url>[loan_url]</loan-url>
<status>created</status>
</sale>
</xml>
|
json | {"loan_url":"[loan_url]","status":"created"} |
The link [loan_url]
takes the following form:
https://domaine/api/loans/UGV60GNogpXRcS3UtHAkZcHPOlDTIlnaJ3Z1uFYuf0DQfmgAEnzSUdY3rQY1vRxI/activate
The same HTTP return codes as for the mainstream market Sales API apply, plus the following:
Code | Content | Description |
---|
400 | cannot_loan | The publication is not available for loan. |