Skip to main content
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 with 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. This method does not require a separate auth token. The client uses stored credentials from an active connection.

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 exactly source.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 omitting feeBehavior keeps quotes unchanged.
  • "exclusive": fees are added on top of source.amount, so the customer pays source.amount plus fees. The full source.amount is converted, so the customer receives more crypto than the inclusive quote for the same input.
When you quote by 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>

Quote

A quote includes a signature you use to execute a transaction, plus fees and limits. See the API reference for the full shape.

GetQuoteError

GetQuoteError is the standard MoonPay Platform API error shape, DevPlatformApiError.
types.ts