Creates a new checkout. If there already exists a checkout for given patron credentials, record id then the provider should respond with internal error: ALREADY_ON_LOAN. See: eHUB Provider API Error Handling
POST /v1/checkouts
{ "recordId": "<record id>" }
record id | The content provider record id. |
{ "id": "<checkout id>", "formatMetadata": { "<format id>": { "contentLinks": "<content links>", "supplementLinks": "<supplement links>", } } "expirationDate": "<expiration date>" }
checkout id | The checkout id. | ||||
format metadata | The format metadata is a JSON object with properties of format id. The value of each property is an object with value of properties "<content
links>" and "<supplement links>" where:
|
||||
expiration date | The checkout expiration date in ISO 8601 format. |
Example request:
POST /v1/checkouts
{ "recordId": "recordId_0" }
Example response:
{ "id": "checkoutId", "formatMetadata": { "ebook": { "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" } ] }, "audio-stream": { "contentLinks": [ { "href": "http:/localhost:16521/ep/api/v1/records/recordId_0/audio-stream/content_0" }, { "href": "http:/localhost:16521/ep/api/v1/records/recordId_0/audio-stream/content_1" } ], "supplementLinks": [ { "name": "supplement_0", "href": "http:/localhost:16521/ep/api/v1/records/recordId_0/audio-stream/supplement_0" }, { "name": "supplement_1", "href": "http:/localhost:16521/ep/api/v1/records/recordId_0/audio-stream/supplement_1" } ] }, "audio-downloadable": { "contentLinks": [ { "href": "http:/localhost:16521/ep/api/v1/records/recordId_0/audio-downloadable/content_0" }, { "href": "http:/localhost:16521/ep/api/v1/records/recordId_0/audio-downloadable/content_1" } ], "supplementLinks": [ { "name": "supplement_0", "href": "http:/localhost:16521/ep/api/v1/records/recordId_0/audio-downloadable/supplement_0" }, { "name": "supplement_1", "href": "http:/localhost:16521/ep/api/v1/records/recordId_0/audio-downloadable/supplement_1" } ] } }, "expirationDate": "2016-01-01T00:00:00Z" }