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.

To enable authenticated Checkout, you must register your webhook with imin. This can be done by contacting your imin liaison.

Please only refer to this page if you are processing open data directly (as opposed to using imin's Events API).

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.1
Host: checkout.example.com
Date: Mon, 8 Oct 2018 20:52:35 GMT
Accept: 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

The response will reflect back the request, but will additionally contain a potentialAction with a target URL. The data consumer uses .potentialAction[0].targetas the URL of the "book" button for this opportunity.

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 Created
Date: Mon, 8 Oct 2018 20:52:36 GMT
Content-Type: application/json
Location: /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 Request
Date: Mon, 8 Oct 2018 20:52:36 GMT
Content-Type: application/json

{
  "@context": ["https://openactive.io/", "https://imin.co/"],
  "type": "UnavailableOpportunityError",
  "description": "This opportunity is not available to book."
}

Last updated