Payments
- Transactions
- Buyers
- Checkout Sessions
- Payment links
- Payment options
- Payouts
- Refunds
- Sessions
- Settlement records
Instruments
- Card schemes
- Digital wallets
- Gift cards
- Payment methods
- Payment method definitions
Vault
- Account updater
- Network tokens
- Payment service tokens
- Vault Forward
- Vault Forward endpoints
- Vault Forward authentication
Connections
- All services
- Payment services
- Digital wallets
- Anti-fraud services
- Gift-card services
Dashboard
- Flow
- Merchant accounts
- Reports
- Report executions
Get checkout session
Gets details about a current Checkout Session.
curl --request GET \
--url https://api.{gr4vy_id}.gr4vy.app/checkout/sessions/{checkout_session_id} \
--header 'Authorization: Bearer <token>'
{
"type": "checkout-session",
"id": "8d3fe99b-1422-42e6-bbb3-932d95ae5f79",
"expires_at": "2022-01-01T00:00:00+00:00",
"cart_items": [
{
"name": "GoPro HERO9 Camcorder",
"quantity": 1,
"unit_amount": 37999,
"discount_amount": 0,
"tax_amount": 0,
"external_identifier": "item-789123",
"sku": "sku-789123",
"product_url": "https://example.com/items/gopro",
"image_url": "https://example.com/images/items/gopro.png",
"categories": [
"<string>"
],
"product_type": "physical"
}
],
"metadata": {
"key": "value"
},
"airline": {
"passenger_name_record": "JOHN L",
"booking_code": "X36Q9C",
"ticket_number": "123-1234-151555",
"ticket_delivery_method": "other",
"issued_at": "2013-07-16T19:23:00.000+00:00",
"issued_address": "123 Broadway, New York",
"travel_agency_code": "12345",
"travel_agency_name": "Agency name",
"travel_agency_invoice_number": "EG15555155",
"travel_agency_plan_name": "B733",
"restricted_ticket": false,
"issuing_carrier_code": "A3",
"reservation_system": "Amadeus",
"passengers": [
{
"title": "Mr.",
"first_name": "John",
"last_name": "Lunn",
"email_address": "john@example.com",
"phone_number": "+1234567890",
"passport_number": "7700225",
"ticket_number": "LH1236699999",
"frequent_flyer_number": "15885566",
"date_of_birth": "2013-07-16",
"age_group": "adult"
}
],
"legs": [
{
"carrier_code": "LY",
"flight_number": "BA98",
"departure_at": "2013-07-16T19:23:00.000+00:00",
"departure_country": "UK",
"departure_city": "London",
"departure_airport": "LHR",
"arrival_at": "2013-07-16T19:23:00.000+00:00",
"arrival_country": "UK",
"arrival_city": "London",
"arrival_airport": "LHR",
"fare_basis_code": "WH7LNR",
"flight_class": "E",
"stop_over": false,
"route_type": "round_trip",
"coupon_number": "15885566",
"fare_amount": 100,
"fee_amount": 100,
"tax_amount": 100,
"departure_tax_amount": 100
}
]
},
"payment_method": {
"type": "payment_method",
"id": "<string>",
"method": "card",
"scheme": "visa",
"label": "4242",
"details": {
"bin": "411111",
"card_type": "credit",
"card_country": "US",
"card_issuer_name": "Bank"
},
"fingerprint": "20eb353620155d2b5fc864cc46a73ea77cb92c725238650839da1813fa987a17"
}
}
This endpoint requires the checkout-sessions.read
scope.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
The unique ID for a Checkout Session.
"8724fd24-5489-4a5d-90fd-0604df7d3b83"
Response
A short-lived checkout session.
checkout-session
.
checkout-session
"checkout-session"
The ID of the Checkout Session.
"8d3fe99b-1422-42e6-bbb3-932d95ae5f79"
The date and time when the Checkout Session will expire. By default this will be set to 1 hour from the date of creation.
"2022-01-01T00:00:00+00:00"
An array of cart items that represents the line items of a transaction.
A cart item that represents a single cart line item for a transaction. Note that some optional properties are required for certain payment service providers. If no value is set for these properties, we will use their default value.
If the total due to be paid for the item is required by the payment service provider, generally referred to as the "total amount", the formula below will usually be used to calculate this amount:
(unit_amount * quantity) - discount_amount + tax_amount
It's highly recommended that the total amount to pay for all items should match the transaction's amount to reduce the risk of the transaction being declined by the payment service provider.
The name of the cart item. The value you set for this property may be truncated if the maximum length accepted by a payment service provider is less than 255 characters.
255
"GoPro HERO9 Camcorder"
The quantity of this item in the cart. This value cannot be negative or zero.
1 <= x <= 99999999
1
The amount for an individual item represented as a monetary amount
in the smallest currency unit for the given currency, for example
1299
USD cents represents $12.99
.
The amount sent through to the payment processor as unitary amount
will be calculated to include the discount and tax values sent
as part of this cart item.
0 <= x <= 99999999
37999
The amount discounted for this item represented as a monetary amount
in the smallest currency unit for the given currency, for example 1299
USD cents represents $12.99
.
Please note that this amount is for the total of the cart item and not for an individual item. For example, if the quantity is 5, this value should be the total discount amount for 5 of the cart item.
You might see unexpected failed transactions if the discount_amount
can
not be equally divided by the quantity
value. This is due to the fact
that some payment services require this amount to be specified per unit.
In this situation we recommend splitting this item into separate items, each with their own specific discount.
0 <= x <= 99999999
0
The tax amount for this item represented as a monetary amount
in the smallest currency unit for the given currency, for example 1299
USD cents represents $12.99
.
Please not that this amount is for the total of the cart item and not for an individual item. For example, if the quantity is 5, this value should be the total tax amount for 5 of the cart item.
You might see unexpected failed transactions if the tax_amount
can
not be equally divided by the quantity
value. This is due to the fact
that some payment services require this amount to be specified per unit.
In this situation we recommend splitting this item into separate items, each with their own specific tax amount.
0 <= x <= 99999999
0
An external identifier for the cart item. This can be set to any value and is not sent to the payment service.
200
"item-789123"
The SKU for the item.
200
"sku-789123"
The product URL for the item.
2083
"https://example.com/items/gopro"
The URL for the image of the item.
2083
"https://example.com/images/items/gopro.png"
A list of strings containing product categories for the item. Max length per item: 50.
The product type of the cart item.
physical
, discount
, shipping_fee
, sales_tax
, digital
, gift_card
, store_credit
, surcharge
"physical"
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.
{ "key": "value" }
Contains information about an airline travel, if applicable.
The Passenger Name Record (PNR) in the airline reservation system.
1 - 50
"JOHN L"
The unique identifier of the reservation in the global distribution system.
1 - 50
"X36Q9C"
The airline's unique ticket number.
1 - 50
"123-1234-151555"
The delivery method of the ticket.
electronic
, other
"other"
The date that the ticket was last issued in the airline reservation system.
"2013-07-16T19:23:00.000+00:00"
The address of the place/agency that issued the ticket.
1 - 255
"123 Broadway, New York"
The IATA travel agency code.
1 - 50
"12345"
The name of the travel agency.
1 - 200
"Agency name"
The reference number of the invoice that was issued by the travel agency.
1 - 50
"EG15555155"
The name of the travel agency plan.
1 - 200
"B733"
Indicates whether the ticket is restricted (refundable).
false
For airline aggregators, two-character IATA code of the airline issuing the ticket.
2
"A3"
The name of the reservation system.
1 - 200
"Amadeus"
An array of the travelling passengers.
Information of the travelling passenger.
Title of the passenger.
1 - 50
"Mr."
The first name(s) or given name of the passenger.
1 - 255
"John"
The last name, or family name, of the passenger.
1 - 255
"Lunn"
The email address of the passenger.
1 - 320
"john@example.com"
The phone number of the passenger. This number is formatted according to the E164 number standard.
1 - 50
"+1234567890"
The passenger's unique passport number.
1 - 50
"7700225"
The ticket number for a flight.
1 - 50
"LH1236699999"
The passenger's frequent flyer number.
5 - 50
"15885566"
The passenger's date of birth.
"2013-07-16"
adult
, infant
"adult"
An array of separate trip segments. Each leg contains detailed itinerary information.
Each of the separate trip segment, contains detailed itinerary information.
2 character airline code as set by IATA.
2
"LY"
Unique identifier of the flight number.
3 - 6
"BA98"
The date and time of travel in local time at the departure airport.
"2013-07-16T19:23:00.000+00:00"
Departure country code in ISO 3166 format.
2
"UK"
Departure city name.
1 - 100
"London"
Departure airport code of leg. 3-letter ISO code according to IATA official directory.
3
"LHR"
The date and time of travel in local time at the arrival airport.
"2013-07-16T19:23:00.000+00:00"
Arrival country code in ISO 3166 format.
2
"UK"
Arrival city name.
1 - 100
"London"
Arrival airport code of leg. 3-letter ISO code according to IATA official directory.
3
"LHR"
The alphanumeric code for the "booking class" of a ticket.
1 - 8
"WH7LNR"
Indicates service class (first class, business class, etc.).
1 - 5
"E"
Indicates whether a stopover is allowed on this ticket.
false
The route type of the flight.
round_trip
, one_way
"round_trip"
Coupon number associated with the leg.
1 - 50
"15885566"
Amount of the ticket, for current leg of the trip, excluding taxes and fees.
0 <= x <= 99999999
100
Fee amount for current leg of the trip.
0 <= x <= 99999999
100
Amount of the taxes for current leg of the trip.
0 <= x <= 99999999
100
Departure tax amount charged by a country when a person is leaving the country.
0 <= x <= 99999999
100
Details about the payment method for card type only.
"payment_method"
Unique ID for the payment method.
Payment method type.
card
"card"
The scheme/brand of the card.
accel
, amex
, bancontact
, carte-bancaire
, cirrus
, culiance
, dankort
, diners-club
, discover
, eftpos-australia
, elo
, hipercard
, jcb
, maestro
, mastercard
, mir
, nyce
, other
, pulse
, rupay
, star
, uatp
, unionpay
, visa
"visa"
Last four digits of PAN.
"4242"
First six digits of PAN.
"411111"
credit
, debit
, prepaid
"credit"
ISO 3166 two letter country code.
2
"US"
The name of the card issuer.
"Bank"
The unique hash derived from the payment method identifier (e.g. card number).
"20eb353620155d2b5fc864cc46a73ea77cb92c725238650839da1813fa987a17"
Was this page helpful?
curl --request GET \
--url https://api.{gr4vy_id}.gr4vy.app/checkout/sessions/{checkout_session_id} \
--header 'Authorization: Bearer <token>'
{
"type": "checkout-session",
"id": "8d3fe99b-1422-42e6-bbb3-932d95ae5f79",
"expires_at": "2022-01-01T00:00:00+00:00",
"cart_items": [
{
"name": "GoPro HERO9 Camcorder",
"quantity": 1,
"unit_amount": 37999,
"discount_amount": 0,
"tax_amount": 0,
"external_identifier": "item-789123",
"sku": "sku-789123",
"product_url": "https://example.com/items/gopro",
"image_url": "https://example.com/images/items/gopro.png",
"categories": [
"<string>"
],
"product_type": "physical"
}
],
"metadata": {
"key": "value"
},
"airline": {
"passenger_name_record": "JOHN L",
"booking_code": "X36Q9C",
"ticket_number": "123-1234-151555",
"ticket_delivery_method": "other",
"issued_at": "2013-07-16T19:23:00.000+00:00",
"issued_address": "123 Broadway, New York",
"travel_agency_code": "12345",
"travel_agency_name": "Agency name",
"travel_agency_invoice_number": "EG15555155",
"travel_agency_plan_name": "B733",
"restricted_ticket": false,
"issuing_carrier_code": "A3",
"reservation_system": "Amadeus",
"passengers": [
{
"title": "Mr.",
"first_name": "John",
"last_name": "Lunn",
"email_address": "john@example.com",
"phone_number": "+1234567890",
"passport_number": "7700225",
"ticket_number": "LH1236699999",
"frequent_flyer_number": "15885566",
"date_of_birth": "2013-07-16",
"age_group": "adult"
}
],
"legs": [
{
"carrier_code": "LY",
"flight_number": "BA98",
"departure_at": "2013-07-16T19:23:00.000+00:00",
"departure_country": "UK",
"departure_city": "London",
"departure_airport": "LHR",
"arrival_at": "2013-07-16T19:23:00.000+00:00",
"arrival_country": "UK",
"arrival_city": "London",
"arrival_airport": "LHR",
"fare_basis_code": "WH7LNR",
"flight_class": "E",
"stop_over": false,
"route_type": "round_trip",
"coupon_number": "15885566",
"fare_amount": 100,
"fee_amount": 100,
"tax_amount": 100,
"departure_tax_amount": 100
}
]
},
"payment_method": {
"type": "payment_method",
"id": "<string>",
"method": "card",
"scheme": "visa",
"label": "4242",
"details": {
"bin": "411111",
"card_type": "credit",
"card_country": "US",
"card_issuer_name": "Bank"
},
"fingerprint": "20eb353620155d2b5fc864cc46a73ea77cb92c725238650839da1813fa987a17"
}
}