Create session [BETA]

Beta feature

This feature is currently in private beta, and the final specification may still change.

Create a session to start a checkout process with Mollie Components.

Access with

API key

Organization access token with sessions.write

OAuth access with sessions.write

Body Params
amount
object
required

In v2 endpoints, monetary amounts are represented as objects with a currency and value field.

string
required

A user-friendly description of the session that may be shown to the customer during the checkout process.

Any payment created for the session will use the same description.

lines
array of objects
required

List of items the customer will pay for in this session. The sum of all line items must equal the session's amount.

All lines must have the same currency as the session.

lines*
string
required

The URL your customer will be redirected to after the payment process.

It could make sense for the redirectUrl to contain a unique identifier โ€“ like your order ID โ€“ so you can show the right page referencing the order when your customer returns.

billingAddress
object

The customer's billing address details. We advise to provide these details to improve fraud protection and conversion.

shippingAddress
object

The customer's shipping address details. We advise to provide these details to improve fraud protection and conversion.

string | null

The ID of the customer the session is being created for. This is used primarily for recurring payments, but can also be used on regular payments to enable single-click payments.

If sequenceType is set to first, this field is required.

string

Only relevant for recurring payments.

Indicate if this session is used for a one-off or a first of a recurring payment.

With a first payment, the customer agrees to automatic recurring charges taking place on their account in the future.

Defaults to oneoff, which is a regular non-recurring payment.

Possible values: oneoff first

metadata
object

Provide any data you like in a JSON object. We will save the data alongside the entity. Whenever you fetch the entity with our API, we will also include the metadata. You can use up to approximately 1kB.

Any payment created for the session will use the same metadata.

payment
object
string

The identifier referring to the profile this entity belongs to.

When using an API Key, the profileId must not be sent since it is linked to the key. However, for OAuth and Organization tokens, the profileId is required.

For more information, see Authentication.

boolean | null

Whether to create the entity in test mode or live mode.

Most API credentials are specifically created for either live mode or test mode, in which case this parameter must not be sent. For organization-level credentials such as OAuth access tokens, you can enable test mode by setting testmode to true.

Responses

Language
Credentials
LoadingLoadingโ€ฆ
Response
Choose an example:
application/hal+json