docs
Get Started

Choose your integration

Pick one of four integration patterns based on how much code you want to write.

There are four ways to take a payment with XPay. All four use the same underlying Checkout Session, so the API call your server makes and the webhook your server receives are identical. What changes is how much frontend code you write, and where the customer fills in their card.

If you're not sure which to pick, start with Payment Links. You can move to a richer integration later without rewriting your backend.

Side by side

PatternCode you writeCustomer experiencePick this if
Payment LinksNoneA hosted XPay page reached through your linkYou want zero code, or you sell over invoices, social, or chat
Hosted CheckoutServer onlyA hosted XPay page reached through a redirectYou want zero frontend complexity and the redirect is fine
Drop-inServer + ~10 lines of frontendA modal on your site, or an inline iframeYou want the customer to stay on your domain with the form still hosted by XPay
ElementsServer + custom frontendA form you build yourself, on your siteYou want full control over the checkout UI

The four patterns

What's the same across all four

  • One API call. Every pattern (except a no-code Payment Link, which still wraps a session under the hood) starts with POST /checkout/sessions.
  • One webhook. Every successful payment fires checkout.session.completed carrying the same Checkout Session you'd get from the API.
  • One customer flow. Cards, 3D Secure, and local methods like Valu and Fawry all work identically.

You aren't locking yourself into a pattern when you start. The Checkout Session is the spine; the integration patterns are just different ways of opening it.

Where to next

On this page