Use this function to request an executable quote for fiat->crypto transactions. Quotes include fees and limits, and they expire after a short time window.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.
Get a quote
Parameters
client.getQuote() takes a single input object. See the Get quotes API for full details.
| 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, as a string (for example, "100.00"). |
walletAddress | string | ✅ | The destination wallet address. |
paymentMethod | string | ✅ | The payment method type to use for the quote (e.g., "apple_pay"). |
accessToken parameter. The client uses stored credentials from an active connection.
Result
client.getQuote() returns a Result<Quote, GetQuoteError>.
Result envelope
Result<Quote, GetQuoteError>
| Field | Type | Required | Description |
|---|---|---|---|
ok | boolean | ✅ | Whether the operation succeeded. |
value | 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 details.
| 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. |
GetQuoteError
| Field | Type | Required | Description |
|---|---|---|---|
kind | "validationError" | "genericError" | ✅ | The error category. |
message | string | ✅ | Developer-friendly details. |
TS Definition
TS Definition
types.ts