Creates a new checkout. If there already exists a checkout for given patron credentials, record id and format id then the provider should respond with internal error: ALREADY_ON_LOAN. See: eHUB Provider API Error Handling
POST /v1/checkouts
{ "recordId": "<record id>", "formatId": <format id>" }
record id | The content provider record id. |
format id | The content provider record format id. |
{ "id": "<checkout id>", "contentLinks": "<content links>", "supplementLinks": "<supplement links>", "expirationDate": "<expiration date>" }
checkout id | The checkout id. |
content links | The media content links array. Every element in the array is an object with singleton property <href>. The property specifies the media url. |
supplement links | The media supplement links array. Every element in the array is an object with properties <name> and <href>. The <name> property specifies the supplement link name and <href> specifies the supplement material url. |
expiration date | The checkout expiration date in ISO 8601 format. |
Example request:
POST /v1/checkouts
{ "recordId": "recordId_0", "formatId": "ebook" }
Example response:
{ "id": "checkoutId", "contentLinks": [ {"href": "http:/localhost:16521/ep/api/v1/records/recordId_0/ebook/content_0"}, {"href": "http:/localhost:16521/ep/api/v1/records/recordId_0/ebook/content_1"} ], "supplementLinks": [ {"name": "supplement_0", "href": "http:/localhost:16521/ep/api/v1/records/recordId_0/ebook/supplement_0"}, {"name": "supplement_1", "href": "http:/localhost:16521/ep/api/v1/records/recordId_0/ebook/supplement_1"} ], "expirationDate": "2016-01-01T00:00:00Z" }