Skip to main content
Payment Sessions are a way to accept one-time payments from your customers. You can create a Payment Session for a specific amount and currency, and share the Payment Session URL with your customers. Your customers can then pay using their preferred payment method.

Create a customer

Before creating a Payment Session, you need a customer to associate the payment with. You can either use an existing customer or create a new one using the Customers API.
Create a customer
If the request completed successfully, the response contains the customer object.
Customer object

Create a Payment Session

To create a Payment Session, you need to specify the amount, currency, customer, mode, and payment_method_types. You can optionally include a return_url to redirect customers after the payment is completed.
Create a Payment Session
If the request completed successfully, the Payment Session object contains the url parameter.
Payment Session object

Supported payment method types

You can accept payments using the following payment method types:

Share the Payment Session URL

After creating a Payment Session, share the url with your customer. They will be guided through a secure flow to complete the payment. Once complete, they will be redirected to your return_url. You can also set send_email to true to automatically send the URL to the customer’s email address.
Send email to customer

Optional parameters

Reporting type

Use the reporting_type parameter to categorize the payment for reporting purposes. Defaults to charge.
Payment Session with reporting type

Transaction data

Use the transaction_data parameter to configure how the resulting transaction should be processed, including transfer behavior and customer balance options.
Payment Session with transaction data

Retrieve a Payment Session

You can retrieve a Payment Session to check its status and see the associated transaction.
Retrieve a Payment Session
Once the customer completes the payment, the status field will change to paid and the transaction field will contain the ID of the created transaction.
Completed Payment Session

Cancel a Payment Session

You can cancel a Payment Session if it is no longer needed.
Cancel a Payment Session