> ## 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 Restaurant Status

> Check if restaurant is open or closed

## Overview

Checks the current operational status of a specific restaurant/branch.

## Path Parameters

<ParamField path="rest_id" type="string" required>
  Restaurant/branch UUID from the `/restaurants/get` response
</ParamField>

## Headers

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

## Response

<ResponseField name="status" type="boolean">
  `true` if successful
</ResponseField>

<ResponseField name="data" type="string">
  Current restaurant status: `"Open"` or `"Closed"`
</ResponseField>

## Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET https://www.xn--dkkango-n2a.com/api/integrations/restaurants/status/get/8f2b9ce2-04de-4712-842d-a39f64596fdf \
    -H 'Access-Token: your-access-token'
  ```

  ```javascript JavaScript theme={null}
  const restaurantId = '8f2b9ce2-04de-4712-842d-a39f64596fdf';

  const response = await fetch(
    `https://www.xn--dkkango-n2a.com/api/integrations/restaurants/status/get/${restaurantId}`,
    {
      headers: {
        'Access-Token': 'your-access-token'
      }
    }
  );

  const data = await response.json();
  console.log(data.data); // "Open" or "Closed"
  ```

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

  restaurant_id = '8f2b9ce2-04de-4712-842d-a39f64596fdf'

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

  data = response.json()
  print(data['data'])  # "Open" or "Closed"
  ```

  ```php PHP theme={null}
  <?php
  $restaurantId = '8f2b9ce2-04de-4712-842d-a39f64596fdf';
  $url = "https://www.xn--dkkango-n2a.com/api/integrations/restaurants/status/get/{$restaurantId}";

  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      'Access-Token: your-access-token'
  ));
  $response = curl_exec($ch);
  curl_close($ch);

  $data = json_decode($response, true);
  echo $data['data']; // "Open" or "Closed"
  ?>
  ```
</CodeGroup>

## Response Examples

<Tabs>
  <Tab title="Open">
    ```json theme={null}
    {
      "status": true,
      "data": "Open"
    }
    ```

    Restaurant is accepting orders.
  </Tab>

  <Tab title="Closed">
    ```json theme={null}
    {
      "status": true,
      "data": "Closed"
    }
    ```

    Restaurant is not accepting orders.
  </Tab>
</Tabs>

## Error Responses

<ResponseExample>
  ```json Authentication Error (401) theme={null}
  {
    "status": false,
    "error": "yetkisiz erişim"
  }
  ```

  ```json Invalid UUID (403) theme={null}
  {
    "status": false,
    "error": "URL hatalı"
  }
  ```

  ```json Not Found (404) theme={null}
  {
    "status": false,
    "error": "restoran bulunamadı"
  }
  ```
</ResponseExample>

## Use Cases

<AccordionGroup>
  <Accordion title="Display Status in POS">
    Show current restaurant status in your POS interface.

    ```javascript theme={null}
    async function displayRestaurantStatus() {
      const status = await getRestaurantStatus(restaurantId);
      
      if (status === "Open") {
        showGreenIndicator();
        enableOrderAcceptance();
      } else {
        showRedIndicator();
        disableOrderAcceptance();
      }
    }
    ```
  </Accordion>

  <Accordion title="Sync Status on Startup">
    Check status when POS application starts.

    ```javascript theme={null}
    async function initializePOS() {
      const restaurants = await getRestaurants();
      
      for (const restaurant of restaurants) {
        const status = await getRestaurantStatus(restaurant.id);
        updateLocalStatus(restaurant.id, status);
      }
    }
    ```
  </Accordion>

  <Accordion title="Periodic Status Check">
    Poll status periodically to stay in sync.

    ```javascript theme={null}
    // Check status every 5 minutes
    setInterval(async () => {
      const status = await getRestaurantStatus(restaurantId);
      if (status !== currentStatus) {
        currentStatus = status;
        notifyStatusChange(status);
      }
    }, 300000);
    ```
  </Accordion>
</AccordionGroup>

<Note>
  Status changes made via the API are immediately reflected in the Dükkango platform.
</Note>

## Related Endpoints

<CardGroup cols={2}>
  <Card title="Open Restaurant" icon="door-open" href="/api-reference/restaurants/status-open">
    Change status to open
  </Card>

  <Card title="Close Restaurant" icon="door-closed" href="/api-reference/restaurants/status-close">
    Change status to closed
  </Card>
</CardGroup>
