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

# Get Current Orders

> Fetch all active orders that need attention

<Note>
  **Rate Limited:** This endpoint has a 30-second cooldown between requests.
</Note>

## Overview

Fetches all active orders in statuses: `RECEIVED`, `CONFIRMED`, `IN_DELIVERY`, or `COMPLETE_NEEDS_PAYMENT`.

<Warning>
  **Important:** Orders will repeat in subsequent calls until acknowledged via [`/orders/success`](/api-reference/orders/success).
</Warning>

## Authentication

<ParamField header="Access-Token" type="string" required>
  Your API access token
</ParamField>

## Query Parameters

<ParamField query="status_id" type="integer" optional>
  Filter by specific status ID (see [Order Status Codes](/guides/order-lifecycle#order-status-codes))
</ParamField>

## Response

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

<ResponseField name="data" type="array" required>
  Array of active order objects

  <Expandable title="Order Object">
    <ResponseField name="id" type="integer">
      External order ID (for display purposes)
    </ResponseField>

    <ResponseField name="payment_key" type="string">
      Internal order UUID - **use this for all operational API calls**
    </ResponseField>

    <ResponseField name="status_id" type="integer">
      Current order status code (1: Received, 2: Confirmed, 16: In Delivery, etc.)
    </ResponseField>

    <ResponseField name="status_text" type="string">
      Human-readable status description
    </ResponseField>

    <ResponseField name="shipping_method" type="string">
      `"delivery"` or `"pickup"`
    </ResponseField>

    <ResponseField name="payment_method" type="string">
      Payment type (e.g., "Nakit", "Kredi Kartı")
    </ResponseField>

    <ResponseField name="total" type="number">
      Final amount to collect (after discounts)
    </ResponseField>

    <ResponseField name="discount" type="string">
      Total discount amount applied
    </ResponseField>

    <ResponseField name="courier_type" type="string">
      `"restaurant"` | `"fuudy"` | `"come_get"`
    </ResponseField>

    <ResponseField name="customer" type="object">
      <Expandable title="Customer Details">
        <ResponseField name="name" type="string">
          Customer name
        </ResponseField>

        <ResponseField name="phone" type="string">
          Customer phone number
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="address" type="object">
      <Expandable title="Delivery Address">
        <ResponseField name="address" type="string">
          Street name
        </ResponseField>

        <ResponseField name="building_no" type="string">
          Building number
        </ResponseField>

        <ResponseField name="apartment_no" type="string">
          Apartment number
        </ResponseField>

        <ResponseField name="neighborhood_name" type="string">
          Neighborhood
        </ResponseField>

        <ResponseField name="district_name" type="string">
          District
        </ResponseField>

        <ResponseField name="city_name" type="string">
          City
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="foods" type="array">
      Array of ordered items with modifiers

      <Expandable title="Order Item">
        <ResponseField name="id" type="string">
          Order item UUID
        </ResponseField>

        <ResponseField name="food_id" type="integer">
          Product ID
        </ResponseField>

        <ResponseField name="name" type="string">
          Product name
        </ResponseField>

        <ResponseField name="quantity" type="integer">
          Quantity ordered
        </ResponseField>

        <ResponseField name="price" type="number">
          Unit price
        </ResponseField>

        <ResponseField name="total" type="number">
          Line total (price × quantity + modifiers)
        </ResponseField>

        <ResponseField name="option_groups" type="array">
          Selected modifiers
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

## Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET 'https://www.xn--dkkango-n2a.com/api/integrations/orders/get-current' \
    -H 'Access-Token: your-access-token'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://www.xn--dkkango-n2a.com/api/integrations/orders/get-current',
    {
      headers: {
        'Access-Token': 'your-access-token'
      }
    }
  );

  const data = await response.json();
  ```

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

  response = requests.get(
      'https://www.xn--dkkango-n2a.com/api/integrations/orders/get-current',
      headers={'Access-Token': 'your-access-token'}
  )

  data = response.json()
  ```
</CodeGroup>

### With Status Filter

```bash theme={null}
curl -X GET 'https://www.xn--dkkango-n2a.com/api/integrations/orders/get-current?status_id=1' \
  -H 'Access-Token: your-access-token'
```

## Response Example

```json theme={null}
{
  "status": true,
  "data": [
    {
      "id": 1031,
      "status_id": 1,
      "status_text": "Sipariş Geldi",
      "shipping_method": "delivery",
      "payment_key": "3e9caf87-5cb7-4c4e-adcb-fc2ec54cf24e",
      "payment_method": "Kredi Kartı",
      "note": "",
      "total": 1417.5,
      "date": "2026-01-16 15:10:54",
      "restaurant_id": "0ca1d2b1-a199-4960-8617-83a659d890c8",
      "restaurant_name": "Halaskargazi Şube",
      "courier_type": "restaurant",
      "discount": "157.5",
      "courier_fee": 0,
      "scheduled_date": "",
      "order_tip": 0,
      "customer": {
        "name": "Kerim Test",
        "phone": "05335587642"
      },
      "address": {
        "address": "Dershane Sokak",
        "description": "",
        "apartment_no": "A",
        "building_no": "71",
        "neighborhood_name": "Halaskargazi Mah",
        "district_name": "Şişli",
        "city_name": "İstanbul"
      },
      "foods": [
        {
          "id": "1e5c28b8-e53e-482c-9b30-86e99b049da3",
          "food_id": 1,
          "name": "Beef Burrito",
          "note": "",
          "price": 675,
          "quantity": 1,
          "total": 675,
          "option_groups": [
            {
              "id": 6,
              "name": "Sos Seçimi",
              "type": "multi",
              "operation": "+",
              "options": {
                "id": 4,
                "name": "Ballı Hardal",
                "price": 10
              }
            }
          ]
        }
      ]
    }
  ]
}
```

## Important Behavior

<Steps>
  <Step title="First Call">
    When you call `/get-current`, new orders appear in the response.
  </Step>

  <Step title="Order Repetition">
    **Orders continue to appear** in subsequent calls until acknowledged.
  </Step>

  <Step title="Acknowledge">
    Call [`/orders/success/{payment_key}`](/api-reference/orders/success) to acknowledge.
  </Step>

  <Step title="Status Changes">
    After acknowledgment, if the order status changes, it will appear again with the new status.
  </Step>
</Steps>

<Warning>
  Always use the `payment_key` (UUID) for operational API calls, not the `id` (integer).
</Warning>

## Error Responses

<ResponseExample>
  ```json Rate Limit Error (429) theme={null}
  {
    "status": false,
    "error": "çok fazla istek",
    "message": "Çok fazla istek. Lütfen 30 saniye bekleyin."
  }
  ```

  ```json Authentication Error (401) theme={null}
  {
    "status": false,
    "error": "yetkisiz erişim",
    "message": "Invalid or expired access token"
  }
  ```
</ResponseExample>

## Typical Integration Pattern

```javascript theme={null}
// Poll every 30 seconds
setInterval(async () => {
  try {
    const response = await fetch(
      'https://www.xn--dkkango-n2a.com/api/integrations/orders/get-current',
      { headers: { 'Access-Token': accessToken } }
    );
    
    const { data: orders } = await response.json();
    
    for (const order of orders) {
      // Process order in your POS
      await processOrderInPOS(order);
      
      // Acknowledge order
      await fetch(
        `https://www.xn--dkkango-n2a.com/api/integrations/orders/success/${order.payment_key}`,
        { 
          method: 'PUT',
          headers: { 'Access-Token': accessToken }
        }
      );
      
      // Accept order with preparation time
      await fetch(
        `https://www.xn--dkkango-n2a.com/api/integrations/orders/accept/${order.payment_key}`,
        {
          method: 'PUT',
          headers: {
            'Access-Token': accessToken,
            'Content-Type': 'application/json'
          },
          body: JSON.stringify({ preparing_time: 30 })
        }
      );
    }
  } catch (error) {
    console.error('Error polling orders:', error);
  }
}, 30000);
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Acknowledge Order" icon="check" href="/api-reference/orders/success">
    Mark order as received
  </Card>

  <Card title="Accept Order" icon="thumbs-up" href="/api-reference/orders/accept">
    Accept and set preparation time
  </Card>

  <Card title="Order Lifecycle" icon="route" href="/guides/order-lifecycle">
    Complete order flow guide
  </Card>

  <Card title="Best Practices" icon="star" href="/guides/best-practices">
    Integration best practices
  </Card>
</CardGroup>
