Skip to content

Common scenarios

Each scenario below starts with the integration choice — Hosted checkout or Payment components — and lists the Checkout Session options that make it work. The full field documentation and payloads live on the pages linked from each scenario.

E-commerce on your own site

This is for you if

You have a product or cart page and want the customer to pay there, on your domain, in your layout.

The card fields and wallet buttons render inside your page, so you keep the customer through the whole flow while Shift4 secures the card data.

Set it up

Fastest path to a payment

This is for you if

You want to accept a payment from your backend with no frontend work at all.

No script, no public key — redirect the customer to the Checkout Session's url and let pay.shift4.com do the rest.

Set it up

  • Create a Checkout Session with your line items and a redirectUrl back to your site — see Hosted checkout.
  • Set webhookUrl so completion reaches your backend even if the customer never returns — see Webhooks.
  • If you don't even want to handle the redirect yourself, consider a Payment Link instead — a shareable URL wrapping the same hosted checkout.

Customer-chosen amounts

This is for you if

The customer decides what to pay — pay-what-you-want pricing, a tip, or a donation.

Customer-chosen amounts are collected on the hosted checkout page and aren't supported by Payment components yet, so this scenario uses Hosted checkout.

Set it up

Save a card without charging

This is for you if

You want a validated card on file — for a later charge, a subscription-like flow, or to vet a payment method before fulfilment.

A card-verification Checkout Session runs a $0 authorization instead of a charge.

Set it up

  • Create the Checkout Session with action: "card_verification", a top-level currency, allowSavedCards: true, and a defined customer; no lineItems — see Card-verification Checkout Sessions.
  • Confirm as usual: the Checkout Session reports the verification outcome and the card token for later use.

Auth now, capture on fulfilment

This is for you if

Deposits, pre-orders, delayed shipping — you want to reserve the funds now and take them when you deliver.

Authorization behaviour is a property of the Checkout Session.

Set it up

  • Create the Checkout Session with capture: false — the resulting charge is authorized but not captured; see Other options.
  • After payment, retrieve the Checkout Session and store lastTransaction.transaction.invoice and the card token.
  • Capture when you fulfil, using the standard transaction capture — see Capturing Sales.