If you don't want to embed anything on your own page, hand the payment step off to Shift4: redirect the customer to the Checkout Session's hosted url. This needs no client-side code — no script, no public key. Shift4 renders and hosts the payment experience; you create the Checkout Session and decide when to send the customer to it.
Set redirectUrl when you create the Checkout Session to send the customer to a specific page after payment — useful when different flows need different landing pages.
If you omit it, Shift4 uses the account-wide return URL from Settings → Payment Links in the Customer Hub. If most of your payments should land on the same page, set it once there and leave redirectUrl out of your requests.
{
"checkoutSession": {
"lineItems": [ /* … */ ],
"redirectUrl": "https://yourapp.example.com/after-payment"
}
}Redirect the customer's browser to the response's checkoutSession.url (https://pay.shift4.com/chse_…). They enter payment details on pay.shift4.com, and after payment Shift4 redirects them back to your redirectUrl with two query parameters appended:
https://yourapp.example.com/after-payment?status=success&checkout_session_id=chse_wMCUGVZgpf45fWHzKbYWMKmZRead checkout_session_id to identify which Checkout Session completed, then confirm it server-side.
There is nothing to build. The Shift4-hosted page renders the Apple Pay and Google Pay buttons for you, on devices and browsers that support them. The only thing to do is turn the wallets on for your hosted checkout:
- Open Settings → Payment Links in the Customer Hub.
- Under Options, turn on Allow Payments With Digital Wallets.
- Select the Apple Pay and Google Pay checkboxes as needed.
- Click Save.
The screen is currently labelled Payment Links, but the setting covers your whole Shift4-hosted checkout — both your payment links and Hosted checkout. It does not affect Payment components, where the wallet buttons are rendered by your own page.
The buttons only render if your business is eligible to accept the wallet. Apple and Google each restrict certain business categories — if your merchant category code (MCC) falls under the Apple Pay Acceptable Use Guidelines or the Google Pay Acceptable Use Policy, that wallet is suppressed and no button is shown. If your business is permitted under both policies and the buttons are still missing, contact Shift4 support.
The status=success redirect parameter is a convenience signal, not proof of payment — the customer may never return to your site, or the parameter may be tampered with. Retrieve the Checkout Session server-side and check status: "paid" before fulfilling. See Confirm the payment.