Skip to main content
Travel rules can require a customer to declare that they own and control the destination wallet. By default, MoonPay collects this declaration at checkout, in its hosted wallet ownership challenge. With API-driven wallet ownership declarations, you collect the declaration in your own UI instead. The quote tells you when the declaration is required. You show it to the customer with a checkbox, then send their confirmation on a new quote. A purchase with that quote skips the wallet ownership challenge.
API-driven wallet ownership declarations are opt-in per account. Contact your account manager to enable them. Until they’re enabled, nothing changes: quotes never return the wallet ownership disclosures, MoonPay ignores any attestations you send, and the wallet ownership challenge collects the declaration at checkout.

Prerequisites

  • Your account manager has enabled API-driven wallet ownership declarations on your account.
  • A buy flow that requests quotes with wallet and paymentMethod set. See Pay with the buy button or Pay with card.

How it works

When the quote asks for the declaration

With API-driven wallet ownership declarations enabled, POST /platform/v1/quotes/buy returns a wallet ownership disclosure in paymentDisclosures when:
  • Travel rules require the customer to declare that they own the destination wallet.
  • The customer is on guest checkout and MoonPay doesn’t know them yet.
  • You’re in test mode and the quote’s source.amount is exactly 48. See Test the flow.
The disclosure’s id tells you which declaration to show. Its version is currently "1". Unlike the other payment disclosures, showing the declaration isn’t enough. The customer confirms it, and you send that confirmation back on the quote.

Collect the declaration

The examples use the Web SDK, where quoteResult.value.data is the quote. The JSON examples show the HTTP bodies of POST /platform/v1/quotes/buy, where the response wraps the quote in data.
1

Get a quote

Request the quote as usual, then look for a wallet ownership disclosure in paymentDisclosures.
If paymentDisclosures has no wallet ownership disclosure, the quote doesn’t need the declaration. Buy with it as usual.
2

Show the declaration

Show the declaration for the disclosure’s id, with a checkbox the customer ticks to confirm. Use this text for version 1. It’s the text the wallet ownership challenge shows today.Replace {wallet address} with the quote’s wallet.address. You can add a “Learn more” link to MoonPay’s travel rule help article.
When the customer confirms, record the time. You send it as attestedAt, so take it from the moment they confirm, not from when the screen renders.The declaration names the wallet. If the customer changes the destination wallet, quote again and show the declaration for the new wallet.If the disclosure has a version you don’t have the text for, don’t send attestations. The wallet ownership challenge then collects the declaration at checkout.
3

Quote again with the attestation

Request the quote again with the same input plus attestations. The item carries the disclosure’s id and version, and attestedAt, the ISO 8601 time the customer confirmed.
client.getQuote() sends its input as-is, so attestations works with the current Web and React Native SDKs. The SDK types add attestations and the wallet ownership IDs in an upcoming release. Until then, the example extends the SDK types locally.
MoonPay validates attestations against the new quote:
  • id and version match the wallet ownership disclosure the quote returns.
  • attestedAt is within the last 6 hours, and no more than 60 seconds in the future.
  • attestations has at most 2 items, and each id appears once.
A request that breaks a rule fails with 400 invalid_request. See Handle errors. If the new quote asks for no declaration, MoonPay drops attestations without an error.
4

Check the attested quote

The quote response always includes attestations, an empty array when the quote carries none. Before you buy, check that it contains the declaration, as declared does in the example above.If attestations is empty and paymentDisclosures has no wallet ownership disclosure, the new quote doesn’t need the declaration. Buy with it as usual.
5

Buy with the attested quote

Pass the attested quote’s signature to the buy button, the same way as any other quote. See Pay with the buy button. The purchase skips the wallet ownership challenge. Keep your challenge handling, because other challenges, such as Strong Customer Authentication (SCA), can still appear.Use the attested quote, not the first one. The first quote carries no attestation, so a purchase with it raises the wallet ownership challenge.An attested quote is tied to the customer you requested it for. A purchase with it as a different customer fails.Each quote carries its own attestations. When you replace an expiring quote, for example with setQuote(), request the new quote with the same attestations. attestedAt stays the time the customer confirmed, so you can reuse it for up to 6 hours. After that, show the declaration again.

Handle errors

A 400 names the failing item in errors[].field:
400 response
If the wallet’s custody changes between quotes, from custodial to non-custodial or the reverse, the new quote asks for the other id. A request with the old id fails with the error above. Quote again without attestations, show the declaration for the new id, and send it once the customer confirms. On 503, retry the quote request. For the error format, see Error handling.

If you don’t send attestations

A flow that doesn’t send attestations keeps working after you enable API-driven wallet ownership declarations. When a quote asks for the declaration and you buy with it without attestations, the wallet ownership challenge collects the declaration at checkout, as before. See Handle challenges.

Test the flow

In test mode, a quote whose source.amount is exactly 48 always returns a wallet ownership disclosure while API-driven wallet ownership declarations are enabled on your account. Use it to test both paths:
  • Quote again with attestations and buy with the attested quote. The purchase skips the wallet ownership challenge.
  • Buy with the first quote. The purchase raises the wallet ownership challenge, as described in Triggering challenges.

Next steps

Pay with the buy button

Buy with the attested quote’s signature.

Handle challenges

Render the challenge frame for the challenges that still appear.

Quote object

paymentDisclosures, attestations, and the other quote fields.

Get a quote

The quote request, including attestations.