Get a Session - v1
This is a deprecated version, please click here for the latest version
Linking customer bank accounts through Link Money's SDK requires a session key. To retrieve a session key, call the following endpoint with the appropriate customer details. Your auth token (see Get a Token) must be included as a header to the API sessions endpoint.
This endpoint returns a session key to be used for SDK requests. Session keys are uniquely associated with each customer's session. When a customer wants to link a new account, a session key must be retrieved for them. The only mandatory fields in the session request are email, firstName and lastName. Additional data provided through the session API enables us to more accurately decision payments and enhance the user experience. Check out best practices to learn more about the data requested.
Parameters
Content-Type String - (Required)
application-json
Accept String - (Required)
application-json
Authorization String - (Required)
Bearer {ACCESS_TOKEN} (See Authentication)
email String - (Required)
Customer Email
fistName String - (Required)
Customer First Name
lastName String - (Optional)
Customer Last Name
phoneNumber String - (Required)
Customer Phone Number
billngAddress Object - (Required)
Customer Billing Address
shippingAddress Object - (Required)
Customer Shipping Address
items Array of Objects - (Required)
Each item should have a description (string), amount (object) and goodType (enum). The values for goodType are DIGITAL or PHYSICAL
amount Object - (Required)
This is the item’s cost and is part of the object passed in the items array.
totalAmount Object - (Required)
Total Amount
subTotalAmount Object - (Required)
Only accepted if totalAmount is populated
discountAmount Object - (Required)
Only accepted if subTotalAmount is populated
shippingAmount Object - (Required)
Only accepted if subTotalAmount is populated
taxAmount Object - (Required)
Only accepted if subTotalAmount is populated
product enum - (Required)
PAY or VERIFY - indicates whether this session is for Pay by Bank or AccountVerify. Defaults to PAY
customerProfile Object - (Optional)
Customer information collected to increase authorization rate and prevent fraud
streetAddress String - (Required)
stateOrProvince String - (Required)
postalCode String - (Optional)
streetAddress String - (Required)
stateOrProvince String - (Required)
postalCode String - (Optional)
description String - (Required)
Description of item
goodType enum - (Required)
The type of item
amount String - (Required)
{ value: (float), currency: USD }
description String - (Required)
Description of item
goodType enum - (Required)
The type of item
amount String - (Required)
{ value: (float), currency: USD }
Returns
Token-Type String
The type of token granted
expires_in Numberic
The lifetime in seconds of the access token. For example, the value '3600' denotes that the access token will expire in one hour from the time the response was generated
access_token String
The access token issued by the authorization server
scope String
The scope to which the token is granted access for
Post Request
POST - /v1/sessions1curl --location --request POST '{API_BASE_URL}/v1/sessions'
2--header 'Content-Type: application/json'
3--header 'Accept: application/json'
4--header 'Authorization: Bearer {ACCESS_TOKEN}'
5--data-raw '{
6 "firstName" : "{CUSTOMER_FIRST_NAME}",
7 "lastName" : "{CUSTOMER_LAST_NAME}",
8 "email" : "{CUSTOMER_EMAIL}",
9 "phoneNumber" : "{CUSTOMER_PHONE_NUMBER}",
10 "billingAddress" : {
11 "streetAddress": string,
12 "city": string,
13 "stateOrProvince": string
14 "postalCode": string,
15 "country": string
16 },
17 "orderDetails": {
18 "items": [
19 {
20 "description": string,
21 "goodType": enum
22 "amount": { "value": float, "currency": "USD" }
23 },
24 {
25 "description": string,
26 "goodType": enum
27 "amount": { "value": float, "currency": "USD" }
28 }
29 ],
30 "subtotalAmount": { "value": float, "currency": "USD" },
31 "discountAmount": { "value": float, "currency": "USD" },
32 "shippingAmount": { "value": float, "currency": "USD" },
33 "taxAmount": { "value": float, "currency": "USD" },
34 "totalAmount": { "value": float, "currency": "USD" },
35 "shippingAddress": {
36 "streetAddress": string,
37 "city": string,
38 "stateOrProvince": string
39 "postalCode": string,
40 "country": string
41 },
42 },
43 "customerProfile":{
44 "guestCheckout": boolean,
45 "accountCreationDate": timestamp,
46 "transactionCount": integer,
47 "firstTransactionDate": timestamp,
48 "verifiedEmail": boolean,
49 "verifiedPhone": boolean
50 },
51 "product": "PAY"
52}'
53
Response Body
{ "sessionKey" : "a5292de413e-2626d8244239-879a9-ffbdfa2" }
Overview
Calls to Link Money's APIs are authenticated with an authorization token. This token can be retrieved by making a call to our authentication servers as in the following example. The two pieces of information needed to get an authorization token are your Client ID and Client Secret. See later steps in this tutorial for examples of how to use your auth token.
Retrieving Your Auth Token
Client ID and Secret
Your Client ID and Secret can be retrieved from Link Money's merchant portal. Use the following links for sandbox and production. Navigate to the Accounts page and look for the tile pictured below. Enter these values in the template in the next step.
Auth Token Request
This is an example of retrieving an auth token in bash. Ensure that a POST method is being used, you have the correct URL, you include the content-type header with the value given in the following example, fill in your client ID and secret in the appropriate fields, and include the appropriate scope for the request you are making.
Scope types
Link-Payment
string
Used for Payments, Refunds, Credits, and Cancelations
Link-Core
string
For all other requests