Checkout

A Checkout Session represents your customer's session as they pay for one-time purchases or subscriptions through Checkout. We recommend creating a new Session each time your customer attempts to pay.

You can create a Checkout Session on your server and pass its ID to the client to begin Checkout.

Related guide: Checkout Quickstart.

Checkout Session Object

Checkout Session Object
{
  "id": "cs_a1U7SSk86e6DUcjD9Zg7c26WqxP13PEG0pIt2TvAGPmyK9kDnD4kGR4tri",
  "object": "checkout.session",
  "amount_total": 10.99,
  "cancel_url": "https://example.com/cancel",
  "created": 1671995248,
  "expires_at": 1671995248,
  "status": "expired",
  "success_url": "https://example.com/success",
  "url": "https://fanspay.io/checkout/cs_a1U7SSk86e6DUcjD9Zg7c26WqxP13PEG0pIt2TvAGPmyK9kDnD4kGR4tri",
  "transaction_status": "unconfirmed",
  "type": "payment"
}

Attributes

AttributeTypeDescription

id

string

Unique identifier for the object.

object

string

String representing the object’s type. Objects of the same type share the same value.

amount_total

number

Total of all items after discounts and taxes are applied.

cancel_url

string

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.

created

number

Time at which the object was created. Measured in seconds since the Unix epoch.

expires_at

number

The time at which the Checkout Session will expire. Measured in seconds since the Unix epoch.

status

string

The status of the Checkout Session, one of open, completed or expired.

success_url

string

The URL the customer will be directed to after the payment or subscription creation is successful.

transaction_status

string

The transaction status of the Checkout Session is one of confirmed, or unconfirmed. You can use this value to decide when to fulfill your customer’s order.

type

string

The type of checkout session. payment, subscription or donation

url

string

The URL at which the user has to make the payment.

Create a Session

Last updated