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.
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 Customer Account Management APIs.
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 Authenticated Checkout, but instead of including the customer's info in the Authenticated Checkout Request Webhook, you use the Customer Identifier included in the Response Webhook 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 Create Customer Account endpoint to create a record for Louis at the imin side:
You will get a response like this:
So the imin identifier
for Louis is 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 Update Customer Account endpoint:
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:
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
.
6. When Louis goes into his account page on Acme Fitness, you can use any of the Order (by ID), Upcoming OrderItems
or Order History endpoints with his identifier
. For example:
Last updated