ordrestyring-skill/references/graphql-api.md

117 lines
1.7 KiB
Markdown

# Ordrestyring GraphQL API Reference
## Endpoint
- **GraphQL:** `https://graphql.ordrestyring.dk/graphql`
- **GraphiQL (interactive):** `https://graphql.ordrestyring.dk/graphiql`
## Authentication
Headers required:
```
Authorization: Bearer q3mjVDR6wAdPCvZT
X-Agreement-Id: 21528
Content-Type: application/json
```
## Pagination
Max 200 results per page. Use `first` and `offset` parameters.
## Main Queries
### Cases (Sager)
```graphql
query {
cases(first: 10, offset: 0) {
totalCount
nodes {
id
caseNumber
title
status
customer { id name }
createdAt
}
}
}
```
### Customers (Kunder)
```graphql
query {
customers(first: 10) {
totalCount
nodes {
id
number
name
email
phone
address { street city zip }
}
}
}
```
### Time Entries (Timer)
```graphql
query {
timeEntries(first: 50) {
totalCount
nodes {
id
date
hours
description
case { id caseNumber }
worker { id name }
}
}
}
```
### Offers (Tilbud)
```graphql
query {
offers(first: 10) {
totalCount
nodes {
id
offerNumber
title
status
totalAmount
customer { id name }
}
}
}
```
### Workers (Medarbejdere)
```graphql
query {
workers(first: 50) {
totalCount
nodes {
id
name
email
phone
}
}
}
```
## Live Data Stats (March 2026)
- **Cases:** ~771
- **Customers:** ~1,038
- **Offers:** ~1,103
- **Time Entries:** ~7,517
## Notes
- Platform used by 30,000+ Danish craftsmen
- Features: cases, quotes, time registration, invoicing, materials inbox
- Missing from API: smart scheduling, AI email drafting (use web for these)