payment_method_options, the client runs the wallet’s own ceremony (Klarna widget, PayPal approval, Google Pay or Apple Pay sheet), and one of the express endpoints places the order with the merchant.
All express endpoints live under POST /api/v1/domains/{domain}/express/{gateway}/... on api.firmly.work, authenticated with the x-firmly-authorization device token from Browser Session. Apple Pay merchant validation is the one exception: it is served by the wallet service under /api/v1/wallets/apple-pay/validate-merchant.
Discovering support
A client learns which gateways a merchant accepts from the cart response. Each accepted gateway appears inpayment_method_options with a type, a wallet, and a config the client uses to set up the wallet. If an entry is absent, the merchant does not accept that gateway: do not show its button.
Flows
Klarna: Start creates the Klarna session (a widgetclient_token, or a redirect url), Authorize confirms the Klarna authorization, and Complete Order places the order.
PayPal: Start creates the PayPal order and returns the paypal_token, the buyer approves on PayPal, Authorize pulls the PayPal address onto the cart (optional), and Complete Order places the order.
Google Pay: a single call. The Google Pay sheet mints a token client-side from the cart’s config, and Complete Order places the order. See Integrate Google Pay for the client-side steps.
Apple Pay: Validate Merchant answers the onvalidatemerchant event, the buyer authorizes in the Apple Pay sheet, and Complete Order places the order with the PKPaymentToken.
Preparing the cart
Express checkout completes an already-prepared cart. For a physical-goods order the cart must carry a shipping address and a selected shipping method before the complete call, or it fails withErrorMissingShippingMethod. PayPal authorize pulls the buyer’s address from PayPal. The Google Pay and Apple Pay sheets can collect the address: pass it as google_pay_address or apple_pay_address on the complete call, or persist it first with Set Shipping Info and Set Shipping Method.
Related
- Complete Order (Credit Card): the standard card flow