The imin Platform
2.0.0
2.0.0
  • Introduction to the imin Platform
  • Using the Platform
    • imin's Platform Products
    • Authentication
    • Our Platform Data
      • Understanding Responses
      • Namespaces and Extensions
      • Defensive Data Consumption
      • Mocking the Interface
  • platform products
    • Search
      • imin Events API
        • Events API Reference
        • Virtual & Physical Sessions
        • Concepts
          • EventSeries
          • ScheduledSessions and eventSchedules
          • Activities and Collections
            • Activities
            • Activity Concept Collections
          • Accessibility Support
          • Prices
        • Filters
          • Modes
          • Age Ranges
          • Dates and Times
          • Activities and Concept Collections
          • High Frequency Sessions
      • imin Facilities API
        • Query Parameter Search
          • Mandatory Query Parameters
            • mode=discovery-geo
            • mode=upcoming-slots
          • Optional Query Parameters
        • ByID Search
          • FacilityUse By-ID
          • Slot By-ID
        • FacilityUses and IndividualFacilityUses
        • Slots
        • Facilities Slot Booking
      • imin Places API [BETA]
        • Example Request & Response
    • Firehose
      • Introduction to the Firehose
      • Accessing the Firehose
      • Firehose Usage Policy & Restrictions
      • Firehose and Search
      • Bookable Firehose Feeds
      • Bookable Sellers Feed
      • Attribution Catalog Endpoint
    • Live Timetables
      • Pre-Requisites: Open Data Feeds
      • The Onboarding Process
        • 1. Ensuring your Data Offers the Best User Experience
        • 2. Setting up and Embedding your First Timetable
        • 3. Setting up the Rest of your Timetables
        • 4. Activating Booking via Guest Checkout
      • Features Available Upon Request
      • Styling the Live Timetables
      • FAQs
    • Data Dashboard
  • incorporating book and pay
    • imin Branded Checkout
      • Introduction
      • Setup
        • Information We Require From You
        • Actions You Need to Complete
      • Authenticated Checkout
        • Testing [BETA]
        • 👪Group Booking [BETA]
      • Standalone Checkout
      • Firehose and Checkout [BETA]
        • Loading the Checkout via Firehose
    • imin Booking Platform
      • Customer Account Management
        • Create Customer Account
        • Update Customer Account
        • Get Customer Account
        • Delete Customer Account
        • Example Scenario
        • Payment Card Management
        • Linked Accounts
        • Entitlement
          • Evidence Requests
          • Entitlement Pricing in Search
          • Entitlement Pricing in Checkout
        • Access Pass
        • Webhooks
      • Orders
        • Order History
        • Order (by ID)
        • Cancellations & Refunds
      • Upcoming OrderItems
      • Receipt (by ID)
  • imin and booking systems
    • Seller Onboarding
      • API
  • HINTS & TIPS
    • Get the Best Out of Search
      • Displaying Schedule Information
      • URLs and Offering a Call to Action
      • Searching by Activity
      • Your Search Results and HighFrequencySessions
      • Customer Specific Images
  • Info for Data Publishers
    • Your RPDE Feed & the imin Platform [BETA]
      • Providing Places Data [BETA]
      • Providing Schedule Information [BETA]
Powered by GitBook
On this page
  1. incorporating book and pay
  2. imin Booking Platform
  3. Customer Account Management

Example Scenario

Let's work through a scenario in which a user takes certain actions on the client side and look at how you can ensure these are reflected on the imin side.

PreviousDelete Customer AccountNextPayment Card Management

Last updated 3 years ago

First things first, you need to make sure the user exists in the system. For this, an account for a customer will need to be created on the client side. In turn, a call will be made to the imin Customer Account Management APIs to create that customer on our side. If at any point that customer updates or deletes their account, this will need to be reflected on our side using the suite of .

X-API-KEY must be provided when making the request to update a customer. This authorises you to access the API.

This will allow you to use the , but instead of including the customer's info in the Authenticated Checkout , you use the Customer Identifier included in the that you get back from the Create Customer Account endpoint. Let's take a look at an example:

1. Louis creates a new account using Acme Fitness' user facing platform. At the backend, you call the to create a record for Louis at the imin side:

POST https://book.imin.co/api/v2/customer-accounts
{
  "email": "louis@imin.co",
  "givenName": "Louis",
  "familyName": "Wu",
  "imin:is13OrOver": false
}

You will get a response like this:

{
  "type": "Person",
  "email": "louis@imin.co",
  "givenName": "Louis",
  "familyName": "Wu",
  "imin:is13OrOver": false,
  "identifier": "MAlnTNiZut",
  "id": "https://book.imin.co/api/v2/customer-accounts/MAlnTNiZut"
}

So the imin identifier for Louis is MAlnTNiZut.

PATCH https://book.imin.co/api/v2/customer-accounts/MAlnTNiZut
{
   "email": "louis_new_email@imin.co"
}

3. Louis does a search on the Acme Fitness activity finder and finds a session he wants to book. He hits "Book Now" (or whatever the button is called). Because Louis is already logged into his account on Acme Fitness, you know that Louis is imin identifier = MAlnTNiZut.

4. You use Louis' identifier in all Authenticated Checkout requests:

POST https://checkout.yourapp.com/api/checkout-sessions
{
	"@context": [
		"https://openactive.io/",
		"https://imin.co/"
	],
	"type": "imin:CheckoutSession",
	"imin:initialOrder": {
		"type": "OrderQuote",
		"customer": "https://book.imin.co/api/v2/customer-accounts/MAlnTNiZut",
		"broker": {
			"type": "Organization",
			"name": "Acme Fitness",
			"url": "acmefitness.co.uk"
		},
		"orderedItem": [
			{
				"type": "OrderItem",
				"acceptedOffer": "http://opendata.provider.com/api/feeds/offers/adult",
				"orderedItem": {
					"type": "ScheduledSession",
					"identifier": "http://opendata.provider.com/api/feeds/scheduled-sessions/00000000000000001741"
				}
			}
		]
	},
	"imin:navigationLinks": [
		{
			"type": "WebPage",
			"name": "Back to Broker",
			"imin:linkType": "https://imin.co/BackToBrokerLink",
			"url": "https://www.imin.co/bookingsuccess"
		},
		{
			"type": "WebPage",
			"name": "Back to Broker User Profile",
			"imin:linkType": "https://imin.co/BackToBrokerUserProfileLink",
			"url": "https://www.imin.co/useraccounts/12345"
		}
	]
}

Where the orderedItem.acceptedOffer is the price level Louis chooses on the Acme Fitness activity finder before seeing the imin Branded Checkout, and orderedItem.identifier is from the specific subEvent of the session he wants to book.

5. You will get a response with a potentialAction.target URL that you load for Louis. He completes the Checkout steps, pays for his session, and gets a confirmation screen followed by a confirmation email to louis_new_email@imin.co.

GET https://book.imin.co/api/v2/order-items?customerIdentifier=MAlnTNiZut

2. If Louis were to update his account information (e.g. his email address) on Acme Fitness, you need to update that customer on our side, too, using the :

6. When Louis goes into his account page on Acme Fitness, you can use any of the , or endpoints with his identifier. For example:

Update Customer Account endpoint
Order (by ID)
Upcoming OrderItems
Order History
Customer Account Management APIs
Authenticated Checkout
Create Customer Account endpoint
Response Webhook
Request Webhook