Online API Endpoints Reference
- 1 POST /oauth/token
- 2 POST /online/v2/client-id/{clientId}/systems/init
- 3 GET /online/v2/client-id/{clientId}/systems/payment-calculator
- 4 GET /online/client-id/{clientId}/notifications/order-id/{orderId}
- 5 GET /online/client-id/{clientId}/notifications/merchant-order-id/{merchantOrderId}
- 6 POST /online/client-id/{clientId}/merchants/payment-availability
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/v2/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).
*NOTE: If you are integrating the APPLY-ONLY flow, please remove ‘/v2’ from the API URI, this will ensure that the flow opened immediately starts the application flow.
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”:
Example Request - Flow = “buy”:
Example Request - Flow = “apply/buy”:
Response Parameters:
Type | Parameter | Details |
BODY | online_order_id |
|
BODY | redirection_url |
|
Success Response:
GET /online/v2/client-id/{clientId}/systems/payment-calculator
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:
GET /online/client-id/{clientId}/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
Example Response: Apply Flow
GET /online/client-id/{clientId}/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
Example Response: Apply Flow
POST /online/client-id/{clientId}/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:
Response Parameters:
Type | Parameter | Details |
BODY | enable_payment_gateway |
|
Success Response: