# Retrieve quotes

Allows you to retrieve a detailed quote for a user order. This endpoint should only be called when a user requests a quote by providing the cryptocurrency, fiat, amounts and payment method. This endpoint is for dynamic quotations and not to retrieve a list of static prices that can be cached.  For all partners, the rate limit is capped at 500/minute for all endpoints combined which is tied to a single IP.

Endpoint: GET /{partner}/v2/quotes/{orderType}
Version: v2
Security: sec0

## Path parameters:

  - `partner` (string, required)
    This is the partner code provided to you during onboarding. e.g. metamask.

  - `orderType` (string, required)
    Whether to return availability for `buy` or `sell` orders.

## Query parameters:

  - `paymentMethodId` (string, required)
    The payment method chosen by the user. For sell quotes, pass the payout method, e.g. `sepa-bank-transfer`. See [Supported Payment Methods](https://docs.banxa.com/products/hosted-checkout/docs/reference/supported-payment-methods#sell-payout-method-ids).

  - `crypto` (string, required)
    This is the crypto type the customer wants to buy or sell.

  - `blockchain` (string)
    The blockchain that the crypto token is associated with. If omitted, the default blockchain for the crypto is used.

  - `fiat` (string, required)
    This is the fiat type the customer wants to buy or sell.

  - `cryptoAmount` (string)
    The crypto amount. Buy: the amount the customer receives. Sell: the amount the customer sells. Either fiatAmount OR cryptoAmount must be provided. If both are provided, then cryptoAmount will be used.

  - `fiatAmount` (string)
    The fiat amount. Buy: the amount the customer spends. Sell: the amount the customer receives. Either fiatAmount OR cryptoAmount must be provided. If both are provided, then cryptoAmount will be used.

  - `externalCustomerId` (string)
    The customer ID that you define. By passing this value, we will be able to provide the customer the most accurate pricing based on their customer details.

  - `ipAddress` (string)
    User’s IP address. Used to validate whether the user is in a location that is supported by Banxa. If invalid IP address or IP address associated to a country that is not supported, then an error will be returned.

  - `discountCode` (string)
    Allows you to configure the discount to your commission rate per quote. This can be a promotion code such as XMAS or a way to differentiate between your customers.

## Header parameters:

  - `Accept` (string)

  - `x-api-key` (string)
    This is the API Key that has been provided to you during onboarding.

## Response 200:

  - `200` (unknown)
    Quote for the requested amount. Returned as an array when `discountCode` is provided.

## Response 200 fields (application/json):

  - `paymentMethodId` (string)
    Example: debit-credit-card

  - `cryptoAmount` (string)
    Example: 0.03564700

  - `fiatAmount` (string)
    Example: 100.00

  - `processingFee` (string)
    Payment gateway fee.
    Example: 0.92

  - `networkFee` (string)
    Example: 1.67

  - `partnerFee` (string)
    Your partner fee for this quote, in fiat.
    Example: 0

  - `discount` (object)

  - `discount.originalQuote` (object)

  - `discount.originalQuote.originalCryptoAmount` (string)
    Example: 0.235214

  - `discount.originalQuote.orginalNetworkFee` (string)
    Example: 0.00

  - `discount.originalQuote.originalProcessingFee` (string)
    Example: 0.00

  - `discount.originalQuote.originalFiatAmount` (string)
    Example: 500.00

  - `discount.discountCode` (string)
    Example: XMAS

## Response 200 examples:

  - `Buy quote (`/quotes/buy`)` (unknown)

  - `Sell quote (`/quotes/sell`)` (unknown)
    Request: `GET /{partner}/v2/quotes/sell?fiat=EUR&crypto=ETH&blockchain=ETH&paymentMethodId=sepa-bank-transfer&cryptoAmount=0.5`. `cryptoAmount` is the crypto the customer sells; `fiatAmount` is the fiat the customer receives.

  - `Option 2 With Discount Code` (unknown)

