Skip to main content
POST
/
api
/
service
/
data
/
session
/
create
JavaScript
import Ivy from '@getivy/node-sdk';

const client = new Ivy({
  apiKey: 'My API Key',
});

const session = await client.data.session.create({ referenceId: 'referenceId' });

console.log(session.id);
{
  "id": "<string>",
  "referenceId": "<string>",
  "redirectUrl": "<string>",
  "displayId": "<string>",
  "merchantId": "<string>",
  "status": "open",
  "createdAt": 123,
  "updatedAt": 123,
  "expiresAt": 123,
  "availableMarkets": [
    "AF"
  ],
  "locale": "de",
  "market": "AF",
  "metadata": {},
  "prefill": {
    "bankId": "<string>"
  },
  "disableBankSelection": true,
  "successCallbackUrl": "<string>",
  "errorCallbackUrl": "<string>"
}

Authorizations

X-Ivy-Api-Key
string
header
required

API key for authentication

Body

application/json
referenceId
string
required

An internal reference id which will be stored with the data session. Needs to be unique per data session. Maximum length is 200 characters.

Maximum length: 200
displayId
string

Currently only visible in the merchant dashboard. This id used to be displayed to the user during the checkout.

Maximum length: 200
locale
enum<string>

The locale of the data session. If not provided, the default locale will be used.

Available options:
de,
nl,
en,
fr,
es,
fi,
it,
pt,
sv,
pl,
sk,
lt
market
enum<string>

ISO 3166-1 alpha-2 country code of the market. If set, the market's default banks will be displayed during the Data Session.

Available options:
AF,
AL,
DZ,
AS,
AD,
AO,
AI,
AQ,
AG,
AR,
AM,
AW,
AU,
AT,
AZ,
BS,
BH,
BD,
BB,
BY,
BE,
BZ,
BJ,
BM,
BT,
BO,
BA,
BW,
BV,
BR,
IO,
BN,
BG,
BF,
BI,
KH,
CM,
CA,
CV,
KY,
CF,
TD,
CL,
CN,
CX,
CC,
CO,
KM,
CG,
CD,
CK,
CR,
CI,
HR,
CU,
CY,
CZ,
DK,
DJ,
DM,
DO,
EC,
EG,
SV,
GQ,
ER,
EE,
ET,
FK,
FO,
FJ,
FI,
FR,
GF,
PF,
TF,
GA,
GM,
GE,
DE,
GH,
GI,
GR,
GL,
GD,
GP,
GU,
GT,
GN,
GW,
GY,
HT,
HM,
VA,
HN,
HK,
HU,
IS,
IN,
ID,
IR,
IQ,
IE,
IL,
IT,
JM,
JP,
JO,
KZ,
KE,
KI,
KP,
KR,
KW,
KG,
LA,
LV,
LB,
LS,
LR,
LY,
LI,
LT,
LU,
MO,
MG,
MW,
MY,
MV,
ML,
MT,
MH,
MQ,
MR,
MU,
YT,
MX,
FM,
MD,
MC,
MN,
MS,
MA,
MZ,
MM,
NA,
NR,
NP,
NL,
NC,
NZ,
NI,
NE,
NG,
NU,
NF,
MP,
MK,
NO,
OM,
PK,
PW,
PS,
PA,
PG,
PY,
PE,
PH,
PN,
PL,
PT,
PR,
QA,
RE,
RO,
RU,
RW,
SH,
KN,
LC,
PM,
VC,
WS,
SM,
ST,
SA,
SN,
SC,
SL,
SG,
SK,
SI,
SB,
SO,
ZA,
GS,
ES,
LK,
SD,
SR,
SJ,
SZ,
SE,
CH,
SY,
TW,
TJ,
TZ,
TH,
TL,
TG,
TK,
TO,
TT,
TN,
TR,
TM,
TC,
TV,
UG,
UA,
AE,
GB,
US,
UM,
UY,
UZ,
VU,
VE,
VN,
VG,
VI,
WF,
EH,
YE,
ZM,
ZW,
AX,
BQ,
CW,
GG,
IM,
JE,
ME,
BL,
MF,
RS,
SX,
SS,
XK
successCallbackUrl
string

