Skip to main content
POST
C#
This endpoint requires the checkout-sessions.write scope.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-gr4vy-merchant-account-id
string | null

The ID of the merchant account to use for this request.

Example:

"default"

Body

application/json
cart_items
CartItem · object[] | null

An array of cart items that represents the line items of a transaction.

metadata
Metadata · object | null

Any additional information about the transaction that you would like to store as key-value pairs. This data is passed to payment service providers that support it.

Example:
buyer
GuestBuyer · object | null

Provide buyer details for the transaction. No buyer resource will be created on Gr4vy when used.

airline
Airline · object | null

The airline addendum data which describes the airline booking associated with this transaction.

expires_in
number
default:3600

The time in seconds when this checkout session expires.

Required range: 3600 <= x <= 86400

Response

Successful Response

id
string<uuid>
required

The ID for the checkout session.

Example:

"4137b1cf-39ac-42a8-bad6-1c680d5dab6b"

expires_at
string<date-time>
required

The date and time when this checkout session expires.

Example:

"2013-07-16T19:23:00.000+00:00"

cart_items
CartItem · object[] | null

An array of cart items that represents the line items of a transaction.

metadata
Metadata · object | null

Any additional information about the transaction that you would like to store as key-value pairs. This data is passed to payment service providers that support it.

Example:
buyer
GuestBuyer · object | null

Provide buyer details for the transaction. No buyer resource will be created on Gr4vy when used.

airline
Airline · object | null

The airline addendum data which describes the airline booking associated with this transaction.

type
string
default:checkout-session

Always checkout-session

Allowed value: "checkout-session"
Example:

"checkout-session"

payment_method
CheckoutSessionPaymentMethod · object | null

Information about the payment method stored on the checkout session.