Before to use this method, an access_token is needed and also a call to the POST merchant/login.
Once the FlexitiSDK is instantiated you will be able to trigger the FlexitiSDK.init(params) method from any call to action element.
POST /client-id/{clientId}/widget/init
https://{posapi_url}/flexiti/pos-api/v2.5/client-id/{client_id}/widget/init
Using the /pos-api/v2.5/client-id/{clientId}/widget/init will render the redirection_url given by the previous init call.
API Request Parameters:
Type | Parameter | Required | Details |
---|---|---|---|
HEADER | bearer token | Yes |
|
PATH | client_id | Yes |
|
BODY | customer_identification.account_number | Yes if flow is “purchase” and vcc_number and personal_information is empty |
|
BODY | customer_identification.vcc_number | Yes if flow is “purchase” and account_number and personal_information is empty |
|
BODY | customer_identification.personal_information.first_name |
|
|
BODY | customer_identification.personal_information.last_name |
|
|
BODY | customer_identification.personal_information.dob |
|
|
BODY | customer_identification.personal_information.postal_code |
|
|
BODY | tos_agreement | Yes if flow is “apply” |
|
BODY | flow | Yes |
|
BODY | Yes if flow is “apply” |
| |
BODY | phone_number | Yes if flow is “apply” |
|
BODY | address_1 | Yes if flow is “apply” |
|
BODY | address_2 |
|
|
BODY | city | Yes if flow is “apply” |
|
BODY | province | Yes if flow is “apply” |
|
Example Requests:
Apply Flow
{ "customer_identification": { "personal_information": { "first_name": "John", "last_name": "Smith", "dob": "1988-07-24", "postal_code": "m1m1m1" } } "flow": "apply", "email": "john@email.com", "phone_number": 1231231234, "address_1": "Fake 445", "city": "Toronto", "province": "ON" }
Buy Flow
{ "customer_identification": { "account_number": 20009100, //conditional mandatory "vcc_number": "1070015210367982", //conditional mandatory "personal_information": { //conditional mandatory "first_name": "John", "last_name": "Smith", "dob": "1988-07-24", "postal_code": "m1m1m1" } }, "flow": "purchase" }
Conditional mandatory means you only need one in order to identify the customer.
Success Response:
{ "redirection_url": "string" }
Access Token Notes:
In order to control the data flow Flexiti takes the access_token as a referential value for the entire flow. Usually there are several steps before and after reaching the widget :
Once you need to call to the first POS-API method you must call the oAuth POST /token first to get access
You will use this token from start to finish. To do so, ensure you use a refreshed token in order to have the necessary time to complete the flow once you reach the widget page.
Please refer to the Authorization Method and Refresh Token documentation for refreshing tokens.