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).
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
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
Authentication is performed through a permanently valid bearer token which will be provided by o2o and must be included in each call.
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:
{{o2o_api_server}}:
acc-api.o2o.beapi.o2o.beuser object in the payload contains the data for the user that needs to be created:
BikePlanCode: the bike plan registration code for the bike plan to which the user will have access. This code is provided by o2o during the onboarding of our mutual client. In principle o2o supports different bike plans per client if some settings on o2o’s side need to be different for certain sets of users.FirstName, LastName, Email: self-explanatory data for the new userLanguage: currently supported values are
NL: DutchFR: FrenchEN: EnglishContractType: currently supported values are
clerkworkerpartner_EmployeeID: an ID used by Partner to identify the user. This field is not mandatory, but might facilitate later communication between o2o and Partner.PersonnelNumber: an internal number identifying the user within their company. This field is not mandatory. If provided, this will be included on the invoice lines we send to the client.