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

# Quick Start

> Place your first trade with the Pro API

## Overview

This guide walks you through placing your first order using the Pro API. You'll learn to fetch market data, check your account, and execute a trade.

<Info>
  **Prerequisites:** You need a Pro account and an API key with **Trade** scope. Contact [support@daya.co](mailto:support@daya.co) to request access. See [Authentication](/pro/authentication) for details.
</Info>

## Step 1: Fetch Available Markets

First, check which markets are available. This endpoint doesn't require authentication:

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://api.pro.daya.co/public/v1/markets
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.pro.daya.co/public/v1/markets');
  const result = await response.json();
  console.log(result.data);
  ```

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

  response = requests.get('https://api.pro.daya.co/public/v1/markets')
  result = response.json()
  print(result['data'])
  ```

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

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

  func main() {
      resp, err := http.Get("https://api.pro.daya.co/public/v1/markets")
      if err != nil {
          panic(err)
      }
      defer resp.Body.Close()

      var result map[string]interface{}
      json.NewDecoder(resp.Body).Decode(&result)
      fmt.Println(result["data"])
  }
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "success": true,
  "message": "Markets retrieved successfully",
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "symbol": "USD-NGN",
      "base_asset": "USD",
      "quote_asset": "NGN",
      "status": "active",
      "created_at": "2024-01-01T00:00:00Z",
      "updated_at": "2024-01-01T00:00:00Z"
    }
  ],
  "timestamp": "2024-01-15T10:30:00Z"
}
```

## Step 2: Check the Orderbook

View current market depth for your chosen pair:

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.pro.daya.co/public/v1/orderbook/USDT-NGN?depth=10'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.pro.daya.co/public/v1/orderbook/USDT-NGN?depth=10'
  );
  const result = await response.json();
  console.log('Best bid:', result.data.bids[0]);
  console.log('Best ask:', result.data.asks[0]);
  ```

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

  response = requests.get(
      'https://api.pro.daya.co/public/v1/orderbook/USDT-NGN',
      params={'depth': 10}
  )
  result = response.json()
  print(f"Best bid: {result['data']['bids'][0]}")
  print(f"Best ask: {result['data']['asks'][0]}")
  ```

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

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

  func main() {
      resp, err := http.Get("https://api.pro.daya.co/public/v1/orderbook/USDT-NGN?depth=10")
      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{})
      bids := data["bids"].([]interface{})
      asks := data["asks"].([]interface{})
      fmt.Println("Best bid:", bids[0])
      fmt.Println("Best ask:", asks[0])
  }
  ```
</CodeGroup>

## Step 3: Place a Limit Order

Now place an order. This requires an API key with **Trade** scope:

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

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

  const order = await response.json();
  console.log('Order placed:', order);
  ```

  ```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': 'limit',
      'price': '1545.00',
      'quantity': '100.00'
  }

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

  order = response.json()
  print(f"Order placed: {order}")
  ```

  ```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":   "limit",
          "price":  "1545.00",
          "quantity": "100.00",
      }
      body, _ := json.Marshal(order)

      req, _ := http.NewRequest("POST", "https://api.pro.daya.co/public/v1/orders", 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)
      fmt.Println("Order placed:", result)
  }
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "success": true,
  "message": "Order placed successfully",
  "data": {
    "order_id": "550e8400-e29b-41d4-a716-446655440000",
    "status": "pending_settlement",
    "side": "buy",
    "type": "limit",
    "symbol": "USD-NGN",
    "requested_quantity": "100.00000000",
    "filled_quantity": "0.00000000",
    "remaining_quantity": "100.00000000",
    "avg_fill_price": "",
    "total_fee_charged": "",
    "created_at": "2024-01-15T10:35:00Z",
    "updated_at": "2024-01-15T10:35:00Z"
  },
  "timestamp": "2024-01-15T10:35:00Z"
}
```

## Step 4: Check Your Orders

View your open orders:

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.pro.daya.co/public/v1/orders?symbol=USDT-NGN' \
    --header 'X-Api-Key: daya_sk_YOUR_API_KEY'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.pro.daya.co/public/v1/orders?symbol=USDT-NGN',
    {
      headers: { 'X-Api-Key': 'daya_sk_YOUR_API_KEY' }
    }
  );

  const data = await response.json();
  console.log('Your orders:', data.data);
  ```

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

  headers = {'X-Api-Key': 'daya_sk_YOUR_API_KEY'}

  response = requests.get(
      'https://api.pro.daya.co/public/v1/orders',
      headers=headers,
      params={'symbol': 'USDT-NGN'}
  )

  orders = response.json()
  print(f"Your orders: {orders['data']}")
  ```

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

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

  func main() {
      req, _ := http.NewRequest("GET", "https://api.pro.daya.co/public/v1/orders?symbol=USDT-NGN", nil)
      req.Header.Set("X-Api-Key", "daya_sk_YOUR_API_KEY")

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

      var data map[string]interface{}
      json.NewDecoder(resp.Body).Decode(&data)
      fmt.Println("Your orders:", data["data"])
  }
  ```
</CodeGroup>

## Step 5: Cancel an Order

Cancel an open order if needed:

<CodeGroup>
  ```bash cURL theme={null}
  curl --request DELETE \
    --url https://api.pro.daya.co/public/v1/orders/550e8400-e29b-41d4-a716-446655440000 \
    --header 'X-Api-Key: daya_sk_YOUR_API_KEY'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.pro.daya.co/public/v1/orders/550e8400-e29b-41d4-a716-446655440000',
    {
      method: 'DELETE',
      headers: { 'X-Api-Key': 'daya_sk_YOUR_API_KEY' }
    }
  );

  if (response.ok) {
    console.log('Order cancelled');
  }
  ```

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

  headers = {'X-Api-Key': 'daya_sk_YOUR_API_KEY'}

  response = requests.delete(
      'https://api.pro.daya.co/public/v1/orders/550e8400-e29b-41d4-a716-446655440000',
      headers=headers
  )

  if response.ok:
      print('Order cancelled')
  ```

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

  import (
      "fmt"
      "net/http"
  )

  func main() {
      req, _ := http.NewRequest("DELETE", "https://api.pro.daya.co/public/v1/orders/550e8400-e29b-41d4-a716-446655440000", nil)
      req.Header.Set("X-Api-Key", "daya_sk_YOUR_API_KEY")

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

      if resp.StatusCode == 200 {
          fmt.Println("Order cancelled")
      }
  }
  ```
</CodeGroup>

## Order Types

| Type       | Description                                 | Required Fields     |
| ---------- | ------------------------------------------- | ------------------- |
| **limit**  | Execute at specified price or better        | `price`, `quantity` |
| **market** | Execute immediately at best available price | `quantity`          |

## Order Status

| Status               | Description                      |
| -------------------- | -------------------------------- |
| `pending_settlement` | Order is awaiting settlement     |
| `new`                | Order has been created           |
| `open`               | Order is active on the orderbook |
| `partially_filled`   | Order is partially executed      |
| `filled`             | Order is completely executed     |
| `cancelled`          | Order was cancelled by user      |
| `rejected`           | Order was rejected by the system |
| `failed`             | Order failed to execute          |

## Next Steps

<CardGroup cols={2}>
  <Card title="Markets API" icon="chart-line" href="/pro/api-reference/list-markets">
    Full markets and orderbook reference
  </Card>

  <Card title="Orders API" icon="arrow-right-arrow-left" href="/pro/api-reference/list-orders">
    Complete order management reference
  </Card>
</CardGroup>
