Online API Endpoints
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 |
|
| customer_id | Optional - Required for Buy & Apply/Buy Flow if VCC is not provided |
|
| vcc | Optional - Required for Buy & Apply/Buy Flow if customer_id is not provided |
|
| has_previous_purchase | Optional |
|
| |||
| |||
| |||
| |||
| |||
| |||
| |||
| |||
| |||
| |||
| |||
| |||
| |||
| |||
| |||
| |||
| |||
|
Success Response:
{
"online_order_id": 0,
"redirection_url": "string"
}
Failure Response:
{
"code": 0,
"error": "string",
"error_description": "string"
}
POST /online/client-id/{clientId}/systems/learn-more
Request Parameters:
Type | Parameter | Required | Details |
Header | Authorization |
|
|
Path | clientId |
|
|
Body | merchant_orderid |
| string |
| is_guest |
| True, False |
| customer_id |
| string |
| vcc |
| string |
| has_previous_purchase |
| True, False |
| lang |
| En-CA, en-FR |
| flow |
| Apply, Buy |
| salutation |
| Mr, Mrs, Ms |
| amount_requested |
| string |
|
| string | |
| phone_number |
| string |
| fname |
| string |
| mname |
| string |
| lname |
| string |
| dob |
| string |
| address_1 |
| string |
| address_2 |
| string |
| city |
| string |
| province |
| ON, AB, QC, |
| postal_code |
| string |
| show_close_button |
| string |
GET /online/v2/client-id/{clientId}/systems/payment-calculator
Request Parameters:
Type | Parameter | Required | Details |
Header | Authorization | Yes |
|
Path | ClientId | Yes | string |
Query | Price | Yes |
|
Query | Customer ID |
| string |
|
|
|
|
|
|
|
|
Success Response:
{
"htmlRender": "string",
"paymentPlan": {
"monthlyPayment": "string",
"months": "string"
}
}
Notification Endpoints
POST /online/client-id/{clientId}/notifications/test
Simulates an event triggered and will communicate to the callback url defined by the user the success or cancellation for a purchase.
Request Parameters:
Type | Parameter | Required | Details |
Header | Authorization |
| string |
Path | ClientId |
| String |
Body | Event |
| Purchase, Apply |
| Notification_type |
| Success, Error, Cancelled |
Success Response:
{
"event": 0,
"notificationType": "string",
"callback_url": "string",
"username": 0,
"client_id": "string",
"purchase": {
"customer_fname": "string",
"customer_lname": "string",
"customer_dob": "string",
"customer_postal_code": "string",
"customer_id": 0,
"purchase_status": "string",
"purchase_amount": "string",
"administrative_fee": "string",
"transaction_total_amount": 0,
"vcc": 0,
"plan_id": 0,
"term": 0,
"promo_id": 0,
"customer_comparison_result": {
"billing_information": {
"first_name": 0,
"last_name": 0,
"address_1": 0,
"address_2": 0,
"city": 0,
"postal_code": 0,
"province": 0
},
"shipping_information": {
"address_1": 0,
"address_2": 0,
"city": 0,
"postal_code": 0,
"province": 0
}
}
},
"apply": {
"customer_fname": "string",
"customer_lname": "string",
"customer_dob": "string",
"customer_postal_code": "string",
"apply_status": "string",
"customer_id": 0,
"vcc": 0
}
}
Retrieve Information
GET /online/client-id/{clientId}/notifications/order-id/{orderId}
Request Parameters:
Type | Parameter | Required | Details |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Example Request:
Response Parameters:
Type | Parameter | Details |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Example Response:[SS2]
GET /online/client-id/{clientId}/notifications/merchant-order-id/{MerchantOrderId}
Get Apply or Purchase information and status for a given order Using Merchant order ID.
Request Parameters:
Type | Parameter | Required | Details |
Header | Authorization | Yes | String |
Path | ClientId | Yes | string |
Path | merchantOrderId | Yes | Integer |
Success Response:
{
"event": 0,
"notificationType": "string",
"callback_url": "string",
"username": 0,
"client_id": "string",
"purchase": {
"customer_fname": "string",
"customer_lname": "string",
"customer_dob": "string",
"customer_postal_code": "string",
"customer_id": 0,
"purchase_status": "string",
"purchase_amount": "string",
"administrative_fee": "string",
"transaction_total_amount": 0,
"vcc": 0,
"plan_id": 0,
"term": 0,
"promo_id": 0,
"customer_comparison_result": {
"billing_information": {
"first_name": 0,
"last_name": 0,
"address_1": 0,
"address_2": 0,
"city": 0,
"postal_code": 0,
"province": 0
},
"shipping_information": {
"address_1": 0,
"address_2": 0,
"city": 0,
"postal_code": 0,
"province": 0
}
}
},
"apply": {
"customer_fname": "string",
"customer_lname": "string",
"customer_dob": "string",
"customer_postal_code": "string",
"apply_status": "string",
"customer_id": 0,
"vcc": 0
}
}
default
Error
Example Value
Model
GET /online/client-id/{clientId}/notifications/promo-id/{promoId}
This endpoint allows you to get Apply or Purchase information and status for a given order Using Flexiti promo ID.
Request Parameters:
Type | Parameter | Required | Details |
Header | Authorization |
|
|
Path | ClientId |
|
|
Path | PromoId |
|
|
Success Response:
{
"fname": "string",
"lname": "string",
"transaction_total_amount": 0,
"purchase_amount": "string",
"plan_id": "string",
"term": 0,
"promo_id": "string",
"administrative_fee": 0,
"customer_comparison_result": {
"billing_information": {
"first_name": 0,
"last_name": 0,
"address_1": 0,
"address_2": 0,
"city": 0,
"postal_code": 0,
"province": 0
},
"shipping_information": {
"address_1": 0,
"address_2": 0,
"city": 0,
"postal_code": 0,
"province": 0
}
}
}
POST /online/client-id/{clientId}/merchants/payment-availability
This endpoint is for comparing the price to return if the payment gateway can be shown.
Request Parameters:
Type | Parameter | Required | Details |
Header | Authorization | Yes |
|
Path | clientId | Yes |
|
Body | amount_requested
| Yes |
|
Example Request:
Success Response:
{
"enable_payment_gateway": true
}
Failure Response
{
"code": 0,
"error": "string",
"error_description": "string"
}
[SS1]Determine which body parameters needed for apply and for buy
[SS2]Is this endpoint needed?