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
walletandpaymentMethodset. 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.amountis exactly48. See Test the flow.
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, wherequoteResult.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.
Get a quote
Request the quote as usual, then look for a wallet ownership disclosure in
If
paymentDisclosures.paymentDisclosures has no wallet ownership disclosure, the quote doesn’t
need the declaration. Buy with it as usual.Show the declaration
Show the declaration for the disclosure’s
When the customer confirms, record the time. You send it as
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.HTML example
HTML example
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.Quote again with the attestation
Request the quote again with the same input plus MoonPay validates
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.attestations against the new quote:idandversionmatch the wallet ownership disclosure the quote returns.attestedAtis within the last 6 hours, and no more than 60 seconds in the future.attestationshas at most 2 items, and eachidappears once.
400 invalid_request. See Handle
errors. If the new quote asks for no declaration, MoonPay drops
attestations without an error.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.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
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 sendattestations 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 whosesource.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
attestationsand 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.