Use this method to request a quote for fiat-to-crypto transactions. Quotes include fees and limits, and they expire after a short time window. A quote withDocumentation Index
Fetch the complete documentation index at: https://dev.moonpay.com/llms.txt
Use this file to discover all available pages before exploring further.
executable: true can be used to execute a transaction.
Get a quote
Parameters
client.getQuote() takes a single input object. See the Get quotes API for the complete field reference, including optional fields such as destinationAmount and externalCustomerId.
| Field | Type | Required | Description |
|---|---|---|---|
source | string | ✅ | The fiat asset code used for payment (e.g., "USD", "EUR"). |
destination | string | ✅ | The crypto asset code the customer receives (e.g., "ETH", "BTC"). |
sourceAmount | string | The amount to purchase in the source asset, as a string (for example, "100.00"). Provide either sourceAmount or destinationAmount. | |
walletAddress | string | ✅ | The destination wallet address. |
paymentMethod | string | object | ✅ | The payment method to quote against. Pass a string (for example, "apple_pay") or, for stored cards, an object { type: "card", id: "<paymentMethodId>" }. |
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. |
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