imin Standalone Checkout
Introduction
The Standalone Checkout is available for customers who are not using the imin Events API and are instead processing open data directly.
Request
All bookable opportunities available in open data have an id .
The id from a ScheduledSession within the open data is to be supplied as the id contained within imin:initialOrder.orderedItem.orderedItem in the initial request, along with the information contained within the following JSON:
PUT /checkout-sessions HTTP/1.1Host: checkout.example.comDate: Mon, 8 Oct 2018 20:52:35 GMTAccept: application/json
POST /checkout-sessions{ "@context": ["https://openactive.io/", "https://imin.co/"], "type": "imin:CheckoutSession", "imin:initialOrder": { "type": "OrderQuote", "orderedItem": [ { "type": "OrderItem", "orderedItem": { "type": "ScheduledSession", "id": "https://opendata.fusion-lifestyle.com/OpenActive/api/scheduled-sessions/310003324" } } ] }}Response
If the bookable opportunity provided is available for you to book within the imin platform, the response JSON will include the URL for the Checkout:
HTTP/1.1 201 CreatedDate: Mon, 8 Oct 2018 20:52:36 GMTContent-Type: application/jsonLocation: /checkout-sessions/BQokikJOvBiI2H
{ "@context": ["https://openactive.io/", "https://imin.co/"], "type": "imin:CheckoutSession", "imin:initialOrder": { "type": "OrderQuote", "broker": { "type": "Organization", "name": "Example", "url": "https://www.example.com" }, "orderedItem": [ { "type": "OrderItem", "orderedItem": { "type": "ScheduledSession", "id": "https://opendata.fusion-lifestyle.com/OpenActive/api/scheduled-sessions/310003324" } } ] }, "potentialAction": [ { "type": "OrderAction", "name": "Checkout", "target": "https://checkout.example.com/opendata/BQokikJOvBiI2H", } ]}If the opportunity is not available for you to book within the imin platform, the following response will be returned:
HTTP/1.1 400 Bad RequestDate: Mon, 8 Oct 2018 20:52:36 GMTContent-Type: application/json
{ "@context": ["https://openactive.io/", "https://imin.co/"], "type": "UnavailableOpportunityError", "description": "This opportunity is not available to book."}