id. Then quote and buy
with it, as in Pay with card.
See the Going Live section for requirements you
must meet before taking this integration to production.
Prerequisites
- Card import enabled on your MoonPay account. Contact your MoonPay account team to enable it.
- A PCI-compliant server to send card data from.
- A connected customer.
How it works
Import the card before every purchase, even when MoonPay already has it. Each
purchase needs a fresh CVC.
New customer
Returning customer
Connect the customer
Connect the customer. Then get their
access token with
client.getCredentials() and
pass it to your server.Import the card
Call
POST /platform/v1/payment-methods/cards from your server, with the
customer’s access token as a Bearer token. The token needs the
payment-methods.create scope.Send the request to MoonPay’s PCI proxy, not api.moonpay.com. Use the host
that matches the access token:We recommend sending the customer’s
deviceIp and userAgent. MoonPay uses
them for fraud checks.Request body
Responses
201 Created: MoonPay added the card.200 OK: the customer already has this card. MoonPay returns the sameidand stores the new CVC. Retries are safe.
lastMicroAuthVerification.status is started, pending or
expired, the card can’t be used for a purchase.Errors
Quote and buy
Get a quote with
paymentMethod: { type: "card", id }, then run the purchase.