POST
/
api
/
service
/
checkout
/
session
/
create
JavaScript
import Ivy from '@getivy/node-sdk';

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

const checkoutsession = await client.checkoutsession.create({
  price: { currency: 'EUR', total: 1.01 },
  referenceId: 'referenceId',
});

console.log(checkoutsession.id);
{
  "id": "<string>",
  "market": "AF",
  "availableMarkets": [
    "AF"
  ],
  "express": true,
  "paymentMode": "direct",
  "handshake": true,
  "guest": true,
  "disableBankSelection": true,
  "price": {
    "total": 1.01,
    "currency": "EUR",
    "subTotal": 123,
    "shipping": 123,
    "totalNet": 123,
    "vat": 123
  },
  "appId": "<string>",
  "merchantAppId": "<string>",
  "merchant": {
    "id": "<string>",
    "appId": "<string>",
    "address": {
      "firstName": "<string>",
      "lastName": "<string>",
      "line1": "<string>",
      "line2": "<string>",
      "region": "<string>",
      "city": "<string>",
      "zipCode": "<string>",
      "country": "AF"
    },
    "legalName": "<string>"
  },
  "lineItems": [
    {
      "name": "<string>",
      "referenceId": "<string>",
      "singleNet": 123,
      "singleVat": 123,
      "amount": 123,
      "quantity": 1,
      "image": "<string>",
      "category": "5045",
      "EAN": "<string>",
      "co2Grams": 1
    }
  ],
  "plugin": "<string>",
  "prefill": "<any>",
  "locale": "de",
  "required": {
    "phone": true
  },
  "offsetProject": "<string>",
  "expiresAt": 123,
  "created": 123,
  "impactOffsetProjects": [
    "<string>"
  ],
  "shopLogo": "<string>",
  "shopName": "<string>",
  "customer": {
    "id": "<string>"
  },
  "incentiveMode": "<string>",
  "shippingMethods": [
    "<any>"
  ],
  "selectedShippingMethodId": "<string>",
  "status": "open",
  "mandate": {
    "setup": false
  },
  "referenceId": "<string>",
  "displayId": "<string>",
  "metadata": {},
  "category": "<string>",
  "abortReason": "<string>",
  "billingAddress": {
    "firstName": "<string>",
    "lastName": "<string>",
    "line1": "<string>",
    "line2": "<string>",
    "region": "<string>",
    "city": "<string>",
    "zipCode": "<string>",
    "country": "AF"
  },
  "shippingAddress": {
    "firstName": "<string>",
    "lastName": "<string>",
    "line1": "<string>",
    "line2": "<string>",
    "region": "<string>",
    "city": "<string>",
    "zipCode": "<string>",
    "country": "AF"
  },
  "redirectUrl": "<string>",
  "successCallbackUrl": "<string>",
  "errorCallbackUrl": "<string>",
  "quoteCallbackUrl": "<string>",
  "completeCallbackUrl": "<string>",
  "createdAt": "<any>",
  "updatedAt": "<any>",
  "subaccountId": "<string>",
  "paymentSchemeSelection": "instant_preferred"
}

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 order. Needs to be unique per shop and can be up to 200 characters.

Maximum length: 200
price
object
required

Price of the checkout session

express
boolean
default:false

Sets the checkout to a express version

paymentMode
enum<string>

The mode in which the payment should be processed. If direct is used, you need to provide a settlementDestination

Available options:
direct,
settlement
settlementDestination
object
displayId
string

The order id which will be displayed to the user and in the merchant dashboard. At most 200 characters are allowed.

Maximum length: 200
metadata
object

Any data which will be stored and returned for this checkout session and corresponding order

lineItems
object[]

All line items of this checkout session. At least one line item required

Minimum length: 1
billingAddress
object

The billing address of the customer.

prefill
object

The values specified here will be pre-filled in the Ivy Checkout.

created
number

The Epoch time in seconds at which the Checkout Session was created. By default, time of api CheckoutSession creation at Ivy.

Required range: x > 0
expiresAt
number

The Epoch time in seconds at which the Checkout Session will expire. It can be anywhere from 5 minutes to 6 days after Checkout Session creation. By default, this value is 1 hour from creation.

locale
enum<string>
Available options:
de,
nl,
en,
fr,
es,
fi,
it,
pt,
sv,
pl,
sk,
lt
disableBankSelection
boolean
default:false

Disable bank selection mode. If set to true, customers cannot modify the pre selected bank.

successCallbackUrl
string

Users will be redirected here on default after a successful checkout.

errorCallbackUrl
string

Users will be redirected here on default after an unsuccessful checkout.

quoteCallbackUrl
string

Quote Callback requests will be sent to this URL on default.

completeCallbackUrl
string

Complete Callback requests will be sent to this URL on default.

market
enum<string>

The market of the checkoutSession. Will show the market banks connected with this market

Available options:
AF,
AL,
DZ,
AS,
AD,
AO,
AI,
AQ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
instant_preferred,
standard,
instant_only
customer
object
themeVariant
enum<string>
Available options:
light,
dark

Response

200 - application/json

Returns the created checkout session

id
string
required
price
object
required
appId
string
required
merchantAppId
string
required
merchant
object
required
lineItems
object[]
required
expiresAt
number
required
created
number
required
status
enum<string>
required
Available options:
open,
closed,
expired
referenceId
string
required
displayId
string
required
redirectUrl
string
required
successCallbackUrl
string
required
errorCallbackUrl
string
required
market
enum<string>
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
availableMarkets
enum<string>[]
express
boolean
paymentMode
enum<string>
Available options:
direct,
settlement
handshake
boolean
guest
boolean
disableBankSelection
boolean
plugin
string
prefill
any
locale
enum<string>
Available options:
de,
nl,
en,
fr,
es,
fi,
it,
pt,
sv,
pl,
sk,
lt
required
object
offsetProject
string
impactOffsetProjects
string[]
shopName
string
customer
object
incentiveMode
string
shippingMethods
any[]
selectedShippingMethodId
string
mandate
object
metadata
object
category
string
abortReason
string
billingAddress
object
shippingAddress
object
quoteCallbackUrl
string
completeCallbackUrl
string
createdAt
any
updatedAt
any
subaccountId
string
paymentSchemeSelection
enum<string>
Available options:
instant_preferred,
standard,
instant_only