Create a Checkout Session
Creates a Checkout Session for a customer payment attempt or subscription signup. Create a new session each time a customer starts checkout, then redirect the customer to the returned checkout URL or render the session with the Paypercut checkout SDK.
Use Checkout Sessions when Paypercut should host or embed the payment page, collect the customer's payment details, and create the underlying Payment Intent, Setup Intent, or Subscription for the flow.
You can also create checkout sessions from the Merchant Dashboard when you want to test a hosted checkout flow without automating session creation.
Related guides: Checkout Experience and Checkout Sessions API
- 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.
- Type: object ·currencyrequired
Three-letter ISO currency code
- Type: stringdescription
A free-form reference to describe the checkout
- Type: string enummoderequired
The mode of the Checkout Session.
values- payment
Standard one-time payment.
- setup
Set up a payment method for future use.
- subscription
Create a subscription checkout that collects the first payment and stores a reusable payment method for renewal billing.
- Type: string enumui
_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 | null enumsubmit
_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 | null Format: 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. In
subscriptionmode, use recurring Price-backed line items for subscription plans. - Type: array object[] · …5shipping
_options Shipping options offered for this Checkout Session. Provide one to five inline
shipping_rate_dataoptions when the customer should choose a shipping rate during checkout.A shipping option offered for a Checkout Session.
- Type: object · nullablepayment
_intent _data Create-time PaymentIntent options accepted when creating a Checkout Session.
- Type: object ·saved
_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: object ·after
_completion After completion behavior for the Checkout Session.
- Type: string enumlocale
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: string enumcustomer
_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: integer · Format: int64amount
Integer amount in minor units (e.g. cents) specific to the currency. Example: 100 for €1.00
- Type: string · enumbilling
_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 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"mode": "payment",
"ui_mode": "hosted",
"currency": "EUR",
"line_items": [
{
"price": "01HD7M6DRKZ4Q4QEVWJB0RC1S6",
"quantity": 1
}
],
"success_url": "https://example.com/success",
"cancel_url": "https://example.com/cancel",
"payment_intent_data": {
"metadata": {
"order_id": "order_1042"
}
},
"metadata": {
"cart_id": "cart_987"
}
}'
{
"id": "21210021c2855007efa2d657018",
"currency": {
"iso": "usd",
"scale": 2
},
"description": null,
"mode": "payment",
"ui_mode": "hosted",
"amount_total": 100,
"amount_subtotal": 100,
"total_details": {
"amount_discount": 100,
"amount_shipping": 100,
"amount_tax": 100
},
"shipping_options": [
{
"shipping_rate": {
"id": "shr_standard",
"display_name": "Standard shipping",
"type": "fixed_amount",
"fixed_amount": {
"amount": 100,
"currency": "EUR"
},
"delivery_estimate": {
"minimum": {
"unit": "business_day",
"value": 3
},
"maximum": {
"unit": "business_day",
"value": 3
}
},
"tax_behavior": "unspecified",
"tax_code": null,
"metadata": {
"additionalProperty": "string"
},
"active": true
}
}
],
"shipping_cost": {
"shipping_rate": "shr_standard",
"amount_subtotal": 100,
"amount_tax": 100,
"amount_total": 100,
"currency": {
"iso": "usd",
"scale": 2
}
},
"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": "01K755J9SV2364REVHB915Z2FW",
"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": "daily",
"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",
"subscription": "01HD7M6DRKZ4Q4QEVWJB0RC1S6",
"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"
}