Required if not set in the dashboard. Users will be redirected here after a successful session.

errorCallbackUrl
string

Required if not set in the dashboard. Users will be redirected here after a unsuccessful session.

metadata
object

Any data which will be stored and returned for this data session. See here for more info.

expiresAt
number

The Epoch time in seconds at which the Session should expire. It can be anywhere from 30 minutes to 24 hours after Session creation. By default, this value is 1 hour from creation. When setting this field, you also need to set created.

createdAt
number

Required when setting expiresAt. The Epoch time in seconds at which the Session was created.

themeVariant
enum<string>

The theme variant which will be used in the data session. If not provided, the default light theme will be used.

Available options:
light,
dark
prefill
object

Prefill options for the data session

disableBankSelection
boolean
default:false

False by default. If set to true, customers cannot choose another bank than the pre-selected one.

Response

201 - application/json

Returns the details of the data session

id
string
required

The id of the data session.

referenceId
string
required

An internal reference id for the data session.

redirectUrl
string
required

The redirect URL of the data session.

displayId
string
required

Currently only visible in the merchant dashboard. This id used to be displayed to the user during the checkout.

merchantId
string
required

The id of the merchant.

status
enum<string>
required

The status of the data session.

Available options:
open,
closed,
expired
createdAt
number
required

The Epoch time in seconds at which the Session was created.

updatedAt
number
required

The Epoch time in seconds at which the Session was updated.

expiresAt
number
required

The Epoch time in seconds at which the Session will expire.

availableMarkets
enum<string>[]
required

The markets where the user of the Data Session can select banks from.

disableBankSelection
boolean
required

Whether customers can choose another bank than the pre-selected one.

successCallbackUrl
string
required

The URL where users will be redirected after a successful session.

errorCallbackUrl
string
required

The URL where users will be redirected after an unsuccessful session.

locale
enum<string>

The locale of the data session.

Available options:
de,
nl,
en,
fr,
es,
fi,
it,
pt,
sv,
pl,
sk,
lt
market
enum<string>

ISO 3166-1 alpha-2 country code of the market.

Available options:
AF,
AL,
DZ,
AS,
AD,
AO,
AI,
AQ,
AG,
AR,
AM,
AW,
AU,
AT,
AZ,
BS,
BH,
BD,
BB,
BY,
BE,
BZ,
BJ,
BM,
BT,
BO,
BA,
BW,
BV,
BR,
IO,
BN,
BG,
BF,
BI,
KH,
CM,
CA,
CV,
KY,
CF,
TD,
CL,
CN,
CX,
CC,
CO,
KM,
CG,
CD,
CK,
CR,
CI,
HR,
CU,
CY,
CZ,
DK,
DJ,
DM,
DO,
EC,
EG,
SV,
GQ,
ER,
EE,
ET,
FK,
FO,
FJ,
FI,
FR,
GF,
PF,
TF,
GA,
GM,
GE,
DE,
GH,
GI,
GR,
GL,
GD,
GP,
GU,
GT,
GN,
GW,
GY,
HT,
HM,
VA,
HN,
HK,
HU,
IS,
IN,
ID,
IR,
IQ,
IE,
IL,
IT,
JM,
JP,
JO,
KZ,
KE,
KI,
KP,
KR,
KW,
KG,
LA,
LV,
LB,
LS,
LR,
LY,
LI,
LT,
LU,
MO,
MG,
MW,
MY,
MV,
ML,
MT,
MH,
MQ,
MR,
MU,
YT,
MX,
FM,
MD,
MC,
MN,
MS,
MA,
MZ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