Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

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

  • ASCII string (100)

  • This is the Client ID given in the Developer User Account section

FORMDATA/BODY

client_secret

Yes

  • ASCII string (100)

  • This is the Client Secret given in the Developer User Account section

HEADER

x-reference-id

Yes

  • ASCII string (32)

  • GUID

  • Unique identifier for the flow for traceability purposes

FORMDATA/BODY

grant_type

No

  • ASCII string

  • This is the client's access type

  • possible values: 'password', 'refresh_token', 'client_credentials'

  • default value: 'client_credentials'

FORMDATA/BODY

refresh_token

Yes - If grant_type = “refresh_token”

  • ASCII string

  • only to be used with the grant_type: refresh_token.

  • It should be the refresh_token attribute in the last response of this method.

FORMDATA/BODY

scope

No

  • ASCII string

  • Available values: ‘customer', 'merchant’

  • Default value: merchant

 Example Request:

Response Parameters:

Type

Parameter

Details

BODY

access_token

  • Bearer token to be used in subsequent calls

BODY

expires_in

  • Time, in seconds, that the token will last

BODY

refresh_token

  • Token to be used to refresh the access_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

  • ASCII string (40)

  • This is the word “Bearer” with a space and then the access_token given in oauth/token API response

  • Default value: Bearer {insert_bearer_token_from_oauth_here/token_api}

HEADER

x-reference-id

Yes

  • ASCII string (32)

  • GUID

  • Unique identifier for the flow for traceability purposes

PATH

client_id

Yes

  • ASCII string (100)

  • This is the Client ID given in the Developer User Account section

BODY

merchant_orderid

Optional

  • ASCII String

  • Optional field provided by the merchant (Typically the order ID in the Merchant Shopping Cart). This value can be used to request information from Flexiti regarding the transaction in the GET /notifications/merchant-order-id/{merchant-order-id} endpoint.

BODY 

is_guest

Optional

  • Boolean

  • Identifies if the current shopping cart user is running a guest session. Is useful to identify the application risk

  • Default value: false

 

customer_id

Optional - Required for Buy & Apply/Buy Flow if VCC is not provided

  • ASCII string (20)

  • Value helps in identifying customer if their customer-id is already known (i.e. Merchant can save a customer’s Flexiti customer-id to be associated with their merchant profile). This makes it easier for the Flexiti Online flow to identify the customer account, taking them directly to checkout.

 

vcc

Optional - Required for Buy & Apply/Buy Flow if customer_id is not provided

  • ASCII string (16)

  • The FlexitiCard Number (VCC) of the Customer. If provided, takes the customer directly to the checkout flow.

 

has_previous_purchase

Optional

  • Boolean

  • Help identify if the current shopping cart user has previously purchased using your

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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

 

email

 

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

 

https://onlineapi-training.flexiti.fi/flexiti/online-api/online/client-id/flexitidemo/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?

  • No labels