...
Online API Endpoints
POST /oauth/token
Code Block |
---|
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.
Request Parameters:
...
Type
...
Parameter
...
Required
...
Details
...
Body
...
grant_type
...
Yes
...
...
Body
...
client_id
...
Yes
...
...
Body
...
client_secret
...
Yes
...
...
Body
...
username
...
No
...
...
Body
...
password
...
No
...
...
Header
...
Authorization
...
No
...
Response Parameters:
...
Type
...
Parameter
...
Details
...
String
...
access_token
...
...
String
...
token_type
...
...
Integer
...
expires_in
...
...
...
refresh_token
...
...
...
scope
...
Example Response:
{
"access_token": "e1f7258ee83a9b9ab0df88c72da5d12e5bcb190d",
"token_type": "Bearer",
"expires_in": 1199,
"refresh_token": "3a9c2cc9098c172fd757e903e2e34b8e137c29e6",
"scope": "merchant"
}
...
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:
Code Block |
---|
{
"token_type": "bearer",
"access_token": "2d8f373a3c2b1e61baf5a7769930ff4f0e08cdb0",
"expires_in": 1200,
"refresh_token": "36e0fc3d7415145f4b1d71512c459fd6eaa13aa8",
"scope": "merchant"
} |
POST /online/v2/client-id/{clientId}/systems/init
...
Code Block |
---|
https://onlineapi.flexiti.fi/flexiti/online-api/online/ |
...
client-id/{ |
...
{client_id}}/systems/init |
This endpoint will return the Flexiti payment gateway, allowing customers to checkoutOnline Flow as a Redirect URL, which can be hosted in a Modal (Preferred presentation method).
Request Parameters:
Type | Parameter | Required | Details |
HEADER |
authorization |
Yes
Path
clientId
Yes
Body
merchant_orderid
string
is_guest
True, False
customer_id
string
vcc
Yes for existing cardholders
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
No
string
city
string
province
ON, AB, QC,
postal_code
string
show_close_button
string
billing_information
"billing_information": {
"first_name": "string",
"last_name": "string",
"address_1": "string",
"address_2": "string",
"city": "string",
"postal_code": "string",
"province": "string"
shipping_information"
"shipping_information": {
"address_1": "string",
"address_2": "string",
"city": "string",
"postal_code": "string",
"province": "string"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,
...