A Checkout Session represents your customer's session as they pay for one-time purchases 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 redirect to its URL to begin Checkout.
Related guide: Accept a payment
Creates a Checkout Session object.
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. | ||||
expires_at | integer The Epoch time in seconds at which the Checkout Session will expire. It can be anywhere from 30 minutes to 24 hours after Checkout Session creation. By default, this value is 24 hours from creation | ||||
required | Array of objects (LineItemCreate) A list of items the customer is purchasing. | ||||
Array
| |||||
return_url required | string The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method’s app or site. | ||||
success_url required | string The URL to which Qashier should send customers when payment or setup is complete |
{- "cancel_url": "string",
- "expires_at": 0,
- "line_items": [
- {
- "price_data": {
- "currency": "string",
- "product_data": {
- "name": "string",
- "description": "string"
}, - "unit_amount": 0
}, - "quantity": 0
}
], - "return_url": "string",
- "success_url": "string"
}
{- "id": "string",
- "currency": "string",
- "line_items": {
- "object": "list",
- "data": [
- {
- "amount_total": 0,
- "currency": "string",
- "description": "string",
- "quantity": 0
}
]
}, - "object": "checkout.session",
- "amount_total": 0,
- "created": 0,
- "expires_at": 0,
- "mode": "payment",
- "payment_status": "paid",
- "status": "open",
- "return_url": "string",
- "success_url": "string",
- "url": "string"
}
Returns a list of Checkout Sessions.
A dictionary with a data property that contains an array of up to limit Checkout Sessions, starting after Checkout Session starting_after. Each entry in the array is a separate Checkout Session object. If no more Checkout Sessions are available, the resulting array will be empty.
object Only return Checkout Sessions created during the given date interval | |
ending_before | string A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list. |
limit | integer [ 1 .. 100 ] Default: 10 A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. |
starting_after | string A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list. |
status | string Enum: "open" "complete" "expired" Only return the Checkout Sessions matching the given status. Possible values:
|
{- "object": "list",
- "data": [
- {
- "id": "string",
- "currency": "string",
- "line_items": {
- "object": "list",
- "data": [
- {
- "amount_total": 0,
- "currency": "string",
- "description": "string",
- "quantity": 0
}
]
}, - "object": "checkout.session",
- "amount_total": 0,
- "created": 0,
- "expires_at": 0,
- "mode": "payment",
- "payment_status": "paid",
- "status": "open",
- "return_url": "string",
- "success_url": "string",
- "url": "string"
}
], - "has_more": true,
- "url": "/checkout/sessions"
}
Retrieves a Checkout Session object.
id required | string The ID of the Checkout Session to retrieve |
{- "id": "string",
- "currency": "string",
- "line_items": {
- "object": "list",
- "data": [
- {
- "amount_total": 0,
- "currency": "string",
- "description": "string",
- "quantity": 0
}
]
}, - "object": "checkout.session",
- "amount_total": 0,
- "created": 0,
- "expires_at": 0,
- "mode": "payment",
- "payment_status": "paid",
- "status": "open",
- "return_url": "string",
- "success_url": "string",
- "url": "string"
}
A Checkout Session can be expired when it is in one of these statuses: open
After it expires, a customer can't complete a Checkout Session and customers loading the Checkout Session see a message saying the Checkout Session is expired.
Returns a Checkout Session object if the expiration succeeded. Returns an error if the Checkout Session has already expired or isn't in an expireable state.
id required | string The ID of the Checkout Session to expire |
{- "id": "string",
- "currency": "string",
- "line_items": {
- "object": "list",
- "data": [
- {
- "amount_total": 0,
- "currency": "string",
- "description": "string",
- "quantity": 0
}
]
}, - "object": "checkout.session",
- "amount_total": 0,
- "created": 0,
- "expires_at": 0,
- "mode": "payment",
- "payment_status": "paid",
- "status": "open",
- "return_url": "string",
- "success_url": "string",
- "url": "string"
}
Occurs when a Checkout Session has been updated
id | string Unique identifier for the event | ||||||||||||||||||||||||||||||
api_version | string The Qashier API version used to render data when the event was created. "1.0.0" is the latest version. | ||||||||||||||||||||||||||||||
object | |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
type | string Enum: "checkout.session.completed" "checkout.session.expired"
| ||||||||||||||||||||||||||||||
account | string The ID of the account that this event belongs to | ||||||||||||||||||||||||||||||
created | integer Time at which the object was created. Measured in seconds since the Unix epoch. | ||||||||||||||||||||||||||||||
object | |||||||||||||||||||||||||||||||
|
{- "id": "evt_1234567890",
- "api_version": "string",
- "request": {
- "id": "string",
- "idempotency_key": "string"
}, - "type": "checkout.session.completed",
- "account": "string",
- "created": 0,
- "data": {
- "object": {
- "id": "string",
- "currency": "string",
- "line_items": {
- "object": "list",
- "data": [
- {
- "amount_total": 0,
- "currency": "string",
- "description": "string",
- "quantity": 0
}
]
}, - "object": "checkout.session",
- "amount_total": 0,
- "created": 0,
- "expires_at": 0,
- "mode": "payment",
- "payment_status": "paid",
- "status": "open",
- "return_url": "string",
- "success_url": "string",
- "url": "string"
}
}
}
id | string Unique identifier for the object | ||||
currency | string Three-letter ISO currency code | ||||
object | |||||
| |||||
object | string Value: "checkout.session" String representing the object's type | ||||
amount_total | integer Total of all items after discounts and taxes are applied | ||||
created | integer Time at which the object was created | ||||
expires_at | integer The Epoch time at which the Checkout Session will expire | ||||
mode | string Value: "payment" The mode of the Checkout Session | ||||
payment_status | string Enum: "paid" "unpaid" "no_payment_required" The payment status of the Checkout Session | ||||
status | string Enum: "open" "complete" "expired" The status of the Checkout Session | ||||
return_url | string URL to redirect customer back to after authentication | ||||
success_url | string URL customers will be directed to after successful payment | ||||
url | string The URL to the Checkout Session |
{- "id": "string",
- "currency": "string",
- "line_items": {
- "object": "list",
- "data": [
- {
- "amount_total": 0,
- "currency": "string",
- "description": "string",
- "quantity": 0
}
]
}, - "object": "checkout.session",
- "amount_total": 0,
- "created": 0,
- "expires_at": 0,
- "mode": "payment",
- "payment_status": "paid",
- "status": "open",
- "return_url": "string",
- "success_url": "string",
- "url": "string"
}
amount_total | integer Total after discounts and taxes |
currency | string Three-letter ISO currency code. Only |
description | string An arbitrary string attached to the object. Often useful for displaying to users. Defaults to product name. |
quantity | integer The quantity of products being purchased |
{- "amount_total": 0,
- "currency": "string",
- "description": "string",
- "quantity": 0
}