Prerequisites
- Guest checkout enabled on your partner account. Contact your MoonPay account team.
- A server that can create session tokens with your secret key.
- A UI surface where you can render the Apple Pay frame, the Google Pay frame, and the challenge frame. Offer the wallet that matches the customer’s environment; you do not need both buttons on every surface.
- The customer’s email address and phone number, captured in your own UI and passed when you create the session. Guest checkout requires both. MoonPay renders no field for either one in the payment flow.
- Your responsibility. Confirm the customer owns the email address and the phone number by sending a one-time passcode before you create the session. Re-verify the phone number at least once every 30 days. MoonPay accepts both fields as partner-verified and does not re-verify them, so passing them is your attestation that verification occurred. See Verify phone numbers before you submit them.
- The timestamp at which the customer accepted MoonPay’s terms (see Record terms acceptance).
How it works
- Your server creates a session that includes the customer’s email, phone number, and terms acceptance.
- You check the connection, which returns the customer’s capabilities. When
capabilities.guestCheckoutis present, offer Apple Pay or Google Pay on the guest path; otherwise connect the customer with the standard flow. - You get a quote for
apple_payorgoogle_pay. A quote that comes backexecutable: trueis ready to use. - A quote for more than the customer’s guest limit comes back
executable: false, and carries achallengewhen the customer can raise that limit without full verification. You render the challenge, then quote again. See Upgrade a guest account. - You render the matching payment frame (Apple
Pay at
/platform/v1/apple-pay, or Google Pay at/platform/v1/google-pay). - On the customer’s first purchase, MoonPay creates the guest account from the wallet billing details and processes the payment. If extra verification is needed, the frame emits a challenge that resolves the purchase.
Device and browser support
Offer the wallet the customer’s environment supports. When a wallet isn’t available, the frame emitsunsupported — hide that button and offer the
other wallet or a connected-customer flow.
- Apple Pay
- Google Pay
Apple Pay is available in Safari on macOS and in every iOS browser. The
customer also needs a card set up in Apple Pay.In other browsers, the frame reports Apple Pay as unavailable and renders
nothing. It does not offer Apple’s cross-device QR flow. The
widget does support that flow.In a native iOS app, embed the Apple Pay
frame in a
WKWebView and handle JavaScript
dialogs through WKUIDelegate. See the frame
requirements and the iOS manual
integration guide.Record terms acceptance
Present MoonPay’s Terms of Use and Privacy Policy in your UI using one of the presentation methods, and capture the timestamp when the customer accepts. Pass it astermsAcceptedAt
when you create the session: MoonPay records the live terms version at that
moment and binds the acceptance to the guest account. For the rendering rules
and the records you keep once customers accept, see Terms
acceptance.
termsAcceptedAt must be no more than 60 seconds ahead of server time. Capture
it the moment the customer taps your accept control, then create the session
immediately.
Create a session
Create the session on your server with your secret key. For guest checkout, include the customer’semail, phoneNumber, and termsAcceptedAt alongside
the standard fields.
The sessions endpoint accepts all three as optional fields, because the other
onboarding paths do not need them. Guest
checkout does. A session created without email or phoneNumber still returns
200, and capabilities.guestCheckout is absent from the connection in the
next step.
See the sessions API
reference for all fields
and error responses.
If the customer’s region is not supported, the session still succeeds. The
guestCheckout capability is absent in the next step, and you connect the
customer with the standard flow instead.Check for guest checkout
Pass thesessionToken to the client and check the connection. The check runs
in an invisible frame and returns the customer’s capabilities. When
capabilities.guestCheckout is present, offer Apple Pay or Google Pay on the
guest path. You can also check the session manually.
A returning customer whose email and phone match an existing MoonPay account
is recognized at this step. Connect them with the standard
flow: low-friction authentication
prompts for a one-time passcode instead of a full login.
mismatch is true on a connectionRequired result, the session’s email
and phone number resolve to different MoonPay customers. Route the customer
through the connect flow before rendering
Apple Pay or Google Pay.
When guestCheckout is absent
In every condition below, the session and the connection check both succeed.
Nothing errors, so there is no error message to inspect. Check these in order:
Region eligibility comes from the
deviceIp you pass when you create the
session. Pass the customer’s real client IP, not your server’s. An IP that
MoonPay cannot resolve to a supported state counts as unsupported, so
guestCheckout is absent. It is also absent for a phone number from outside the
United States, even when the IP resolves to a supported state.
Gate the wallet buttons on capabilities.guestCheckout being present. Rendering
them on the guest path without it fails the transaction.
Get a quote
Request an executable quote for the wallet you will render. Only quotes withexecutable: true can be used to execute a transaction.
- Apple Pay
- Google Pay
executable: false. When the customer can raise that limit by verifying a
little more about themselves, the quote also carries a challenge. Do not
render the payment frame with that quote. Resolve the challenge first, then
quote again. See Upgrade a guest account.
Render the payment frame
Render the Apple Pay or Google Pay frame with the quote signature. When the customer taps the button and authorizes, MoonPay creates the guest account from the wallet name and billing address, then processes the payment./platform/v1/google-pay is the primary Google Pay URL for this flow. Do not
use the buy button for guest checkout:
that path expects a connected customer.
- Apple Pay
- Google Pay
Apple Pay
Handle verification
This section covers the challenge the payment frame emits after the customer authorizes. A quote can carry a challenge of its own, before you render a payment frame at all. That one is a limit upgrade, covered in Upgrade a guest account. Some guest purchases need the customer to complete an extra step before the payment goes through. Second-factor authentication (for example, confirming identity when email and phone match an existing account, or authenticating when the purchase is larger than the guest limit allows) and KYC step-up (providing more identity details) both surface as the samechallenge event. You render
the challenge frame the same way in every case.
See Handle challenges for the full
flow.
The payment frame emits challenge with a URL. Render the challenge frame at
that URL. The challenge frame guides the customer through the required steps
and completes the purchase itself, then emits complete. You do not re-render
the Apple Pay or Google Pay button.
An amount above the customer’s maximum limit that verification cannot raise is
terminal. The frame emits complete with status: "failed" and
failureCode: "transactionNotAllowed". Prompt the customer to try a smaller
amount.
Upgrade a guest account
A guest account is a real MoonPay account with lower limits. There are two ways to raise them. A step-up lifts the guest limit in place and keeps the customer on the guest path. Full verification lifts the limits further and moves the customer off the guest path entirely.Raise the limit with a step-up
When a customer quotes for more than their guest limit allows, MoonPay can offer to raise that limit in exchange for their date of birth and the last four digits of their Social Security number. The customer stays a guest and never completes full verification. MoonPay decides who qualifies. Eligibility depends on the amount the customer is quoting for, on their history with MoonPay, and on the capability being enabled for your account. The rules shift with MoonPay’s compliance decisions, so do not model them yourself: the quote tells you.The step-up is enabled per partner, and separately from guest checkout itself.
To request it, contact your MoonPay account team at
team@moonpay.com. Without it, quotes never carry a
challenge, and an over-limit purchase fails with failureCode: "transactionNotAllowed".@moonpay/platform-sdk-web or
@moonpay/platform-sdk-react-native 1.15.2 or later. Earlier versions omit the
client token from the challenge frame URL and the frame fails to load.
Detect the limit on the quote. An eligible over-limit quote returns
executable: false and a challenge object. Branch on challenge being
present rather than comparing the amount against a limit yourself.
Render the challenge frame. Pass challenge.url to setupChallenge()
unchanged. This is the same challenge frame the
card and identity flows use, running its guest_checkout_limit_upgrade flow.
MoonPay collects and validates the date of birth and the SSN digits inside the
frame, so neither value passes through your code.
Act on the result. The frame emits complete with a status:
Tear the frame down. Call
dispose() on complete, cancelled, and
error. On rejected the frame keeps its own message on screen, so removing
it is your call.
On
cancelled, nothing was submitted. Offer a retry: render the frame again
at the same URL, or quote again for a fresh challenge.url if the old one has
expired.Complete full verification
To lift the limits beyond what a step-up reaches, connect the customer and have them complete full identity verification. The limits lift on the same account, with no migration. Use the connect flow, then guide the customer through verification. You can prompt this after a completed guest purchase, when a purchase exceeds the guest limit, or when a step-up comes backrejected.
Transaction statuses
Transactions have the following statuses:- Pending: The transaction has been initiated and the payment accepted. The assets are being transferred.
- Complete: The transaction is finalized. The payment is complete and the assets have been delivered to their destination.
- Failed: The transaction has failed. The payment was not executed and funds were not transferred.
Next steps
Pay with Apple Pay
Connected-customer Apple Pay after login.
Pay with Google Pay
Connected-customer Google Pay after login.
Apple Pay frame
Frame URL, size, permissions, and events.
Google Pay frame
Frame URL, size, permissions, and events.
Handle challenges
Render the challenge frame when a quote or a purchase needs extra
verification.
Challenge frame
Frame URL, events, and the
guest_checkout_limit_upgrade payloads.Terms acceptance
Present terms and record
termsAcceptedAt.