Create a checkout session

Arguments

Field
Type
Required
Description

amount

integer

yes

The amount to be deposit to the customer in the minor currency.

currency

string

yes

Three-letter ISO currency code (ISO-4217). Must be a supported currency.

customer_email

string

yes

Customer’s email.

customer_firstname

string

yes

Customer’s firstname.

customer_lastname

string

yes

Customer’s lastname.

success_url

string

yes

The URL to which application should send customers when checkout session is completed.

cancel_url

string

no

if set, checkout display a back button and customer will be redirect to this URL if they decide to cancel payment and return to your website.

notification_url

string

no

The webhook URL is the endpoint that receives notifications about events related to the deposit session, such as session creation, status updates, or completion. Check Checkout Session webhook events specification section

customer_ip

string

no

Customer’s IP address.

customer_country

string

no

Customer’s country.

payment_method

list

no

A list of the types of payment methods the Checkout Session is allowed to accept. Possible values: blik

expires_at

integer

no

The timestamp indicating when the session will expire. If this parameter is not provided, the default expiration is set to 24 hours after the session is created.

locale

string

no

The IETF language tag of the locale Checkout is displayed in. If blank, the browser’s locale is used.

metadata

hash

no

A set of key-value pairs that you can attach to a payout object. It can be useful for storing additional information about the payout in a structured for

POST https://{provided url}/v1/checkout/sessions

curl https://{provided url}/v1/checkout/sessions \
  -u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \
  -d amount=1000 \
  -d currency=usd \
  -d customer_email=john@example.com \
  -d customer_firstname=John \
  -d customer_lastname=Doe \
  -d payment_method=blik \
  -d expires_at=2147483648
  -d success_url=https://url.com/
  -d cancel_url=https://url.com/
  -d notification_url:https://url.com/

The above command returns JSON structured like this:

{
	"id": "AW-kLcRRC5P8U68CYe0kVA",
	"amount_total": 1000,
	"amount_sub_total": 1000,
	"currency": "usd",
	"cancel_url": "https://url.com/"
	"customer_firstname": "John",
	"customer_lastname": "Doe",
	"customer_email": "john@example.com",
	"customer_ip": "",
	"customer_country": "",
	"expire_at": 2147483648,
	"created_at": 2147483648,
	"success_url": "https://url.com/",
	"payment_method": ["blik"],
	"locale": "",
	"url": "https://{provided url}/pay/AW-kLcRRC5P8U68CYe0kVA",
	"fees": null,
	"metadata": null,
	"status": "open",
	"livemode": false,
	"notification_url": "https://url.com/"
}

Last updated