executable: true can be used to execute a transaction.
Get a quote
Parameters
client.getQuote() takes a single input object. The shape matches the Get quotes API request body — see that page for the complete field reference.
| Field | Type | Required | Description |
|---|---|---|---|
source | object | ✅ | The fiat side of the quote. |
source.asset.code | string | ✅ | The fiat currency code as ISO 4217 (for example, "USD"). |
source.amount | string | The amount to spend, as a string (for example, "100.00"). Set the amount on either source or destination, not both. | |
destination | object | ✅ | The crypto side of the quote. |
destination.asset.code | string | ✅ | The crypto asset code the customer receives (for example, "ETH", "USDC_SOL"). |
destination.amount | string | The amount the customer receives, if known. Set the amount on either source or destination, not both. | |
wallet | object | Where the crypto is sent. Required for the quote to be executable. | |
wallet.address | string | ✅ | The destination wallet address. |
wallet.tag | string | An optional memo or destination tag, used by some blockchains such as XRP or XLM. | |
paymentMethod | object | The payment method to quote against. Required for the quote to be executable. | |
paymentMethod.type | string | ✅ | The payment method type (for example, "apple_pay", "google_pay", "card"). |
paymentMethod.id | string | The stored payment method ID. Required when type is "card" to identify the specific card. | |
feeBehavior | string | How fees relate to source.amount. One of "inclusive" or "exclusive". Defaults to "inclusive". Only applies when you quote by source.amount; it is ignored when you quote by destination.amount. |
Fee behavior
feeBehavior controls whether fees are taken out of source.amount or added on top of it. It only applies when you quote by source.amount.
"inclusive"(default): the customer pays exactlysource.amount, and fees are carved out of it. Less of the source amount is converted, so the customer receives less crypto. This is the existing behavior, so omittingfeeBehaviorkeeps quotes unchanged."exclusive": fees are added on top ofsource.amount, so the customer payssource.amountplus fees. The fullsource.amountis converted, so the customer receives more crypto than the inclusive quote for the same input.
destination.amount, MoonPay ignores feeBehavior and the quote is always fees-inclusive. The response always echoes the effective feeBehavior: the value you requested for source-amount quotes, or "inclusive" for destination-amount quotes.
Quote with fees added on top
Result
client.getQuote() returns a Result<{ data: Quote }, GetQuoteError>.
Result envelope
Result<{ data: Quote }, GetQuoteError>
| Field | Type | Required | Description |
|---|---|---|---|
ok | boolean | ✅ | Whether the operation succeeded. |
value | { data: Quote } | Present when ok is true. | |
error | GetQuoteError | Present when ok is false. |
Quote
A quote includes a signature you use to execute a transaction, plus fees and limits. See the API reference for the full shape.
| Field | Type | Required | Description |
|---|---|---|---|
signature | string | ✅ | A stringified JSON object that contains quote data and an embedded hash. Don’t deserialize this value. Use it as-is to execute a transaction. |
expiresAt | string | ✅ | An ISO 8601 timestamp for when the quote expires. |
source | object | ✅ | The source (fiat) asset details. |
destination | object | ✅ | The destination (crypto) asset details. |
wallet | object | ✅ | The destination wallet details. |
fees | object | ✅ | Fee details for the transaction. |
feeBehavior | string | ✅ | The effective fee behavior for this quote, "inclusive" or "exclusive". Echoes the requested value for source-amount quotes, or "inclusive" for destination-amount quotes. |
executable | boolean | ✅ | Whether the quote can be used to execute a transaction. See the API reference for the request fields required to receive executable: true. |
GetQuoteError
GetQuoteError is the standard MoonPay Platform API error shape, DevPlatformApiError.
| Field | Type | Required | Description |
|---|---|---|---|
code | DevPlatformApiErrorCode | ✅ | A machine-readable error code (for example, "invalid_request", "unauthorized", "unprocessable_entity"). See the error reference for the full list. |
message | string | ✅ | A developer-friendly message. |
errors | DevPlatformApiErrorDetail[] | Optional list of field-level errors when the request fails validation. Each entry has a field and message. |
TS Definition
TS Definition
types.ts