Session: Create

Creates a session. There're 3 modes for the session:

  • payment: A payment will be created after user completed the session (default).
  • customer: A customer will be created instead of a payment, or updated if customer_id is given. This customer resource can then be used to perform delayed billing or subscriptions.
  • customer_payment: A payment will be created, and customer will be created or updated. You can use this mode to charge money upfront and save customer's payment details in one go.
Body Params
string
enum
required

In payment mode, a payment will be created after customer has completed the session.

Allowed:
string

Specify the URL where user will be redirected to after they have completed or aborted the session. A session_id will be appended to this URL as a query parameter.

int32
required

Amount greater than or equal to 0, in the lowest denomination of the currency (e.g. cents for USD).

string
enum
required

3-letter ISO currency code.

string

Customer's email address.

int32

Time in seconds until the session expires after being created.

The default value and upper limit are 86,400 seconds (24 hours).

string

An unique identifier of your customer. If your system has the concept of user accounts, then the ID of the current logged in user would be appropriate.

payment_types
array of objects

Specify which payment types are available for this session.

By default, all activated payment methods will be available for the session if this value is omitted.

payment_types
string
enum

For supported payment methods, sets the language of the instruction page.

Allowed:
line_items
array of objects

Specify the line items which will be displayed on the session page.

line_items
metadata
object

Store any additional data you want to associate with the session. The object's keys and values must be strings. Keys have a maximum length of 30 characters. Values have a maximum length of 2000 characters.

payment_data
object
Response

Language
Credentials
Basic
base64
:
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json