Create a Checkout Session
Create a new checkout session for processing payments.
- Type: stringIdempotency
- Key max length:255Pattern: ^[a-zA-Z0-9:_\-.]+$Provide a unique, stable key per operation so retries don't create duplicates. Allowed: letters, digits, colon, dash, underscore, dot. Max 255 characters.
Request parameters for creating a new checkout session.
Request parameters for creating a new checkout session.
- currencyrequired
- Type: stringdescription
A free-form reference to describe the checkout
- Type: stringenummoderequired
The mode of the Checkout Session.
values- payment
Standard one-time payment.
- setup
Set up a payment method for future use.
- subscription
Coming soon. Not available yet.
- Type: stringenumui
_mode The UI mode of the Session. Defaults to
hosted.values- custom
- embedded
- hosted
- Type: stringcancel
_url If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website.
- Type: stringsuccess
_url The URL to which Paypercut should send customers when payment or setup is complete. This parameter is not allowed if ui_mode is embedded or custom. If you'd like to use information from the successful Checkout Session on your page, read the guide on customizing your success page.
- Type: stringreturn
_url The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. This parameter is required if ui_mode is embedded or custom and redirect-based payment methods are enabled on the session.
- Type: array string[]payment
_method _types A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept.
- Type: string | nullenumsubmit
_type Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button.
submit_typecan only be specified on Checkout Sessions inpaymentmode. If blank orauto,payis used.values- auto
- book
- donate
- pay
- subscribe
- Type: object ·wallet
_options Wallet-specific configuration for this Checkout Session.
- Type: stringclient
_reference _id A free-form reference from the merchant's system. Typically used to identify the checkout in the merchant's system. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the session with your internal systems.
- Type: stringclient
_customer _id An identifier of the customer in the merchant's system. Used to associate the Checkout and corresponding payments created from the Checkout. Required for SEPA payments - this will ensure that your customer is given a virtual iban that is unique to them and will enable Paypercut to reconcile the payment.
- Type: string | nullFormat: date-timeexpires
_at Expiry time for the checkout. After this time, the checkout will no longer be available for payment. Defaults to 24h after creation.
- Type: array object[] ·line
_items Details about the products sold or services provided
- Type: object · PaymentIntentDatapayment
_intent _data Create-time PaymentIntent options accepted when creating a Checkout Session.
- Type: object · SavedPaymentMethodOptionssaved
_payment _method _options - metadata
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata.Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata.- propertyType: string
Name
- Type: objectafter
_completion After completion behavior for the Checkout Session.
- Type: stringenumlocale
The IETF language tag of the locale Checkout is displayed in. If blank or auto, the browser's locale is used.
values- auto
- bg
- bg
- B G - cs
- cs
- C Z
- Type: string | nullcustomermax length:100
ID of an existing Customer, if one exists.
- Type: string | nullcustomer
_email If provided, this value will be used when the Customer object is created. If not provided, customers will be asked to enter their email address. Use this parameter to prefill customer data if you already have an email on file. To access information about the customer once a session is complete, use the
customerfield. - Type: stringenumcustomer
_creation Configure whether a Checkout Session creates a Customer during Session confirmation. When a Customer is not created, you can still retrieve email, address, and other customer data entered in Checkout with customer_details. Can only be set in
paymentmode.values- always
- if
_required
- Type: integerFormat: int64amount
Integer amount in minor units (e.g. cents) specific to the currency. Example: 100 for €1.00
- Type: stringenumbilling
_address _collection Specify whether Checkout should collect the customer's billing address. Defaults to
auto.values- auto
Checkout will only collect the billing address when necessary.
- required
Checkout will always collect the customer's billing address.
- application/json
- application/json
- application/json
- application/json
- application/json
curl https://api.paypercut.io/v1/checkouts \
--request POST \
--header 'Idempotency-Key: order:12345:pi:create' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"currency": "EUR",
"description": "",
"mode": "payment",
"ui_mode": "hosted",
"cancel_url": "",
"success_url": "",
"return_url": "",
"payment_method_types": [
""
],
"submit_type": "auto",
"wallet_options": {
"apple_pay": {
"display": "auto"
},
"google_pay": {
"display": "auto"
}
},
"client_reference_id": "",
"client_customer_id": "",
"expires_at": null,
"line_items": [
{
"quantity": 2,
"price_data": {
"active": true,
"billing_scheme": "per_unit",
"created": 1,
"currency": "",
"livemode": true,
"lookup_key": null,
"product": "01K755J9SV2364REVHB915Z2FW",
"product_data": {
"active": true,
"name": "",
"description": "",
"unit_label": "",
"id": ""
},
"recurring": {
"interval": "day",
"interval_count": 1,
"meter": null,
"usage_type": "licensed"
},
"type": "one_time",
"unit_amount": null,
"unit_amount_decimal": null,
"id": ""
},
"metadata": {
"additionalProperty": ""
}
}
],
"payment_intent_data": {
"amount": 100,
"capture_method": "automatic",
"on_behalf_of": "",
"statement_descriptor": null,
"setup_future_usage": "off_session",
"payment_method": "01K688H80Z3199KETHDJ4ZAFPS",
"customer": "01K755J9SV2364REVHB915Z2FW"
},
"saved_payment_method_options": {
"payment_method_save": "disabled"
},
"metadata": {
"additionalProperty": ""
},
"after_completion": {
"type": "redirect",
"redirect": {
"url": ""
},
"hosted": {
"custom_message": ""
}
},
"locale": "auto",
"customer": null,
"customer_email": null,
"customer_creation": "always",
"amount": 100,
"billing_address_collection": "auto"
}'
{
"id": "21210021c2855007efa2d657018",
"currency": {
"iso": "usd",
"scale": 2
},
"description": null,
"mode": "payment",
"ui_mode": "hosted",
"amount_total": 100,
"url": "https://www.example.com",
"cancel_url": null,
"success_url": null,
"return_url": null,
"payment_method_types": [
"string"
],
"submit_type": "auto",
"wallet_options": {
"apple_pay": {
"display": "auto"
},
"google_pay": {
"display": "auto"
}
},
"client_reference_id": null,
"client_customer_id": null,
"expires_at": null,
"line_items": [
{
"quantity": 2,
"price_data": {
"active": true,
"billing_scheme": "per_unit",
"created": 1,
"currency": "string",
"livemode": true,
"lookup_key": null,
"product": "01K755J9SV2364REVHB915Z2FW",
"product_data": {
"active": true,
"name": "string",
"description": "string",
"unit_label": "string",
"id": "string"
},
"recurring": {
"interval": "day",
"interval_count": 1,
"meter": null,
"usage_type": "licensed"
},
"type": "one_time",
"unit_amount": null,
"unit_amount_decimal": null,
"id": "string"
},
"metadata": {
"additionalProperty": "string"
}
}
],
"saved_payment_method_options": {
"payment_method_save": "disabled"
},
"metadata": {
"additionalProperty": "string"
},
"after_completion": {
"type": "redirect",
"redirect": {
"url": "https://example.com"
},
"hosted": {
"custom_message": "string"
}
},
"locale": null,
"customer": "01K755J9SV2364REVHB915Z2FW",
"customer_email": null,
"customer_creation": "always",
"payment_intent": "01K755J9SY55CS04SQ3JX1NX36",
"setup_intent": "01K755J9SY55CS04SQ3JX1NX36",
"payment_link": "01K755J9SV2364REVHB915Z2FW",
"payment_status": "no_payment_required",
"status": "complete",
"next_action": {
"redirect_to_url": {
"return_url": null,
"url": null
},
"type": "string",
"three_d_secure": {
"flow": "frictionless",
"status_url": "https://api.yourco.com/v1/payment_intents/pi_123",
"return_url": null,
"message": {
"allowed_origins": [
"https://merchant.example.com"
]
},
"hint": {
"scheme": "visa",
"version": "2.2.0"
},
"idempotency_key": "string"
}
},
"livemode": true,
"billing_address_collection": "auto"
}
