---
title: GraphQL API
description: Query restaurant-scoped order data.
---

# GraphQL API

Send GraphQL requests to:

```text
POST /api/graphql
```

Request body follows standard GraphQL-over-HTTP JSON shape:

```json
{
  "query": "query Orders($from: String!, $to: String!) { orders(placedFrom: $from, placedTo: $to) { id } }",
  "variables": {
    "from": "2026-07-27T00:00:00Z",
    "to": "2026-07-28T00:00:00Z"
  }
}
```

## Orders

`orders(placedFrom:, placedTo:)` returns orders belonging to restaurant connected to API key.

Range uses order `placedAt` and is half-open: `placedFrom <= placedAt < placedTo`. Both arguments must be RFC 3339 timestamps with at most millisecond precision. Maximum range is 31 days. Unplaced carts are excluded. Placement time is recorded when customer submits order, so carts created before range are still returned if submitted inside range.

For orders placed before placement timestamps were introduced, enyDyne uses order creation time as historical approximation.

At most 1,000 orders can be returned. Use smaller adjacent ranges if response reports more than 1,000 orders.

One request can select `orders` once. Queries are limited to 100 selected fields and nesting depth 10. Split larger queries into separate requests.

```graphql
query ReceiptOrders($from: String!, $to: String!) {
  restaurant {
    slug
    display
    address
    vatId
  }
  orders(placedFrom: $from, placedTo: $to) {
    id
    restaurantName
    createdAt
    placedAt
    pickupTime
    status
    paidAt
    paymentMethod
    refundStatus
    refundUpdatedAt
    total
    customer {
      id
      name
      displayName
      email
    }
    items {
      name
      description
      notes
      unitPrice
      quantity
      total
      taxRateSplits {
        taxRateBasisPoints
        percentageBasisPoints
      }
      toppings {
        title
        description
        price
        taxRateBasisPoints
      }
    }
    invoice {
      lines {
        name
        description
        quantity
        notes
        taxRateBasisPoints
        net
        tax
        gross
      }
      taxBuckets {
        taxRateBasisPoints
        net
        tax
        gross
      }
      totalNet
      totalTax
      totalGross
    }
  }
}
```

Example request:

```bash
curl "$ENYDYNE_ORIGIN/api/graphql" \
  --request POST \
  --header "Authorization: Bearer $ENYDYNE_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "query": "query ReceiptOrders($from: String!, $to: String!) { restaurant { display address vatId } orders(placedFrom: $from, placedTo: $to) { id createdAt placedAt pickupTime status total items { name unitPrice quantity total } invoice { totalNet totalTax totalGross } } }",
    "variables": {
      "from": "2026-07-27T00:00:00Z",
      "to": "2026-07-28T00:00:00Z"
    }
  }'
```

## Money and Tax

`Money` values are integer euro cents. `1299` means EUR 12.99.

Tax rates and percentages use basis points:

- `700` tax basis points means 7%.
- `1900` tax basis points means 19%.
- `10000` percentage basis points means 100% of item value.

`unitPrice` already includes selected topping prices. Do not add topping prices again when calculating order total. Toppings remain available for receipt detail.

Use `invoice` fields for receipt totals and tax breakdown. enyDyne calculates these values with same cent allocation and rounding used by built-in invoice renderer. `invoice.lines` can contain multiple tax lines for one order item when item uses split tax rates.

## Status Values

Order status is one of:

```text
PLACED
PREPARING
READY
DONE
DROPPED
```

Refund status is one of:

```text
NONE
REQUESTED
SUCCEEDED
FAILED
```

## Errors

Missing, malformed, unknown, or revoked keys return HTTP `401`:

```json
{
  "errors": [{ "message": "unauthorized" }]
}
```

Valid GraphQL requests return standard `data` and `errors` fields. Validation and resolver errors normally use HTTP `200`, following GraphQL response conventions.

Responses use `Cache-Control: no-store`.

<!--
Sitemap

URL: https://docs.enydyne.de/index.md
Title: enyDyne API
Description: Integration documentation for the enyDyne restaurant platform.

URL: https://docs.enydyne.de/api-keys.md
Title: API Keys
Description: Create, use, and revoke restaurant API keys.

URL: https://docs.enydyne.de/graphql.md
Title: GraphQL API
Description: Query restaurant-scoped order data.
-->
