Creates a Checkout Session — the server-side configuration for a single payment attempt.
The response carries two fields for collecting payment: clientSecret for embedding Custom Components on your own page, and url for redirecting the customer to a Shift4-hosted checkout page.
A Checkout Session is immutable: to change the line items, customer, or any other configuration, create a new one.
Integration Methods:
- Host Direct
See the Integration Methods and URLs Section sections of the Development Quick Start guide for details regarding each processing option.
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: $ % : ^ - ~ ` < > , ? “ ” ‘ ’ { } [ ] \ + =
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: $ % : ^ - ~ ` < > , ? “ ” ‘ ’ { } [ ] \ + =
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 request, using an authToken and clientGuid.
Customer associated with this checkout session. Either an existing customer (by id) or a new inline customer object. Mutually exclusive with checkoutSession.customerCreationPolicy.
{ "checkoutSession": { "action": "payment", "redirectUrl": "https://example.com/checkout/complete", "allowSavedCards": true, "locale": "en", "collectBillingAddress": true, "collectShippingAddress": true, "customFieldsTitle": "Additional information", "customFieldsTitleTranslations": { "property1": "string", "property2": "string" }, "customFields": [ { "key": "special_wishes", "label": "Special wishes", "value": "string", "optional": true } ], "staticFields": { "property1": "string", "property2": "string" }, "webhookUrl": "string", "capture": true, "vendorReference": "ref_123456789", "lineItems": [ { "product": { … }, "quantity": 1 } ], "currency": "USD", "customerCreationPolicy": "create" }, "customer": { "postalCode": "94043" }, "metadata": { "property1": "string", "property2": "string" } }
- Fixed Total
- Donation
{ "result": [ { "dateTime": "2024-05-21T09:18:23.283-07:00", "event": { "type": "checkout_session_created" }, "customer": { "id": "cust_oM1i4j7EsIY7W5vqqF76diGw", "emailAddress": "jordan.smith@example.com", "phoneNumber": "+12025550123", "phoneCountry": "US", "firstName": "Jordan", "middleName": "Riley", "lastName": "Smith", "addressLine1": "Evergreen Terrace 742", "postalCode": "94043", "addressCity": "Mountain View", "addressRegion": "CA", "addressCountry": "US" }, "paymentLink": { "id": "link_8kdskX8DZ8FR6W3acYPXiyAN" }, "checkoutSession": { "id": "chse_wMCUGVZgpf45fWHzKbYWMKmZ", "action": "payment", "clientSecret": "chcs_II2TvLWBrzFniRdjLpgo2zIflaTCzZ5BGPngPZEu0XasgwYRBCHEpyqE0tO9pYocvoOl8alO9w91CAeW0bl3nrTfO9JH4zFDt8pXB2eyoOpOBeuD3XuxPnGKOiTjor0D0vwRfdMR7moSj3K9yLDktQy6KcoZEa9SgP5DHiXg30L1X26EKy4XCxqBdeB4dcC4osPiXBwJqFfhKsKxG4RUD8I8CCeUfvbXnCVSokauaT0AUEk7pkF3TBgN3Q", "url": "https://pay.shift4.com/chse_wMCUGVZgpf45fWHzKbYWMKmZ", "status": "active", "redirectUrl": "https://example.com/checkout/complete", "allowSavedCards": true, "locale": "en", "lastOpened": "2024-05-21T09:18:23.283-07:00", "expiresAt": "2024-05-21T09:18:23.283-07:00", "collectBillingAddress": true, "collectShippingAddress": true, "customFieldsTitle": "Additional information", "customFieldsTitleTranslations": { … }, "customFields": [ … ], "staticFields": { … }, "capture": true, "vendorReference": "ref_123456789", "webhookUrl": "string", "lineItems": [ … ], "lastTransaction": { … }, "customerCreationPolicy": "create" }, "metadata": { "property1": "string", "property2": "string" } } ] }