> ## Documentation Index
> Fetch the complete documentation index at: https://dev.moonpay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Collect wallet ownership declarations

> Show the travel rule wallet ownership declaration in your own UI and send the customer's confirmation on the quote, so the purchase skips MoonPay's wallet ownership challenge.

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.

> [!NOTE]
>
> 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](https://dev.moonpay.com/platform/guides/pay-with-buy-button.md) or [Pay with
  card](https://dev.moonpay.com/platform/guides/pay-with-card.md).

## How it works

```mermaid theme={null}
sequenceDiagram
    autonumber
    actor C as Customer
    participant FE as Your frontend
    participant API as MoonPay API
    participant BB as Buy Button frame

    FE->>API: POST /platform/v1/quotes/buy
    API-->>FE: Quote with a wallet ownership disclosure
    FE->>C: Show the declaration with a checkbox
    C->>FE: Ticks the checkbox and confirms
    FE->>API: POST /platform/v1/quotes/buy with attestations
    API-->>FE: Attested quote with a new signature
    FE->>BB: Buy with the attested quote's signature
    Note over BB: No wallet ownership challenge
```

## 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](https://dev.moonpay.com/platform/overview/test-mode.md) and the quote's
  `source.amount` is exactly `48`. See [Test the flow](#test-the-flow).

The disclosure's `id` tells you which declaration to show. Its `version` is
currently `"1"`.

| `id` | Destination wallet |
| - | - |
| `wallet-ownership-custodial` | A wallet hosted by an exchange or another provider. |
| `wallet-ownership-non-custodial` | A self-custody wallet, or a wallet whose custody is unknown. |

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`.

```ts Get a quote theme={null}
// Frontend, connected SDK client
import type { GetQuoteParams } from "@moonpay/platform-sdk-web";

const quoteInput: GetQuoteParams = {
  source: { asset: { code: "USD" }, amount: "100.00" },
  destination: { asset: { code: "ETH" } },
  wallet: { address: "0x1234567890abcdef1234567890abcdef12345678" },
  paymentMethod: { type: "apple_pay" },
};

const quoteResult = await client.getQuote(quoteInput);

if (!quoteResult.ok) {
  // Handle error. See "Handle errors" on this page.
}

// A Set<string>, because the SDK types don't list these IDs yet
const walletOwnershipIds = new Set<string>([
  "wallet-ownership-custodial",
  "wallet-ownership-non-custodial",
]);

const disclosure = quoteResult.value.data.paymentDisclosures.find((item) =>
  walletOwnershipIds.has(item.id),
);

if (!disclosure) {
  // The quote doesn't need the declaration. Buy with it as usual.
}
```

```ts Quote theme={null}
{
  source: { amount: "100.00", asset: { code: "USD" } },
  destination: { amount: "0.025", asset: { code: "ETH" } },
  wallet: { address: "0x1234567890abcdef1234567890abcdef12345678" },
  paymentMethod: { type: "apple_pay" },
  executable: true,
  signature: "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9...",
  paymentDisclosures: [{ id: "wallet-ownership-non-custodial", version: "1" }],
  attestations: [],
  // ...fees, expiresAt, and the other quote fields
}
```

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.

| Part | Text |
| - | - |
| Title | Do you own and control the wallet you provided? |
| Checkbox for `wallet-ownership-custodial` | I confirm that I own and control the custodial wallet `{wallet address}`. |
| Checkbox for `wallet-ownership-non-custodial` | I confirm that I own and control the non-custodial wallet `{wallet address}`. |

Replace `{wallet address}` with the quote's `wallet.address`. You can add a
"Learn more" link to [MoonPay's travel rule help
article](https://support.moonpay.com/customers/docs/transaction-troubleshooting#transactions-unsuccessful-due-to-uk-crypto-travel-rule-compliance).

> [accordion] HTML example
>
> ```html theme={null}
> <fieldset>
>   <legend>Do you own and control the wallet you provided?</legend>
>   <label>
>     <input type="checkbox" name="walletOwnership" />
>     I confirm that I own and control the non-custodial wallet
>     0x1234567890abcdef1234567890abcdef12345678.
>   </label>
>   <a
>     href="https://support.moonpay.com/customers/docs/transaction-troubleshooting#transactions-unsuccessful-due-to-uk-crypto-travel-rule-compliance"
>     >Learn more</a
>   >
> </fieldset>
> ```

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.

> [!NOTE]
>
> `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.

```ts Quote again theme={null}
// Frontend, connected SDK client
import type { Quote } from "@moonpay/platform-sdk-web";

type Attestation = { id: string; version: string; attestedAt: string };

const attestedInput: GetQuoteParams & { attestations: Attestation[] } = {
  ...quoteInput,
  attestations: [
    {
      id: disclosure.id,
      version: disclosure.version,
      // The Date you recorded when the customer confirmed
      attestedAt: confirmedAt.toISOString(),
    },
  ],
};

const attestedResult = await client.getQuote(attestedInput);

if (!attestedResult.ok) {
  // Handle error. See "Handle errors" on this page.
}

const attestedQuote = attestedResult.value.data as Quote & {
  attestations: Attestation[];
};

const declared = attestedQuote.attestations.some(
  (attestation) => attestation.id === disclosure.id,
);
```

```json Request body theme={null}
{
  "source": { "asset": { "code": "USD" }, "amount": "100.00" },
  "destination": { "asset": { "code": "ETH" } },
  "wallet": { "address": "0x1234567890abcdef1234567890abcdef12345678" },
  "paymentMethod": { "type": "apple_pay" },
  "attestations": [
    {
      "id": "wallet-ownership-non-custodial",
      "version": "1",
      "attestedAt": "2026-11-20T14:05:12.000Z"
    }
  ]
}
```

```json Response (excerpt) theme={null}
{
  "data": {
    "executable": true,
    "signature": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9...",
    "paymentDisclosures": [
      { "id": "wallet-ownership-non-custodial", "version": "1" }
    ],
    "attestations": [
      {
        "id": "wallet-ownership-non-custodial",
        "version": "1",
        "attestedAt": "2026-11-20T14:05:12.000Z"
      }
    ]
  }
}
```

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](#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](https://dev.moonpay.com/platform/guides/pay-with-buy-button.md). 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()`](https://dev.moonpay.com/platform/guides/pay-with-buy-button#refresh-an-expiring-quote),
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

| HTTP | `code` | When |
| - | - | - |
| `400` | `invalid_request` | An `attestations` item's `id` or `version` doesn't match the wallet ownership disclosure the quote returns. |
| `400` | `invalid_request` | `attestedAt` is more than 6 hours in the past, or more than 60 seconds in the future. |
| `400` | `invalid_request` | `attestations` has more than 2 items, or the same `id` twice. |
| `503` | `service_unavailable` | MoonPay can't determine whether the quote needs the declaration. |

A `400` names the failing item in `errors[].field`:

```json 400 response theme={null}
{
  "code": "invalid_request",
  "message": "Invalid request",
  "errors": [
    {
      "field": "attestations[0]",
      "message": "This quote asks for \"wallet-ownership-custodial\" version \"1\"."
    }
  ]
}
```

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](https://dev.moonpay.com/api-reference/platform/documentation/using-the-api.md#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](https://dev.moonpay.com/platform/guides/handling-challenges.md).

## Test the flow

In [test mode](https://dev.moonpay.com/platform/overview/test-mode.md), 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](https://dev.moonpay.com/platform/overview/test-mode.md#triggering-challenges).

## Next steps

> [card] [Pay with the buy button](https://dev.moonpay.com/platform/guides/pay-with-buy-button.md)
>
> Buy with the attested quote's `signature`.

> [card] [Handle challenges](https://dev.moonpay.com/platform/guides/handling-challenges.md)
>
> Render the challenge frame for the challenges that still appear.

> [card] [Quote object](https://dev.moonpay.com/api-reference/platform/objects-and-types/quote.md)
>
> `paymentDisclosures`, `attestations`, and the other quote fields.

> [card] [Get a quote](https://dev.moonpay.com/api-reference/platform/endpoints/quotes/get.md)
>
> The quote request, including `attestations`.
