POST /oauth/token
https://onlineapi.flexiti.fi/flexiti/online-api/oauth/token
This service Authenticates the developer user and provides a Bearer Token that needs to be used as part of every future request.
The auth token is active for 20 minutes and the refresh token is used to get a new access token when the current one is about to expire. It cannot be refreshed after it is expired. You can follow the guide here on how to implement the refresh token: https://flexiti.atlassian.net/l/c/UxFd6Vg5
To use it add the refresh token (provided in the original /oauth/token call) and change the grant_type to refresh_token.
NOTE: The API request must be passed in the x-www-form-urlencoded format, or you will receive an error.
Request Parameters:
Type | Parameter | Required | Details |
FORMDATA/BODY | client_id | Yes |
|
FORMDATA/BODY | client_secret | Yes |
|
HEADER | x-reference-id | Yes |
|
FORMDATA/BODY | grant_type | No |
|
FORMDATA/BODY | refresh_token | Yes - If grant_type = “refresh_token” |
|
FORMDATA/BODY | scope | No |
|
Example Request:
Response Parameters:
Type | Parameter | Details |
---|---|---|
BODY | access_token |
|
BODY | expires_in |
|
BODY | refresh_token |
|
Success Response:
{ "token_type": "bearer", "access_token": "2d8f373a3c2b1e61baf5a7769930ff4f0e08cdb0", "expires_in": 1200, "refresh_token": "36e0fc3d7415145f4b1d71512c459fd6eaa13aa8", "scope": "merchant" }
POST /online/v2/client-id/{clientId}/systems/init
https://onlineapi.flexiti.fi/flexiti/online-api/online/client-id/{{client_id}}/systems/init
This endpoint will return the Flexiti Online Flow as a Redirect URL, which can be hosted in a Modal (Preferred presentation method).
Request Parameters:
Type | Parameter | Required | Details |
HEADER | authorization | Yes |
|
HEADER | x-reference-id | Yes |
|
PATH | client_id | Yes |
|
BODY | merchant_orderid | Optional |
|
BODY | is_guest | Optional |
|
BODY | customer_id | Optional - Required for Buy Flow if VCC is not provided |
|
BODY | vcc | Optional - Required for Buy Flow if customer_id is not provided |
|
BODY | has_previous_purchase | Optional |
|
BODY | lang | Yes |
|
BODY | flow | Yes |
|
BODY | amount_requested | Yes |
|
BODY | salutation | Optional - Helps pre-populate application form during “Apply” and “Apply/Buy” flow if information is available |
|
BODY | Optional - Helps pre-populate application form during “Apply” and “Apply/Buy” flow if information is available |
| |
BODY | phone_number | Optional - Helps pre-populate application form during “Apply” and “Apply/Buy” flow if information is available |
|
BODY | fname | Optional - Helps pre-populate application form during “Apply” and “Apply/Buy” flow if information is available |
|
BODY | mname | Optional - Helps pre-populate application form during “Apply” and “Apply/Buy” flow if information is available |
|
BODY | lname | Optional - Helps pre-populate application form during “Apply” and “Apply/Buy” flow if information is available |
|
BODY | dob | Optional - Helps pre-populate application form during “Apply” and “Apply/Buy” flow if information is available |
|
BODY | address_1 | Optional - Helps pre-populate application form during “Apply” and “Apply/Buy” flow if information is available |
|
BODY | address_2 | Optional - Helps pre-populate application form during “Apply” and “Apply/Buy” flow if information is available |
|
BODY | city | Optional - Helps pre-populate application form during “Apply” and “Apply/Buy” flow if information is available |
|
BODY | province | Optional - Helps pre-populate application form during “Apply” and “Apply/Buy” flow if information is available |
|
BODY | postal_code | Optional - Helps pre-populate application form during “Apply” and “Apply/Buy” flow if information is available |
|
BODY | billing_information.first_name | Yes if Flow is “Buy” or “Apply/Buy” |
|
BODY | billing_information.last_name | Yes if Flow is “Buy” or “Apply/Buy” |
|
BODY | billing_information.address_1 | Yes if Flow is “Buy” or “Apply/Buy” |
|
BODY | billing_information.address_2 | Yes if Flow is “Buy” or “Apply/Buy” |
|
BODY | billing_information.city | Yes if Flow is “Buy” or “Apply/Buy” |
|
BODY | billing_information.province | Yes if Flow is “Buy” or “Apply/Buy” |
|
BODY | billing_information.postal_code | Yes if Flow is “Buy” or “Apply/Buy” |
|
BODY | shipping_information.first_name | Yes if Flow is “Buy” or “Apply/Buy” |
|
BODY | shipping_information.last_name | Yes if Flow is “Buy” or “Apply/Buy” |
|
BODY | shipping_information.address_1 | Yes if Flow is “Buy” or “Apply/Buy” |
|
BODY | shipping_information.address_2 | Yes if Flow is “Buy” or “Apply/Buy” |
|
BODY | shipping_information.city | Yes if Flow is “Buy” or “Apply/Buy” |
|
BODY | shipping_information.province | Yes if Flow is “Buy” or “Apply/Buy” |
|
BODY | shipping_information.postal_code | Yes if Flow is “Buy” or “Apply/Buy” |
|
Example Request - Flow = “apply”:
{ "lang":"en-CA", "flow":"apply", "salutation":"mr", "amount_requested":3000.00, "email":"test@flexiti.com", "phone_number":"6476161234", "fname":"Tommy", "mname":"", "lname":"Samson", "dob":"06/01/1981", "address_1":"123 Any Street", "address_2":"", "city":"Toronto", "province":"ON", "postal_code":"M2A2A2" }
Example Request - Flow = “buy”:
{ "lang":"en-CA", "flow":"buy", "amount_requested":1.00, "vcc":"2374980012897093", "shipping_information":{ "first_name":"Tom", "last_name":"Samson", "address_1":"123 Any Street", "address_2":"", "city":"Toronto", "postal_code":"M2A2A2", "province":"ON" }, "billing_information":{ "first_name":"Tom", "last_name":"Samson", "address_1":"123 Any Street", "address_2":"", "city":"Toronto", "postal_code":"M2A2A2", "province":"ON" } }
Example Request - Flow = “apply/buy”:
{ "lang":"en-CA", "flow":"apply/buy", "amount_requested":2.00, "salutation":"mr", "email":"test@flexiti.com", "phone_number":"6476161234", "fname":"Tommy", "mname":"", "lname":"Samson", "dob":"06/01/1981", "address_1":"123 Any Street", "address_2":"", "city":"Toronto", "province":"ON", "postal_code":"M2A2A2", "shipping_information":{ "first_name":"Tom", "last_name":"Samson", "address_1":"123 Any Street", "address_2":"", "city":"Toronto", "postal_code":"M2A2A2", "province":"ON" }, "billing_information":{ "first_name":"Tom", "last_name":"Samson", "address_1":"123 Any Street", "address_2":"", "city":"Toronto", "postal_code":"M2A2A2", "province":"ON" } }
Response Parameters:
Type | Parameter | Details |
BODY | online_order_id |
|
BODY | redirection_url |
|
Success Response:
{ "online_order_id": 131209, "redirection_url": "..." }
GET /online/v2/client-id/{clientId}/systems/payment-calculator
https://onlineapi.flexiti.fi/flexiti/online-api/online/v2/client-id/{{client_id}}/systems/payment-calculator?clientId=flexitidemo&price=499&lang=fr
Request Parameters:
Type | Parameter | Required | Details |
HEADER | authorization | Yes |
|
HEADER | x-reference-id | Yes |
|
PATH | client_id | Yes |
|
QUERY | price | Yes |
|
QUERY | lang | Yes |
|
Sample Request:
Response Parameters:
Type | Parameter | Details |
BODY | htmlRender |
|
BODY | paymentPlan.monthlyPayment |
|
BODY | paymentPlan.months |
|
Success Response:
{ "htmlRender": "...", "paymentPlan": { "monthlyPayment": "166.33", "months": "3" } }
GET /online/client-id/{clientId}/notifications/order-id/{orderId}
https://onlineapi.flexiti.fi/flexiti/online-api/online/client-id/{{client_id}}/notifications/order-id/:orderId
Request Parameters:
Type | Parameter | Required | Details |
HEADER | authorization | Yes |
|
HEADER | x-reference-id | Yes |
|
PATH | client_id | Yes |
|
PATH | orderId | Yes |
|
Example Request:
Response Parameters:
Type | Parameter | Details |
BODY | transaction_id |
|
BODY | flow |
|
BODY | callback_url |
|
BODY | date |
|
BODY | purchase.status |
|
BODY | purchase.administrative_fee |
|
BODY | purchase.promo_id |
|
BODY | purchase.term |
|
BODY | purchase.plan_id |
|
BODY | purchase.purchase_amount |
|
BODY | purchase.transaction_total_amount |
|
BODY | purchase.customer_id |
|
BODY | purchase.customer_comparison_result.shipping_information.province |
|
BODY | purchase.customer_comparison_result.shipping_information.postal_code |
|
BODY | purchase.customer_comparison_result.shipping_information.city |
|
BODY | purchase.customer_comparison_result.shipping_information.address_2 |
|
BODY | purchase.customer_comparison_result.shipping_information.address_1 |
|
BODY | purchase.customer_comparison_result.shipping_information.dob |
|
BODY | purchase.customer_comparison_result.shipping_information.last_name |
|
BODY | purchase.customer_comparison_result.shipping_information.first_name |
|
BODY | purchase.customer_comparison_result.billing_information.province |
|
BODY | purchase.customer_comparison_result.billing_information.postal_code |
|
BODY | purchase.customer_comparison_result.billing_information.city |
|
BODY | purchase.customer_comparison_result.billing_information.address_2 |
|
BODY | purchase.customer_comparison_result.billing_information.address_1 |
|
BODY | purchase.customer_comparison_result.billing_information.dob |
|
BODY | purchase.customer_comparison_result.billing_information.last_name |
|
BODY | purchase.customer_comparison_result.billing_information.first_name |
|
BODY | apply.customer_id |
|
BODY | apply_status |
|
Example Response: Buy Flow
{ "transaction_id": 131221, "flow": "buy", "callback_url": "", "purchase": { "purchase_status": "SUCCESS", "customer_comparison_result": { "shipping_information": { "province": 1, "postal_code": 0.4, "city": 1, "address_2": null, "address_1": 1, "dob": null, "last_name": 0.3333333333333333, "first_name": 0 }, "billing_information": { "province": 1, "postal_code": 0.4, "city": 1, "address_2": null, "address_1": 1, "dob": null, "last_name": 0.3333333333333333, "first_name": 0 } }, "administrative_fee": "0.00", "promo_id": "382712", "term": 3, "plan_id": "4", "purchase_amount": 2, "transaction_total_amount": 2, "customer_id": "1293835", }, "date": "2022-06-13T22:20:01.552Z"" }
Example Response: Apply Flow
{ "transaction_id": 131222, "flow": "apply", "callback_url": "", "apply": { "customer_id": 1293836, "apply_status": "SUCCESS", }, "date": "2022-06-13T22:29:20.276Z"" }
GET /online/client-id/{clientId}/notifications/merchant-order-id/{merchantOrderId}
https://onlineapi.flexiti.fi/flexiti/online-api/online/client-id/{{client_id}}/notifications/merchant-order-id/:merchantOrderId
Request Parameters:
Type | Parameter | Required | Details |
HEADER | authorization | Yes |
|
HEADER | x-reference-id | Yes |
|
PATH | client_id | Yes |
|
PATH | merchantOrderId | Yes |
|
Example Request:
Response Parameters:
Type | Parameter | Details |
BODY | transaction_id |
|
BODY | flow |
|
BODY | callback_url |
|
BODY | date |
|
BODY | purchase.status |
|
BODY | purchase.administrative_fee |
|
BODY | purchase.promo_id |
|
BODY | purchase.term |
|
BODY | purchase.plan_id |
|
BODY | purchase.purchase_amount |
|
BODY | purchase.transaction_total_amount |
|
BODY | purchase.customer_id |
|
BODY | purchase.customer_comparison_result.shipping_information.province |
|
BODY | purchase.customer_comparison_result.shipping_information.postal_code |
|
BODY | purchase.customer_comparison_result.shipping_information.city |
|
BODY | purchase.customer_comparison_result.shipping_information.address_2 |
|
BODY | purchase.customer_comparison_result.shipping_information.address_1 |
|
BODY | purchase.customer_comparison_result.shipping_information.dob |
|
BODY | purchase.customer_comparison_result.shipping_information.last_name |
|
BODY | purchase.customer_comparison_result.shipping_information.first_name |
|
BODY | purchase.customer_comparison_result.billing_information.province |
|
BODY | purchase.customer_comparison_result.billing_information.postal_code |
|
BODY | purchase.customer_comparison_result.billing_information.city |
|
BODY | purchase.customer_comparison_result.billing_information.address_2 |
|
BODY | purchase.customer_comparison_result.billing_information.address_1 |
|
BODY | purchase.customer_comparison_result.billing_information.dob |
|
BODY | purchase.customer_comparison_result.billing_information.last_name |
|
BODY | purchase.customer_comparison_result.billing_information.first_name |
|
BODY | apply.customer_id |
|
BODY | apply_status |
|
Example Response: Buy Flow
{ "transaction_id": 131221, "flow": "buy", "callback_url": "", "purchase": { "purchase_status": "SUCCESS", "customer_comparison_result": { "shipping_information": { "province": 1, "postal_code": 0.4, "city": 1, "address_2": null, "address_1": 1, "dob": null, "last_name": 0.3333333333333333, "first_name": 0 }, "billing_information": { "province": 1, "postal_code": 0.4, "city": 1, "address_2": null, "address_1": 1, "dob": null, "last_name": 0.3333333333333333, "first_name": 0 } }, "administrative_fee": "0.00", "promo_id": "382712", "term": 3, "plan_id": "4", "purchase_amount": 2, "transaction_total_amount": 2, "customer_id": "1293835", }, "date": "2022-06-13T22:20:01.552Z"" }
Example Response: Apply Flow
{ "transaction_id": 131222, "flow": "apply", "callback_url": "", "apply": { "customer_id": 1293836, "apply_status": "SUCCESS", }, "date": "2022-06-13T22:29:20.276Z"" }
POST /online/client-id/{clientId}/merchants/payment-availability
https://onlineapi.flexiti.fi/flexiti/online-api/online/client-id/{{client_id}}/merchants/payment-availability
This endpoint compares the checkout total against the available merchant plan ranges to determine if Flexiti should be enabled as a checkout option.
Request Parameters:
Type | Parameter | Required | Details |
HEADER | authorization | Yes |
|
HEADER | x-reference-id | Yes |
|
PATH | client_id | Yes |
|
BODY | amount_requested | Yes |
|
Example Request:
{ "amount_requested": 400 }
Response Parameters:
Type | Parameter | Details |
BODY | enable_payment_gateway |
|
Success Response:
{ "enable_payment_gateway": true }