# Retrieve Checkout Session

Retrieves a single Checkout Session by id.
The id is passed via the `CheckoutSessionId` request header. Returns the same envelope shape as Create and List — the current `status`, `lastOpened`/`expiresAt` timestamps, the latest event, and (once the customer has paid) `lastTransaction`.
**Integration Methods:**
- Host Direct

See the [Integration Methods](/guides/quickstart#integration-methods) and [URLs Section](/guides/quickstart#urls) sections of the Development Quick Start guide for details regarding each processing option.

Endpoint: GET /checkoutsessions/retrieve
Version: 1.7.68
Security: AccessToken

## Security:

  - `AccessToken` (unknown)
    apiKey in header AccessToken

## Header parameters:

  - `InterfaceVersion` (string, required)
    Refers to the version of the program or application that is sending requests to Shift4. The following special characters are not allowed:  $ % : ^ - ~ < > , ? “ ” ‘ ’ { } [ ] \ + =

  - `InterfaceName` (string, required)
    Refers to the name of the program or application that is sending requests to Shift4. This should be the name of the program that you purchased or created. The following special characters are not allowed:  $ % : ^ - ~ ` < > , ? “ ” ‘ ’ { } [ ] \ + =

  - `CompanyName` (string, required)
    Refers to the vendor or partner that designed and certified the interface. The information you use in this field should match what Shift4 has on file or what was agreed upon in your Integration Plan. The following special characters are not allowed:  $ % : ^ - ~ ` < > , ? “ ” ‘ ’ { } [ ] \ + =

  - `AccessToken` (string, required)
    A security credential used to authenticate API requests. An Access Token is the alias for the merchant account and interface being used.
Obtain one via an [Access Token Exchange](/apis/payments-platform-rest/openapi/credentials/accesstokenexchange) request, using an `authToken` and `clientGuid`.

  - `CheckoutSessionId` (string, required)
    Used for selecting checkout session by id

## Response 200:

  - `200` (unknown)
    Request was processed

## Response 200 fields (application/json):

  - `result` (array)
    A single-element list holding the Checkout Session.

  - `result.dateTime` (string)
    Timestamp of the most recent event for this checkout session
    Example: 2024-05-21T09:18:23.283-07:00

  - `result.event` (object)

  - `result.event.type` (string)
    Type of the event
    Enum: "payment_link_created", "payment_link_updated", "payment_link_sms_notification_sent", "payment_link_sms_notification_delivered", "payment_link_sms_notification_failed", "checkout_session_completed", "checkout_session_created", "checkout_session_expired"

  - `result.customer` (object)

  - `result.customer.id` (string)
    Unique identifier of the customer
    Example: cust_oM1i4j7EsIY7W5vqqF76diGw

  - `result.customer.emailAddress` (string)
    Customer email address
    Example: jordan.smith@example.com

  - `result.customer.phoneNumber` (string)
    Customer phone number in full international format (e.g. `+12025550123`). When the request supplied a local-format number alongside `phoneCountry`, the response normalizes it to international format here.
    Example: +12025550123

  - `result.customer.phoneCountry` (string)
    Two-letter ISO 3166-1 alpha-2 country code of the phone number (e.g. `US`, `GB`). Present whenever the request provided one.
    Enum: "AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "KH", "CM", "CA", "CV", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CG", "CD", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MK", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MP", "NO", "OM", "PK", "PW", "PS", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SZ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UM", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW"

  - `result.customer.firstName` (string)
    Customer first name
    Example: Jordan

  - `result.customer.middleName` (string)
    Customer middle name
    Example: Riley

  - `result.customer.lastName` (string)
    Customer last name
    Example: Smith

  - `result.customer.addressLine1` (string)
    Street address
    Example: Evergreen Terrace 742

  - `result.customer.postalCode` (string)
    Postal or ZIP code
    Example: 94043

  - `result.customer.addressCity` (string)
    City
    Example: Mountain View

  - `result.customer.addressRegion` (string)
    State, province or region
    Example: CA

  - `result.customer.addressCountry` (string)
    Two-letter ISO 3166-1 alpha-2 country code.
    Enum: "AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "KH", "CM", "CA", "CV", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CG", "CD", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MK", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MP", "NO", "OM", "PK", "PW", "PS", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SZ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UM", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW"

  - `result.paymentLink` (object)
    Reference to a payment link by its identifier

  - `result.paymentLink.id` (string)
    Identifier of the payment link
    Example: link_8kdskX8DZ8FR6W3acYPXiyAN

  - `result.checkoutSession` (object)
    Checkout session details

  - `result.checkoutSession.id` (string)
    Identifier of a Checkout Session
    Example: chse_wMCUGVZgpf45fWHzKbYWMKmZ

  - `result.checkoutSession.action` (string)
    Action a Checkout Session performs.
    Enum: "payment", "card_verification"

  - `result.checkoutSession.clientSecret` (string)
    Single-use token used to collect payment with Payment components on your own page — pass it to `shift4.createCheckout(clientSecret)` in the shift4.js library. Do not reuse across customers or checkout sessions.
    Example: chcs_II2TvLWBrzFniRdjLpgo2zIflaTCzZ5BGPngPZEu0XasgwYRBCHEpyqE0tO9pYocvoOl8alO9w91CAeW0bl3nrTfO9JH4zFDt8pXB2eyoOpOBeuD3XuxPnGKOiTjor0D0vwRfdMR7moSj3K9yLDktQy6KcoZEa9SgP5DHiXg30L1X26EKy4XCxqBdeB4dcC4osP…

  - `result.checkoutSession.url` (string)
    URL of the Hosted checkout page. Redirect the customer here if you do not want to embed Payment components on your own page.
    Example: https://pay.shift4.com/chse_wMCUGVZgpf45fWHzKbYWMKmZ

  - `result.checkoutSession.status` (string)
    Current status of the checkout session
    Enum: "active", "paid", "expired", "failed"

  - `result.checkoutSession.redirectUrl` (string)
    URL the customer is redirected to after completing payment on the Hosted checkout page.
    Example: https://example.com/checkout/complete

  - `result.checkoutSession.allowSavedCards` (boolean)
    If the value is true, saved cards may be used in this checkout session.

Default: false

  - `result.checkoutSession.locale` (string)
    Language used on payment page
    Example: en

  - `result.checkoutSession.lastOpened` (string)
    Timestamp the customer most recently opened the Hosted checkout page
    Example: 2024-05-21T09:18:23.283-07:00

  - `result.checkoutSession.expiresAt` (string)
    Timestamp at which the checkout session expires
    Example: 2024-05-21T09:18:23.283-07:00

  - `result.checkoutSession.collectBillingAddress` (boolean)
    If the value is true, the customer was asked to provide the billing address.

Default: false

  - `result.checkoutSession.collectShippingAddress` (boolean)
    If the value is true, the customer was asked to provide the shipping address.

Default: false

  - `result.checkoutSession.customFieldsTitle` (string)
    Title of custom fields section
    Example: Additional information

  - `result.checkoutSession.customFieldsTitleTranslations` (object)
    Translations of `customFieldsTitle` keyed by locale code

  - `result.checkoutSession.customFields` (array)
    List of custom fields that were collected from customer on the payment page

  - `result.checkoutSession.customFields.key` (string)
    Identifier of custom field
    Example: special_wishes

  - `result.checkoutSession.customFields.label` (string)
    Label of custom field
    Example: Special wishes

  - `result.checkoutSession.customFields.value` (string)
    The value that was provided by the customer for this custom field
    Example: Happy Holidays

  - `result.checkoutSession.customFields.optional` (boolean)
    If this flag is set to true, then customer was not required to provide any value for this custom field

  - `result.checkoutSession.staticFields` (object)
    List of information displayed on the payment page

  - `result.checkoutSession.capture` (boolean)
    If the value is true, the resulting charge is captured immediately.

Default: true

  - `result.checkoutSession.vendorReference` (string)
    Merchant Defined Descriptor related to the Checkout Session. This field is reportable on the merchant portal and settlement extract.
    Example: ref_123456789

  - `result.checkoutSession.webhookUrl` (string)
    Destination URL this checkout session's webhooks (`checkout_session_created`, `checkout_session_completed`, `checkout_session_expired`) are sent to.

  - `result.checkoutSession.lineItems` (array)
    List of line items

  - `result.checkoutSession.lineItems.product` (object)
    Product purchased in this line item

  - `result.checkoutSession.lineItems.product.name` (string)
    Display name of the product shown on the checkout page
    Example: Premium Plan

  - `result.checkoutSession.lineItems.product.description` (string)
    Description of the product or service

  - `result.checkoutSession.lineItems.product.amount` (any)
    Payment amount definition. Provide `total` for a fixed-amount product, or `options` and/or `custom` to let the customer choose the amount. `total` is mutually exclusive with `options` and `custom`; a customer-chosen amount product may use `options`, `custom`, or both together.

  - `result.checkoutSession.lineItems.product.amount.total` (number, required)
    Fixed payment amount (in major units, with the number of allowed decimal places depending on currency).
    Example: 10.99

  - `result.checkoutSession.lineItems.product.amount.options` (array)
    List of pre-defined selectable payment amounts. Allows the customer to choose how much to pay. May be combined with `custom`.
    Example: [10.99,24.55,49.99]

  - `result.checkoutSession.lineItems.product.amount.custom` (object)
    Allowed range for a customer-chosen payment amount

  - `result.checkoutSession.lineItems.product.amount.custom.min` (number)
    Minimum custom amount (major units)
    Example: 10.99

  - `result.checkoutSession.lineItems.product.amount.custom.max` (number)
    Maximum custom amount (major units)
    Example: 199.99

  - `result.checkoutSession.lineItems.product.currencyCode` (string)
    Three-letter ISO 4217 currency code
    Enum: "EUR", "USD", "AFN", "ALL", "DZD", "AOA", "ARS", "AMD", "AWG", "AZN", "BSD", "BHD", "BDT", "BBD", "BYN", "BYR", "BZD", "BMD", "BTN", "BOB", "BOV", "BAM", "BWP", "BRL", "BND", "BGN", "BIF", "KHR", "CAD", "CVE", "KYD", "CLF", "CLP", "CNY", "COP", "COU", "KMF", "CDF", "CRC", "HRK", "CUC", "CUP", "CZK", "DJF", "DOP", "EGP", "SVC", "ERN", "ETB", "FKP", "FJD", "XAF", "GMD", "GEL", "GHS", "GIP", "DKK", "GTQ", "GNF", "GYD", "HTG", "HNL", "HKD", "HUF", "ISK", "INR", "IDR", "IRR", "IQD", "ILS", "JMD", "JPY", "JOD", "KZT", "KES", "KPW", "KRW", "KWD", "KGS", "LAK", "LVL", "LBP", "LSL", "LRD", "LYD", "LTL", "MOP", "MKD", "MGA", "MWK", "MYR", "MVR", "MRO", "MUR", "MXN", "MXV", "MDL", "MNT", "MZN", "MMK", "NAD", "NPR", "NIO", "NGN", "OMR", "PKR", "PAB", "PGK", "PYG", "PEN", "PHP", "PLN", "QAR", "RON", "RUB", "RWF", "SHP", "XCD", "WST", "STD", "SAR", "RSD", "SCR", "SLL", "SGD", "ANG", "SBD", "SOS", "ZAR", "SSP", "LKR", "SDG", "SRD", "NOK", "SZL", "SEK", "CHE", "CHF", "CHW", "SYP", "TWD", "TJS", "TZS", "THB", "XOF", "NZD", "TOP", "TTD", "TND", "TRY", "TMT", "AUD", "UGX", "UAH", "AED", "GBP", "USN", "USS", "UYI", "UYU", "UZS", "VUV", "VEF", "VND", "XPF", "MAD", "YER", "ZMK", "ZMW", "ZWL", "SLE", "STN", "MRU", "VES"

  - `result.checkoutSession.lineItems.quantity` (integer)
    Number of units of the product
    Example: 1

  - `result.checkoutSession.lastTransaction` (object)
    Contains the API response from the last transaction processed. See the [Sale Response Body](/apis/payments-platform-rest/openapi/transactions/transactionssale#transactions/transactionssale/response&c=200) for the full response structure.

  - `result.checkoutSession.customerCreationPolicy` (string)
    Customer creation policy applied to this checkout session
    Enum: "create", "do_not_create"

  - `result.metadata` (object)
    Key-value object containing additional custom data supplied when the checkout session was created. This is never displayed to customer on the payment page.

## Response 400:

  - `400` (unknown)
    Error

## Response 400 fields (application/json):

  - `result` (array)

  - `result.error` (object)

  - `result.error.code` (integer)
    Code indicating the type of error that occurred. Refer to the [Error Codes](/guides/appendices/error-codes) section of this document for more details.
**Note: This is currently only supported for European merchant processing.**
    Example: 64100

  - `result.error.severity` (string)
    Severity level of the error.
| Severity | Description |
|  --- | --- |
| Info | Action not required - Data input/formatting is incorrect |
| Error | Action may be required - Communication, timeout or network issue |
| Alert | Action required - System issue |
    Enum: "Info", "Error", "Alert"

  - `result.error.shortText` (string)
    Abbreviated error message that is always returned if an error condition exists
    Example: NOT IN CARDRANGE

  - `result.error.longText` (string)
    Extended error message that is returned if an error condition exists.
    Example: Card type not recognized

  - `result.error.primaryCode` (integer)
    Code indicating the type of error that occurred. Refer to the [Error Codes](/guides/appendices/error-codes) section of this document for more details.
    Example: 9842

  - `result.error.secondaryCode` (integer)
    This code supplements the code specified in the `error.primaryCode` field to provide additional information about the error that occurred.
    Example: 0

## Response 504:

  - `504` (unknown)
    Timeout

## Response 504 fields (application/json):

  - `result` (array)

  - `result.error` (object)

  - `result.error.code` (integer)
    Code indicating the type of error that occurred. Refer to the [Error Codes](/guides/appendices/error-codes) section of this document for more details.
**Note: This is currently only supported for European merchant processing.**
    Example: 64100

  - `result.error.severity` (string)
    Severity level of the error.
| Severity | Description |
|  --- | --- |
| Info | Action not required - Data input/formatting is incorrect |
| Error | Action may be required - Communication, timeout or network issue |
| Alert | Action required - System issue |
    Enum: "Info", "Error", "Alert"

  - `result.error.shortText` (string)
    Abbreviated error message that is always returned if an error condition exists
    Example: NOT IN CARDRANGE

  - `result.error.longText` (string)
    Extended error message that is returned if an error condition exists.
    Example: Card type not recognized

  - `result.error.primaryCode` (integer)
    Code indicating the type of error that occurred. Refer to the [Error Codes](/guides/appendices/error-codes) section of this document for more details.
    Example: 9842

  - `result.error.secondaryCode` (integer)
    This code supplements the code specified in the `error.primaryCode` field to provide additional information about the error that occurred.
    Example: 0

