using Gr4vy;
using Gr4vy.Models.Components;
var sdk = new Gr4vySDK(
id: "example",
server: SDKConfig.Server.Sandbox,
bearerAuthSource: Auth.WithToken(privateKey),
merchantAccountId: "default"
);
var res = await sdk.CheckoutSessions.GetAsync(sessionId: "4137b1cf-39ac-42a8-bad6-1c680d5dab6b");
// handle response{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expires_at": "2023-11-07T05:31:56Z",
"cart_items": [
{
"name": "<string>",
"quantity": 123,
"unit_amount": 49999999,
"discount_amount": 0,
"tax_amount": 0,
"external_identifier": "goprohd",
"sku": "GPHD1078",
"upc": "012345678905",
"product_url": "https://example.com/catalog/go-pro-hd",
"image_url": "https://example.com/images/go-pro-hd.jpg",
"categories": [
"camera",
"travel",
"gear"
],
"product_type": "physical",
"seller_country": "US",
"tax_exempt": false,
"unit_of_measure": "feet",
"commodity_code": "43211503",
"description": "A brief description of an interesting item.",
"duty_amount": 1299,
"shipping_amount": 1299
}
],
"metadata": {
"cohort": "cohort-a",
"order_id": "order-12345"
},
"buyer": {
"display_name": "John Doe",
"external_identifier": "buyer-12345",
"billing_details": {
"first_name": "John",
"last_name": "Doe",
"email_address": "[email protected]",
"phone_number": "+1234567890",
"address": {
"city": "San Jose",
"country": "US",
"postal_code": "94560",
"state": "California",
"state_code": "US-CA",
"house_number_or_name": "10",
"line1": "Stafford Appartments",
"line2": "29th Street",
"organization": "Gr4vy"
},
"tax_id": {
"value": "<string>",
"kind": "ae.trn"
}
},
"account_number": "<string>",
"shipping_details": {
"first_name": "John",
"last_name": "Doe",
"email_address": "[email protected]",
"phone_number": "+1234567890",
"address": {
"city": "San Jose",
"country": "US",
"postal_code": "94560",
"state": "California",
"state_code": "US-CA",
"house_number_or_name": "10",
"line1": "Stafford Appartments",
"line2": "29th Street",
"organization": "Gr4vy"
}
}
},
"airline": {
"booking_code": "X36Q9C",
"is_cardholder_traveling": true,
"issued_address": "123 Broadway, New York",
"issued_at": "2013-07-16T19:23:00.000+00:00",
"issuing_carrier_code": "649",
"issuing_carrier_name": "Air Transat A.T. Inc",
"issuing_iata_designator": "TS",
"issuing_icao_code": "TSC",
"legs": [
{
"arrival_airport": "LAX",
"arrival_at": "2013-07-16T19:23:00.000+00:00",
"arrival_city": "Los Angeles",
"arrival_country": "US",
"carrier_code": "649",
"carrier_name": "Air Transat A.T. Inc",
"iata_designator": "TS",
"icao_code": "TSC",
"coupon_number": "15885566",
"departure_airport": "LHR",
"departure_at": "2013-07-16T19:23:00.000+00:00",
"departure_city": "London",
"departure_country": "GB",
"departure_tax_amount": 1200,
"fare_amount": 129900,
"fare_basis_code": "FY",
"fee_amount": 1200,
"flight_class": "E",
"flight_number": "101",
"route_type": "round_trip",
"seat_class": "F",
"stop_over": false,
"tax_amount": 1200
}
],
"passenger_name_record": "JOHN L",
"passengers": [
{
"age_group": "adult",
"date_of_birth": "2013-07-16",
"email_address": "[email protected]",
"first_name": "John",
"frequent_flyer_number": "15885566",
"last_name": "Luhn",
"passport_number": "11117700225",
"phone_number": "+1234567890",
"ticket_number": "BA1236699999",
"title": "Mr.",
"country_code": "US"
}
],
"reservation_system": "Amadeus",
"restricted_ticket": false,
"ticket_delivery_method": "electronic",
"ticket_number": "123-1234-151555",
"travel_agency_code": "12345",
"travel_agency_invoice_number": "EG15555155",
"travel_agency_name": "ACME Agency",
"travel_agency_plan_name": "B733"
},
"type": "checkout-session",
"payment_method": {
"type": "payment-method",
"id": "ef9496d8-53a5-4aad-8ca2-00eb68334389",
"details": {
"bin": "411111",
"card_country": "US",
"card_type": "credit",
"card_issuer_name": "Bank of America NA"
},
"label": "1234",
"method": "card",
"scheme": "visa",
"fingerprint": "a50b85c200ee0795d6fd33a5c66f37a4564f554355c5b46a756aac485dd168a4"
}
}Retrieve the information stored on a checkout session.
using Gr4vy;
using Gr4vy.Models.Components;
var sdk = new Gr4vySDK(
id: "example",
server: SDKConfig.Server.Sandbox,
bearerAuthSource: Auth.WithToken(privateKey),
merchantAccountId: "default"
);
var res = await sdk.CheckoutSessions.GetAsync(sessionId: "4137b1cf-39ac-42a8-bad6-1c680d5dab6b");
// handle response{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expires_at": "2023-11-07T05:31:56Z",
"cart_items": [
{
"name": "<string>",
"quantity": 123,
"unit_amount": 49999999,
"discount_amount": 0,
"tax_amount": 0,
"external_identifier": "goprohd",
"sku": "GPHD1078",
"upc": "012345678905",
"product_url": "https://example.com/catalog/go-pro-hd",
"image_url": "https://example.com/images/go-pro-hd.jpg",
"categories": [
"camera",
"travel",
"gear"
],
"product_type": "physical",
"seller_country": "US",
"tax_exempt": false,
"unit_of_measure": "feet",
"commodity_code": "43211503",
"description": "A brief description of an interesting item.",
"duty_amount": 1299,
"shipping_amount": 1299
}
],
"metadata": {
"cohort": "cohort-a",
"order_id": "order-12345"
},
"buyer": {
"display_name": "John Doe",
"external_identifier": "buyer-12345",
"billing_details": {
"first_name": "John",
"last_name": "Doe",
"email_address": "[email protected]",
"phone_number": "+1234567890",
"address": {
"city": "San Jose",
"country": "US",
"postal_code": "94560",
"state": "California",
"state_code": "US-CA",
"house_number_or_name": "10",
"line1": "Stafford Appartments",
"line2": "29th Street",
"organization": "Gr4vy"
},
"tax_id": {
"value": "<string>",
"kind": "ae.trn"
}
},
"account_number": "<string>",
"shipping_details": {
"first_name": "John",
"last_name": "Doe",
"email_address": "[email protected]",
"phone_number": "+1234567890",
"address": {
"city": "San Jose",
"country": "US",
"postal_code": "94560",
"state": "California",
"state_code": "US-CA",
"house_number_or_name": "10",
"line1": "Stafford Appartments",
"line2": "29th Street",
"organization": "Gr4vy"
}
}
},
"airline": {
"booking_code": "X36Q9C",
"is_cardholder_traveling": true,
"issued_address": "123 Broadway, New York",
"issued_at": "2013-07-16T19:23:00.000+00:00",
"issuing_carrier_code": "649",
"issuing_carrier_name": "Air Transat A.T. Inc",
"issuing_iata_designator": "TS",
"issuing_icao_code": "TSC",
"legs": [
{
"arrival_airport": "LAX",
"arrival_at": "2013-07-16T19:23:00.000+00:00",
"arrival_city": "Los Angeles",
"arrival_country": "US",
"carrier_code": "649",
"carrier_name": "Air Transat A.T. Inc",
"iata_designator": "TS",
"icao_code": "TSC",
"coupon_number": "15885566",
"departure_airport": "LHR",
"departure_at": "2013-07-16T19:23:00.000+00:00",
"departure_city": "London",
"departure_country": "GB",
"departure_tax_amount": 1200,
"fare_amount": 129900,
"fare_basis_code": "FY",
"fee_amount": 1200,
"flight_class": "E",
"flight_number": "101",
"route_type": "round_trip",
"seat_class": "F",
"stop_over": false,
"tax_amount": 1200
}
],
"passenger_name_record": "JOHN L",
"passengers": [
{
"age_group": "adult",
"date_of_birth": "2013-07-16",
"email_address": "[email protected]",
"first_name": "John",
"frequent_flyer_number": "15885566",
"last_name": "Luhn",
"passport_number": "11117700225",
"phone_number": "+1234567890",
"ticket_number": "BA1236699999",
"title": "Mr.",
"country_code": "US"
}
],
"reservation_system": "Amadeus",
"restricted_ticket": false,
"ticket_delivery_method": "electronic",
"ticket_number": "123-1234-151555",
"travel_agency_code": "12345",
"travel_agency_invoice_number": "EG15555155",
"travel_agency_name": "ACME Agency",
"travel_agency_plan_name": "B733"
},
"type": "checkout-session",
"payment_method": {
"type": "payment-method",
"id": "ef9496d8-53a5-4aad-8ca2-00eb68334389",
"details": {
"bin": "411111",
"card_country": "US",
"card_type": "credit",
"card_issuer_name": "Bank of America NA"
},
"label": "1234",
"method": "card",
"scheme": "visa",
"fingerprint": "a50b85c200ee0795d6fd33a5c66f37a4564f554355c5b46a756aac485dd168a4"
}
}checkout-sessions.read scope.Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The ID of the merchant account to use for this request.
"default"
The ID of the checkout session.
"4137b1cf-39ac-42a8-bad6-1c680d5dab6b"
Successful Response
The ID for the checkout session.
"4137b1cf-39ac-42a8-bad6-1c680d5dab6b"
The date and time when this checkout session expires.
"2013-07-16T19:23:00.000+00:00"
An array of cart items that represents the line items of a transaction.
Show child attributes
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.
Show child attributes
{
"cohort": "cohort-a",
"order_id": "order-12345"
}Provide buyer details for the transaction. No buyer resource will be created on Gr4vy when used.
Show child attributes
The airline addendum data which describes the airline booking associated with this transaction.
Show child attributes
Always checkout-session
"checkout-session""checkout-session"
Information about the payment method stored on the checkout session.
Show child attributes
Was this page helpful?