> ## Documentation Index
> Fetch the complete documentation index at: https://docs.daya.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Order Quote

> Get a price quote for an order without placing it

## Overview

Get an estimated price quote for an order without actually placing it. This is useful for previewing the expected execution price and fees before committing to a trade. This endpoint requires authentication with an API key that has **Trade** scope.

## Authentication

<ParamField header="X-Api-Key" type="string" required>
  Your API key with Trade scope

  ```
  X-Api-Key: daya_sk_YOUR_API_KEY
  ```
</ParamField>

## Request Body

<ParamField body="symbol" type="string" required>
  Trading pair symbol

  **Example:** `USDT-NGN`

  **Allowed values:** `USDT-NGN`, `USDC-NGN`, `USD-NGN`
</ParamField>

<ParamField body="side" type="string" required>
  Order side

  **Allowed values:** `buy`, `sell`
</ParamField>

<ParamField body="type" type="string" required>
  Order type

  **Allowed values:** `limit`, `market`
</ParamField>

<ParamField body="price" type="string">
  Order price (required for limit orders)

  **Example:** `1545.00`

  <Note>
    Required when `type` is `limit`. Not allowed for market orders.
  </Note>
</ParamField>

<ParamField body="quantity" type="string" required>
  Order quantity in base asset

  **Example:** `100.00`
</ParamField>

## Request Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.pro.daya.co/public/v1/orders/quote \
    --header 'X-Api-Key: daya_sk_YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "symbol": "USDT-NGN",
      "side": "buy",
      "type": "market",
      "quantity": "100.00"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.pro.daya.co/public/v1/orders/quote', {
    method: 'POST',
    headers: {
      'X-Api-Key': 'daya_sk_YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      symbol: 'USDT-NGN',
      side: 'buy',
      type: 'market',
      quantity: '100.00'
    })
  });

  const quote = await response.json();
  console.log('Estimated price:', quote.data.estimated_price);
  console.log('Estimated fee:', quote.data.estimated_fee);
  ```

  ```python Python theme={null}
  import requests

  headers = {
      'X-Api-Key': 'daya_sk_YOUR_API_KEY',
      'Content-Type': 'application/json'
  }

  data = {
      'symbol': 'USDT-NGN',
      'side': 'buy',
      'type': 'market',
      'quantity': '100.00'
  }

  response = requests.post(
      'https://api.pro.daya.co/public/v1/orders/quote',
      headers=headers,
      json=data
  )

  quote = response.json()
  print(f"Estimated price: {quote['data']['estimated_price']}")
  print(f"Estimated fee: {quote['data']['estimated_fee']}")
  ```

  ```go Go theme={null}
  package main

  import (
      "bytes"
      "encoding/json"
      "fmt"
      "net/http"
  )

  func main() {
      order := map[string]string{
          "symbol":   "USDT-NGN",
          "side":     "buy",
          "type":     "market",
          "quantity": "100.00",
      }
      body, _ := json.Marshal(order)

      req, _ := http.NewRequest("POST", "https://api.pro.daya.co/public/v1/orders/quote", bytes.NewBuffer(body))
      req.Header.Set("X-Api-Key", "daya_sk_YOUR_API_KEY")
      req.Header.Set("Content-Type", "application/json")

      client := &http.Client{}
      resp, err := client.Do(req)
      if err != nil {
          panic(err)
      }
      defer resp.Body.Close()

      var result map[string]interface{}
      json.NewDecoder(resp.Body).Decode(&result)

      data := result["data"].(map[string]interface{})
      fmt.Println("Estimated price:", data["estimated_price"])
      fmt.Println("Estimated fee:", data["estimated_fee"])
  }
  ```
</CodeGroup>

## Response

<ResponseField name="success" type="boolean" required>
  Indicates if the request was successful
</ResponseField>

<ResponseField name="message" type="string" required>
  Human-readable response message
</ResponseField>

<ResponseField name="data" type="object" required>
  Order quote details

  <Expandable title="data properties">
    <ResponseField name="symbol" type="string">
      Trading pair symbol

      **Example:** `USD-NGN`
    </ResponseField>

    <ResponseField name="side" type="string">
      Order side: `buy` or `sell`
    </ResponseField>

    <ResponseField name="type" type="string">
      Order type: `limit` or `market`
    </ResponseField>

    <ResponseField name="quantity" type="string">
      Order quantity in base asset

      **Example:** `100.00`
    </ResponseField>

    <ResponseField name="estimated_price" type="string">
      Estimated execution price based on current orderbook

      **Example:** `1545.50`
    </ResponseField>

    <ResponseField name="estimated_total" type="string">
      Estimated total value in quote currency

      **Example:** `154550.00`
    </ResponseField>

    <ResponseField name="estimated_fee" type="string">
      Estimated fee for the trade

      **Example:** `0.15455000`
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="timestamp" type="string">
  ISO 8601 timestamp of the response
</ResponseField>

### Success Response

<ResponseExample>
  ```json 200 OK - Market Order Quote theme={null}
  {
    "success": true,
    "message": "Order quote retrieved successfully",
    "data": {
      "symbol": "USD-NGN",
      "side": "buy",
      "type": "market",
      "quantity": "100.00",
      "estimated_price": "1545.50",
      "estimated_total": "154550.00",
      "estimated_fee": "0.15455000"
    },
    "timestamp": "2024-01-15T10:35:00Z"
  }
  ```

  ```json 200 OK - Limit Order Quote theme={null}
  {
    "success": true,
    "message": "Order quote retrieved successfully",
    "data": {
      "symbol": "USD-NGN",
      "side": "buy",
      "type": "limit",
      "quantity": "100.00",
      "estimated_price": "1545.00",
      "estimated_total": "154500.00",
      "estimated_fee": "0.15450000"
    },
    "timestamp": "2024-01-15T10:35:00Z"
  }
  ```
</ResponseExample>

## Error Responses

<ResponseExample>
  ```json 400 Bad Request theme={null}
  {
    "success": false,
    "message": "Validation error",
    "error": {
      "code": "VALIDATION_ERROR",
      "message": "Quantity is required"
    },
    "timestamp": "2024-01-15T10:35:00Z"
  }
  ```

  ```json 403 Forbidden - Account frozen theme={null}
  {
    "success": false,
    "message": "Forbidden",
    "error": {
      "code": "ACCOUNT_FROZEN",
      "message": "Trading account is frozen"
    },
    "timestamp": "2024-01-15T10:35:00Z"
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "success": false,
    "message": "Symbol not found",
    "error": {
      "code": "SYMBOL_NOT_FOUND",
      "message": "The specified trading pair does not exist"
    },
    "timestamp": "2024-01-15T10:35:00Z"
  }
  ```
</ResponseExample>

## Notes

* Quotes are estimates based on the current state of the orderbook and may differ from the actual execution price.
* The quote does not reserve liquidity or lock funds.
* For market orders, the estimated price is the volume-weighted average price across the available orderbook depth.

## Rate Limits

* **100 requests per minute** per API key

## Next Steps

<CardGroup cols={2}>
  <Card title="Place Order" icon="arrow-right-arrow-left" href="/pro/api-reference/place-order">
    Place the order after reviewing the quote
  </Card>

  <Card title="Get Orderbook" icon="book" href="/pro/api-reference/get-orderbook">
    View the full orderbook depth
  </Card>
</CardGroup>
