This version can be used if no realtime communication based on user interaction is possible, but the partner still wants to handle the registration of users (e.g. in order to communicate an ID to later identify the user).

If realtime communication is possible, then one of the other methods should be used: 1.1a Register and login user (Partner exposes Account API) or 1.1b Register and login user (Partner does not expose API).

Usage

Step 1: Partner creates user via o2o API

To register a user:

sequenceDiagram
	participant U1 as User browser
  participant P1 as Partner system
  participant O1 as o2o API server
	participant U2 as User email box

	U1-->>U1: 1. User reads info on Partner page
	U1->>P1: 2. User expresses "interested in bike lease"
	P1->>O1: 3. (Every 5 minutes) POST Create new biker account (list)
	O1-->>O1: Register Person
	O1->>P1: 3. Response
	opt If new registration
		O1->>U2: 4. "Welcome and set password" email
  end
	opt If existing registration
		O1->>U2: 4. "You already have account" email
  end
	opt If failed registration
		O1->>U2: 4. "Registration failed" email
  end

Step 2: New user completes account

To use the new account, the new user must set a password:

sequenceDiagram
	participant U1 as User email box
  participant U2 as User browser

	U1-->>U2: 1. User follows link in email to myo2o Biker
	U2->>U2: 2. User creates new password
	U2->>U2: 3. User is logged in

Authenticating for the new API

Authentication is performed through a permanently valid bearer token which will be provided by o2o and must be included in each call.

POST Create new biker account

Request

For each user to be created, Partner sends this message to o2o:

POST https://{{o2o_api_server}}/receiver/APIv3/user.create

{
	"user": {
		"BikePlanCode": "a valid BikeplanCode",
		"FirstName": "Jane",
		"LastName": "Johansson",
		"Email": "[email protected]",
		"Language": "FR",
		"ContractType": "",
    "partner_EmployeeID": "ABC123",
    "PersonnelNumber": "A1234"
	}
}

Info:

Response