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