Skip to main content
Render the Add Card frame into your UI so the customer can save a new credit or debit card. Card data is captured inside a PCI-compliant MoonPay-hosted UI and never touches your domain.
Setup Add Card

Parameters

This method does not require a separate auth token. The client uses stored credentials from an active connection.

AddCardEvent

onEvent receives events as the Add Card flow progresses. Use event.kind to decide how to handle each event.

CardResponse

The card object returned when the customer finishes adding a card. Use id directly in getQuote — there is no need to re-fetch payment methods.

AddCardEventError

Result

client.setupAddCard() returns a Result<AddCardFrame, SetupAddCardError>.

Result envelope

Result<AddCardFrame, SetupAddCardError>

AddCardFrame

The Add Card frame does not expose a setQuote method — quotes are issued after the card is saved.

SetupAddCardError

Example: Add a card, then buy

After the complete event fires, pass card.id to getQuote and use the returned signature with setupBuy to execute the transaction. For the full end-to-end walkthrough, see the Pay with card guide.
Add card, then buy
types.ts