Back to Home

Developer Documentation

API Reference & Integration Guide

Introduction

The Allio API provides programmatic access to your orders, customers, products, bookings, reviews, and inbox. Use it to integrate Allio with your existing systems, CRM, booking tools, or build custom applications.

Base URL:https://api.allio.dk
API Version:v1

Authentication

All API requests require authentication using a Bearer token. You can generate API keys from your Settings page under the "API Keys" section.

Include your API key in the Authorization header:

curl -X GET "https://api.allio.dk/v1/orders" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"

The key can also be sent in an X-API-Key header. A key only ever gives access to data belonging to the organization of the user who created it.

Important: Keep your API keys secure. Never expose them in client-side code or public repositories. If a key is compromised, revoke it immediately and generate a new one.

Rate Limiting

API requests are limited to 100 requests per 60 seconds per API key. If you exceed this limit, you'll receive a 429 Too Many Requests response.

{
  "success": false,
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Too many requests. Please wait before retrying."
  }
}

Response Format

All API responses are returned in JSON format with a consistent structure:

{
  "success": true,
  "data": { ... },
  "meta": {
    "page": 1,
    "limit": 20,
    "total": 42
  }
}

HTTP Status Codes

CodeDescription
200Success
201Resource created
400Bad request / Validation error
401Unauthorized / Invalid API key
403Forbidden / Feature not enabled for the organization
404Resource not found
409Conflict (e.g. the time slot is no longer available)
422Request is valid JSON but violates business rules
429Rate limit exceeded
500Internal server error

Orders

GET/v1/orders

Retrieve a list of your orders with optional filtering and pagination.

Parameters
NameTypeDescription
limitintegerNumber of results to return (default: 20, max: 100)
pageintegerPage number for pagination (default: 1)
statusstringFilter by status: pending, paid, cancelled
Request
curl -X GET "https://api.allio.dk/v1/orders?limit=10&page=1" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"
Response
{
  "success": true,
  "data": [
    {
      "id": "ord_123abc",
      "customer_name": "John Doe",
      "customer_email": "john@example.com",
      "total_amount": 62500,
      "status": "paid",
      "payment_link": "https://pay.allio.dk/abc123",
      "created_at": "2026-01-15T10:30:00Z"
    }
  ],
  "meta": { "page": 1, "limit": 10, "total": 42 }
}
GET/v1/orders/:id

Retrieve a single order by its ID, including order items.

Request
curl -X GET "https://api.allio.dk/v1/orders/ord_123abc" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"
Response
{
  "success": true,
  "data": {
    "id": "ord_123abc",
    "customer_name": "John Doe",
    "customer_email": "john@example.com",
    "customer_id": "cus_456def",
    "total_amount": 62500,
    "status": "paid",
    "payment_link": "https://pay.allio.dk/abc123",
    "payment_method": "card",
    "paid_at": "2026-01-15T11:45:00Z",
    "created_at": "2026-01-15T10:30:00Z",
    "items": [
      { "id": "item_789", "description": "Oil change", "quantity": 1, "amount": 50000 }
    ]
  }
}
POST/v1/orders

Create a new order with automatic payment link generation. Returns a ready-to-share payment link and QR code URL.

Parameters
NameTypeDescription
customer_idstringID of an existing customer (optional if name/email provided)
customer_name*stringCustomer name (required if no customer_id)
customer_email*stringCustomer email (required if no customer_id)
items*arrayArray of order items
items[].description*stringItem description
items[].amount*integerItem price in øre (ex. VAT)
items[].quantityintegerItem quantity (default: 1)
items[].product_idstringLink to existing product (optional)
generate_payment_linkbooleanGenerate Stripe payment link (default: true)
Request
curl -X POST "https://api.allio.dk/v1/orders" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_name": "John Doe",
    "customer_email": "john@example.com",
    "items": [
      { "description": "Olieskift", "amount": 50000, "quantity": 1 }
    ]
  }'
Response
{
  "success": true,
  "data": {
    "id": "ord_neworder123",
    "customer_name": "John Doe",
    "customer_email": "john@example.com",
    "status": "pending",
    "total_amount": 62500,
    "payment_link": "https://pay.allio.dk/abc123",
    "stripe_checkout_url": "https://checkout.stripe.com/c/pay/...",
    "qr_code_url": "https://api.allio.dk/v1/orders/ord_neworder123/qr",
    "created_at": "2026-01-29T14:00:00Z"
  }
}
PATCH/v1/orders/:id

Update an order's status.

Parameters
NameTypeDescription
statusstringNew status: pending, paid, cancelled
Request
curl -X PATCH "https://api.allio.dk/v1/orders/ord_123" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "status": "cancelled" }'
Response
{
  "success": true,
  "data": {
    "id": "ord_123",
    "status": "cancelled",
    "total_amount": 62500,
    "created_at": "2026-01-29T14:00:00Z"
  }
}
DELETE/v1/orders/:id

Delete a pending order. Paid orders cannot be deleted.

Request
curl -X DELETE "https://api.allio.dk/v1/orders/ord_123" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"
Response
{
  "success": true,
  "data": { "deleted": true, "id": "ord_123" }
}
GET/v1/orders/:id/qr

Generate a QR code for the order's payment link.

Parameters
NameTypeDescription
sizeintegerQR code size in pixels (default: 300, max: 1000)
Request
curl -X GET "https://api.allio.dk/v1/orders/ord_123/qr?size=400" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"
Response
{
  "success": true,
  "data": {
    "qr_code_base64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEU...",
    "payment_link": "https://pay.allio.dk/abc123"
  }
}
POST/v1/orders/:id/send

Mark payment link as sent (integrates with your notification system).

Parameters
NameTypeDescription
channelstringNotification channel: email or sms (default: email)
Request
curl -X POST "https://api.allio.dk/v1/orders/ord_123/send" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "channel": "email" }'
Response
{
  "success": true,
  "data": {
    "sent_via": "email",
    "sent_at": "2026-01-30T14:00:00Z"
  }
}

Customers

GET/v1/customers

Retrieve a list of your organization's customers with optional search and pagination.

Parameters
NameTypeDescription
limitintegerNumber of results to return (default: 20, max: 100)
pageintegerPage number for pagination (default: 1)
searchstringSearch by name, email, or phone
Request
curl -X GET "https://api.allio.dk/v1/customers?limit=20" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"
Response
{
  "success": true,
  "data": [
    {
      "id": "cus_456def",
      "first_name": "John",
      "last_name": "Doe",
      "name": "John Doe",
      "email": "john@example.com",
      "phone": "+4512345678",
      "sms_opt_in": true,
      "email_opt_in": true,
      "created_at": "2026-01-10T09:00:00Z"
    }
  ],
  "meta": { "page": 1, "limit": 20, "total": 156 }
}
GET/v1/customers/:id

Retrieve a single customer by their ID.

Request
curl -X GET "https://api.allio.dk/v1/customers/cus_456def" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"
Response
{
  "success": true,
  "data": {
    "id": "cus_456def",
    "first_name": "John",
    "last_name": "Doe",
    "name": "John Doe",
    "email": "john@example.com",
    "phone": "+4512345678",
    "address": "123 Main Street, Copenhagen",
    "cvr_number": null,
    "is_company": false,
    "sms_opt_in": true,
    "email_opt_in": false,
    "created_at": "2026-01-10T09:00:00Z"
  }
}
POST/v1/customers

Create a new customer. Customers are shared across your organization: the customer is owned by the organization (not the team member whose API key is used), and an email or phone number that already belongs to a customer in the organization returns 409 with the existing customer id — whether that customer was created in Allio or via the API.

Parameters
NameTypeDescription
first_name*stringCustomer first name
last_name*stringCustomer last name
email*stringCustomer email address
phonestringCustomer phone number
addressstringCustomer address
cvr_numberstringDanish CVR number (for companies)
sms_opt_inbooleanMarketing permission: SMS campaigns and marketing automations. Does not affect SMS about bookings (see sms_consent on bookings). Default: true, as for customers created in Allio
email_opt_inbooleanMarketing permission: e-mail campaigns and marketing automations. Default: true
Request
curl -X POST "https://api.allio.dk/v1/customers" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "first_name": "Jane",
    "last_name": "Smith",
    "email": "jane@example.com",
    "phone": "+4587654321",
    "sms_opt_in": true,
    "email_opt_in": false
  }'
Response
{
  "success": true,
  "data": {
    "id": "cus_newcust789",
    "first_name": "Jane",
    "last_name": "Smith",
    "name": "Jane Smith",
    "email": "jane@example.com",
    "phone": "+4587654321",
    "sms_opt_in": true,
    "email_opt_in": false,
    "created_at": "2026-01-29T14:30:00Z"
  }
}
PATCH/v1/customers/:id

Update an existing customer's information. Send only the fields you want to change. A customer who opted out of SMS themselves (replied STOP) cannot be opted back in via the API: sms_opt_in: true then returns 409 CUSTOMER_OPTED_OUT and nothing is changed.

Parameters
NameTypeDescription
first_namestringCustomer first name
last_namestringCustomer last name
emailstringCustomer email
phonestringCustomer phone number
addressstringCustomer address
sms_opt_inbooleanMarketing permission: SMS campaigns and marketing automations. Does not affect SMS about bookings
email_opt_inbooleanMarketing permission: e-mail campaigns and marketing automations
Request
curl -X PATCH "https://api.allio.dk/v1/customers/cus_456def" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "phone": "+4599887766", "sms_opt_in": false }'
Response
{
  "success": true,
  "data": {
    "id": "cus_456def",
    "first_name": "John",
    "last_name": "Doe",
    "email": "john@example.com",
    "phone": "+4599887766",
    "sms_opt_in": false,
    "email_opt_in": true,
    "created_at": "2026-01-10T09:00:00Z"
  }
}
DELETE/v1/customers/:id

Delete a customer (soft delete - customer data is retained for order history).

Request
curl -X DELETE "https://api.allio.dk/v1/customers/cus_456def" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"
Response
{
  "success": true,
  "data": { "deleted": true, "id": "cus_456def" }
}
GET/v1/customers/:id/orders

Retrieve all orders for a specific customer.

Parameters
NameTypeDescription
limitintegerNumber of results (default: 20, max: 100)
pageintegerPage number (default: 1)
statusstringFilter by status: pending, paid
Request
curl -X GET "https://api.allio.dk/v1/customers/cus_456def/orders?status=paid" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"
Response
{
  "success": true,
  "data": [
    {
      "id": "ord_123abc",
      "customer_name": "John Doe",
      "total_amount": 62500,
      "status": "paid",
      "payment_link": "https://pay.allio.dk/abc123",
      "created_at": "2026-01-15T10:30:00Z",
      "paid_at": "2026-01-15T11:45:00Z"
    }
  ],
  "meta": { "page": 1, "limit": 20, "total": 5 }
}

Products

GET/v1/products

Retrieve a list of your products with optional pagination.

Parameters
NameTypeDescription
limitintegerNumber of results to return (default: 20, max: 100)
pageintegerPage number for pagination (default: 1)
Request
curl -X GET "https://api.allio.dk/v1/products?limit=50" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"
Response
{
  "success": true,
  "data": [
    {
      "id": "prod_abc123",
      "name": "Oil Change",
      "description": "Standard oil change service",
      "price": 50000,
      "unit": "stk",
      "service_interval_months": 12,
      "created_at": "2026-01-05T08:00:00Z"
    }
  ],
  "meta": { "page": 1, "limit": 50, "total": 23 }
}
POST/v1/products

Create a new product.

Parameters
NameTypeDescription
name*stringProduct name
price*integerPrice in øre (ex. VAT)
descriptionstringProduct description
unitstringUnit type (default: stk)
service_interval_monthsintegerService interval in months
Request
curl -X POST "https://api.allio.dk/v1/products" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Premium Olieskift",
    "description": "Inkl. kvalitetsolie og filter",
    "price": 89900,
    "unit": "stk",
    "service_interval_months": 12
  }'
Response
{
  "success": true,
  "data": {
    "id": "prod_new123",
    "name": "Premium Olieskift",
    "description": "Inkl. kvalitetsolie og filter",
    "price": 89900,
    "unit": "stk",
    "service_interval_months": 12,
    "created_at": "2026-01-29T14:00:00Z"
  }
}
PATCH/v1/products/:id

Update an existing product.

Parameters
NameTypeDescription
namestringProduct name
priceintegerPrice in øre
descriptionstringProduct description
Request
curl -X PATCH "https://api.allio.dk/v1/products/prod_abc123" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "price": 55000 }'
Response
{
  "success": true,
  "data": {
    "id": "prod_abc123",
    "name": "Oil Change",
    "price": 55000,
    "created_at": "2026-01-05T08:00:00Z"
  }
}
DELETE/v1/products/:id

Delete a product permanently.

Request
curl -X DELETE "https://api.allio.dk/v1/products/prod_abc123" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"
Response
{
  "success": true,
  "data": { "deleted": true, "id": "prod_abc123" }
}

Reviews

Access and manage your Google Business reviews programmatically. Requires an active Google Business integration.

GET/v1/reviews

Retrieve a list of your Google Business reviews.

Parameters
NameTypeDescription
limitintegerNumber of results (default: 20, max: 100)
pageintegerPage number (default: 1)
min_ratingintegerMinimum star rating (1-5)
has_replybooleanFilter by reply status (true/false)
Request
curl -X GET "https://api.allio.dk/v1/reviews?min_rating=4" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"
Response
{
  "success": true,
  "data": [
    {
      "id": "rev_abc123",
      "google_review_id": "AbCdEf...",
      "reviewer_name": "John Doe",
      "reviewer_photo_url": "https://...",
      "star_rating": 5,
      "comment": "Fantastisk service!",
      "reply_comment": "Tak for din anmeldelse!",
      "reply_update_time": "2026-01-30T14:00:00Z",
      "create_time": "2026-01-28T10:00:00Z"
    }
  ],
  "meta": { "page": 1, "limit": 20, "total": 42 }
}
GET/v1/reviews/:id

Retrieve a single review by its ID.

Request
curl -X GET "https://api.allio.dk/v1/reviews/rev_abc123" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"
Response
{
  "success": true,
  "data": {
    "id": "rev_abc123",
    "google_review_id": "AbCdEf...",
    "reviewer_name": "John Doe",
    "star_rating": 5,
    "comment": "Fantastisk service!",
    "reply_comment": null,
    "create_time": "2026-01-28T10:00:00Z"
  }
}
POST/v1/reviews/:id/reply

Reply to a review. The reply will be synced to Google.

Parameters
NameTypeDescription
comment*stringReply text
Request
curl -X POST "https://api.allio.dk/v1/reviews/rev_abc123/reply" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "comment": "Tak for din anmeldelse! Vi sætter pris på din feedback." }'
Response
{
  "success": true,
  "data": {
    "id": "rev_abc123",
    "reply_comment": "Tak for din anmeldelse! Vi sætter pris på din feedback.",
    "reply_update_time": "2026-01-30T14:00:00Z"
  }
}
GET/v1/reviews/stats

Get review statistics including rating distribution.

Request
curl -X GET "https://api.allio.dk/v1/reviews/stats" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"
Response
{
  "success": true,
  "data": {
    "total_reviews": 156,
    "average_rating": 4.7,
    "rating_distribution": {
      "5": 120,
      "4": 25,
      "3": 8,
      "2": 2,
      "1": 1
    },
    "reviews_this_month": 12,
    "replied_count": 140,
    "unreplied_count": 16
  }
}

Inbox

Access your unified inbox across all channels (email, SMS, Messenger, Instagram).

GET/v1/inbox/threads

Retrieve a list of conversation threads.

Parameters
NameTypeDescription
limitintegerNumber of results (default: 20, max: 100)
pageintegerPage number (default: 1)
channelstringFilter by channel: email, sms, messenger, instagram, all
statusstringFilter by status: open, closed, all
customer_idstringFilter by customer ID
Request
curl -X GET "https://api.allio.dk/v1/inbox/threads?channel=email&status=open" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"
Response
{
  "success": true,
  "data": [
    {
      "thread_id": "email_abc123",
      "channel": "email",
      "subject": "Spørgsmål om service",
      "customer_id": "cus_xxx",
      "customer_name": "John Doe",
      "message_count": 5,
      "unread_count": 1,
      "is_closed": false,
      "latest_message": {
        "id": "msg_123",
        "direction": "inbound",
        "body": "Hvornår kan I tage min bil?",
        "received_at": "2026-01-30T10:00:00Z"
      },
      "created_at": "2026-01-28T08:00:00Z"
    }
  ],
  "meta": { "page": 1, "limit": 20, "total": 28 }
}
GET/v1/inbox/threads/:id

Retrieve all messages in a conversation thread.

Request
curl -X GET "https://api.allio.dk/v1/inbox/threads/email_abc123" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"
Response
{
  "success": true,
  "data": {
    "thread_id": "email_abc123",
    "channel": "email",
    "subject": "Spørgsmål om service",
    "customer_id": "cus_xxx",
    "is_closed": false,
    "messages": [
      {
        "id": "msg_001",
        "direction": "inbound",
        "from_address": "kunde@example.com",
        "to_address": "mekaniker@example.com",
        "subject": "Spørgsmål om service",
        "body": "Hej, hvornår kan I tage min bil?",
        "is_read": true,
        "received_at": "2026-01-28T08:00:00Z"
      },
      {
        "id": "msg_002",
        "direction": "outbound",
        "from_address": "mekaniker@example.com",
        "to_address": "kunde@example.com",
        "subject": "Re: Spørgsmål om service",
        "body": "Vi kan tage den i morgen kl. 10.",
        "is_read": true,
        "received_at": "2026-01-28T09:30:00Z"
      }
    ]
  }
}
POST/v1/inbox/messages

Send a new message via email or SMS.

Parameters
NameTypeDescription
channel*stringChannel: email or sms
to*stringRecipient email or phone
subjectstringEmail subject (required for email)
body*stringMessage body
customer_idstringLink to customer
Request
curl -X POST "https://api.allio.dk/v1/inbox/messages" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "channel": "email",
    "to": "kunde@example.com",
    "subject": "Vedr. din ordre",
    "body": "Din ordre er klar til afhentning.",
    "customer_id": "cus_xxx"
  }'
Response
{
  "success": true,
  "data": {
    "id": "msg_xyz789",
    "channel": "email",
    "direction": "outbound",
    "to": "kunde@example.com",
    "subject": "Vedr. din ordre",
    "body": "Din ordre er klar til afhentning.",
    "sent_at": "2026-01-30T14:00:00Z"
  }
}
PATCH/v1/inbox/threads/:id

Update thread status (mark as read, close thread).

Parameters
NameTypeDescription
is_readbooleanMark all messages as read
is_closedbooleanClose/reopen the thread
Request
curl -X PATCH "https://api.allio.dk/v1/inbox/threads/email_abc123" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "is_read": true, "is_closed": true }'
Response
{
  "success": true,
  "data": {
    "thread_id": "email_abc123",
    "updated": { "is_read": true, "is_closed": true }
  }
}
GET/v1/inbox/stats

Get inbox statistics across all channels. Thread counts use the same threading model as the Inbox UI. A thread is closed only when all messages in that thread are closed.

Request
curl -X GET "https://api.allio.dk/v1/inbox/stats" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"
Response
{
  "success": true,
  "data": {
    "total_threads": 156,
    "open_threads": 12,
    "closed_threads": 144,
    "unread_messages": 5,
    "messages_today": 8,
    "channels": {
      "email": 89,
      "sms": 45,
      "messenger": 15,
      "instagram": 7
    }
  }
}

Bookings

Create, read, update and cancel bookings in Allio Booking. The API uses exactly the same booking rules as the Allio calendar: services, employees, opening hours, blocked times, buffers, resources and overlapping bookings are validated server-side, and the same confirmations, reminders and automations run as for bookings created in Allio.

Requirements: the organization must use Allio Booking as its booking system (not Gecko or Onlinebooq) and have booking set up. Otherwise every booking endpoint returns 403 NATIVE_BOOKING_DISABLED.

Times are ISO 8601 with a timezone offset (e.g. 2026-10-15T10:00:00+02:00) and are always returned in UTC. end_time and duration_minutes are computed from the selected services. Amounts are in øre (DKK cents).

Statuses: confirmed, completed, no_show, cancelled. Bookings imported from other systems are not part of this API.

GET/v1/bookings

List bookings, ordered by start time (or by updated_at when updated_since is used).

Parameters
NameTypeDescription
limitintegerNumber of results (default: 20, max: 100)
pageintegerPage number (default: 1)
statusstringComma-separated statuses, e.g. confirmed,completed
customer_idstringOnly bookings for this customer
employee_idstringOnly bookings for this employee
fromdatetimestart_time >= from
todatetimestart_time < to
updated_sincedatetimeOnly bookings changed since this time (for incremental sync)
Request
curl -X GET "https://api.allio.dk/v1/bookings?from=2026-10-01T00:00:00Z&status=confirmed" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"
Response
{
  "success": true,
  "data": [
    {
        "id": "8f0c2a1e-5b7d-4c3e-9a41-2d6f0b9e1c11",
        "customer_id": "3b9d6c0a-1e2f-4a5b-8c7d-9e0f1a2b3c4d",
        "customer_name": "Mette Hansen",
        "customer_email": "mette@example.com",
        "customer_phone": "+4512345678",
        "employee_id": "c2e4f6a8-0b1d-4f3e-8a5c-7e9f1b3d5a7c",
        "service_ids": ["a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"],
        "start_time": "2026-10-15T08:00:00.000Z",
        "end_time": "2026-10-15T09:00:00.000Z",
        "duration_minutes": 60,
        "status": "confirmed",
        "total_price_cents": 65000,
        "notes": "Booket via partner-integration",
        "created_at": "2026-10-11T10:30:00.000Z",
        "updated_at": "2026-10-11T10:30:00.000Z"
      }
  ],
  "meta": { "page": 1, "limit": 20, "total": 1 }
}
GET/v1/bookings/:id

Retrieve a single booking.

Request
curl -X GET "https://api.allio.dk/v1/bookings/8f0c2a1e-5b7d-4c3e-9a41-2d6f0b9e1c11" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"
Response
{
  "success": true,
  "data": {
    "id": "8f0c2a1e-5b7d-4c3e-9a41-2d6f0b9e1c11",
    "customer_id": "3b9d6c0a-1e2f-4a5b-8c7d-9e0f1a2b3c4d",
    "customer_name": "Mette Hansen",
    "customer_email": "mette@example.com",
    "customer_phone": "+4512345678",
    "employee_id": "c2e4f6a8-0b1d-4f3e-8a5c-7e9f1b3d5a7c",
    "service_ids": ["a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"],
    "start_time": "2026-10-15T08:00:00.000Z",
    "end_time": "2026-10-15T09:00:00.000Z",
    "duration_minutes": 60,
    "status": "confirmed",
    "total_price_cents": 65000,
    "notes": "Booket via partner-integration",
    "created_at": "2026-10-11T10:30:00.000Z",
    "updated_at": "2026-10-11T10:30:00.000Z"
  }
}
POST/v1/bookings

Create a booking. The customer receives the same confirmation as for bookings created in Allio. Returns 201 with the booking.

Parameters
NameTypeDescription
customer_id*stringExisting customer (create one with POST /v1/customers). Same identity rules as booking in the calendar.
service_ids*string[]One or more service IDs, in order (max 20)
start_time*datetimeStart time with timezone offset
employee_idstringEmployee to book. Omit for a clinic-wide booking (same as in the calendar).
notesstringInternal notes (max 5000 characters)
allow_outside_opening_hoursbooleanAllow booking outside opening hours, like staff can in the calendar (default: false)
sms_consentbooleanSMS about this booking: confirmation, reminders and reschedule notice (needs a phone number on the customer). Separate from the customer's marketing permission sms_opt_in; neither changes the other. Default: true, unless the customer has replied STOP
Request
curl -X POST "https://api.allio.dk/v1/bookings" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "3b9d6c0a-1e2f-4a5b-8c7d-9e0f1a2b3c4d",
    "service_ids": ["a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"],
    "start_time": "2026-10-15T10:00:00+02:00",
    "employee_id": "c2e4f6a8-0b1d-4f3e-8a5c-7e9f1b3d5a7c",
    "notes": "Booket via partner-integration",
    "sms_consent": true
  }'
Response
{
  "success": true,
  "data": {
    "id": "8f0c2a1e-5b7d-4c3e-9a41-2d6f0b9e1c11",
    "customer_id": "3b9d6c0a-1e2f-4a5b-8c7d-9e0f1a2b3c4d",
    "customer_name": "Mette Hansen",
    "customer_email": "mette@example.com",
    "customer_phone": "+4512345678",
    "employee_id": "c2e4f6a8-0b1d-4f3e-8a5c-7e9f1b3d5a7c",
    "service_ids": ["a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"],
    "start_time": "2026-10-15T08:00:00.000Z",
    "end_time": "2026-10-15T09:00:00.000Z",
    "duration_minutes": 60,
    "status": "confirmed",
    "total_price_cents": 65000,
    "notes": "Booket via partner-integration",
    "created_at": "2026-10-11T10:30:00.000Z",
    "updated_at": "2026-10-11T10:30:00.000Z"
  }
}

// 409 when the slot was taken in the meantime
{
  "success": false,
  "error": {
    "code": "BOOKING_CONFLICT",
    "message": "Tidspunktet er ikke længere ledigt",
    "details": { "reason": "employee_not_available" }
  }
}
PATCH/v1/bookings/:id

Update a booking. Send only the fields you want to change. Changing start_time or employee_id reschedules the booking with the same availability checks as the calendar (rescheduling sets the status to confirmed; a cancelled booking must be reactivated with status first). Changes are applied in the order: time/employee, customer, notes, status. If a later step fails, error.details.applied lists the changes that were already saved.

Parameters
NameTypeDescription
start_timedatetimeNew start time (end time follows the booking duration)
employee_idstringMove the booking to another employee
statusstringconfirmed, completed, no_show or cancelled
customer_idstringAttach the booking to another customer of your organization
notesstring | nullReplace internal notes (null clears them)
notify_customerbooleanSend the reschedule SMS/email to the customer (default: false)
allow_double_bookingbooleanAllow the new time or employee to overlap another booking (default: false)
Request
curl -X PATCH "https://api.allio.dk/v1/bookings/8f0c2a1e-5b7d-4c3e-9a41-2d6f0b9e1c11" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "start_time": "2026-10-15T13:00:00+02:00", "notify_customer": true }'
Response
{
  "success": true,
  "data": {
    "id": "8f0c2a1e-5b7d-4c3e-9a41-2d6f0b9e1c11",
    "start_time": "2026-10-15T11:00:00.000Z",
    "end_time": "2026-10-15T12:00:00.000Z",
    "status": "confirmed",
    ...
  }
}
DELETE/v1/bookings/:id

Cancel a booking. Like “Aflys” in the Allio calendar, the booking is kept with status cancelled so history, statistics and automations remain intact. Calling DELETE on an already cancelled booking is a no-op and returns the booking.

Request
curl -X DELETE "https://api.allio.dk/v1/bookings/8f0c2a1e-5b7d-4c3e-9a41-2d6f0b9e1c11" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"
Response
{
  "success": true,
  "data": {
    "id": "8f0c2a1e-5b7d-4c3e-9a41-2d6f0b9e1c11",
    "status": "cancelled",
    ...
  }
}

Statistics

GET/v1/stats

Get dashboard statistics including order counts and revenue.

Request
curl -X GET "https://api.allio.dk/v1/stats" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"
Response
{
  "success": true,
  "data": {
    "orders_today": 5,
    "revenue_today": 245000,
    "orders_this_month": 42,
    "revenue_this_month": 1850000,
    "pending_orders": 3,
    "total_customers": 156
  }
}

Webhooks

Subscribe to real-time events using webhooks. You can register webhooks via the API or in your settings.

Available Events

EventDescription
order.createdNew order created
order.paidOrder payment received
order.cancelledOrder cancelled
customer.createdNew customer created
payment_link.clickedPayment link viewed
message.receivedNew message received in inbox
message.sentMessage sent from inbox
review.receivedNew Google review received
review.repliedReview reply sent
booking.createdA booking was created (Allio calendar, online booking, the API or Allio's assistant)
booking.updatedTime, employee, services, customer, status, price or notes of a booking changed
booking.deletedA booking was cancelled or deleted

Event format

Every delivery is an HTTPS POST with a JSON body and these headers: X-Allio-Event, X-Allio-Event-Id, X-Allio-Timestamp, X-Allio-Signature, X-Allio-Webhook-Id, X-Allio-Delivery-Attempt.

{
  "id": "evt_5d0f3c9a-8b1e-4a7c-9f2d-6e4b1a0c3d57",
  "type": "booking.updated",
  "created_at": "2026-10-11T10:30:00.000Z",
  "data": { ... },
  "previous_attributes": { ... }
}

Booking payloads

data is the booking in the same format as GET /v1/bookings/:id. Booking events are generated centrally in Allio, so they fire no matter where the change was made. An update that does not change any of the booking fields (e.g. a reminder being sent) does not produce an event.

  • booking.updated includes previous_attributes with the old values of the changed fields only.
  • booking.deleted includes data.deletion_type: cancelled (status changed to cancelled — the booking still exists) or deleted (permanently removed). A cancelled booking that is later removed does not produce a second event.
  • Reactivating a cancelled booking produces booking.updated.
{
  "id": "evt_5d0f3c9a-8b1e-4a7c-9f2d-6e4b1a0c3d57",
  "type": "booking.updated",
  "created_at": "2026-10-11T10:30:00.000Z",
  "data": {
    "id": "8f0c2a1e-5b7d-4c3e-9a41-2d6f0b9e1c11",
    "customer_id": "3b9d6c0a-1e2f-4a5b-8c7d-9e0f1a2b3c4d",
    "customer_name": "Mette Hansen",
    "customer_email": "mette@example.com",
    "customer_phone": "+4512345678",
    "employee_id": "c2e4f6a8-0b1d-4f3e-8a5c-7e9f1b3d5a7c",
    "service_ids": ["a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"],
    "start_time": "2026-10-15T08:00:00.000Z",
    "end_time": "2026-10-15T09:00:00.000Z",
    "duration_minutes": 60,
    "status": "confirmed",
    "total_price_cents": 65000,
    "notes": "Booket via partner-integration",
    "created_at": "2026-10-11T10:30:00.000Z",
    "updated_at": "2026-10-11T10:30:00.000Z"
  },
  "previous_attributes": {
    "start_time": "2026-10-15T07:00:00.000Z",
    "end_time": "2026-10-15T08:00:00.000Z"
  }
}

Verifying signatures

Each request is signed with HMAC-SHA256. The signed message is {X-Allio-Timestamp}.{raw request body} and the key is the SHA-256 hex digest of your webhook secret (the whsec_… value shown once when the webhook was created). Always use the raw body bytes — not a re-serialized JSON object — compare in constant time, and reject timestamps older than 5 minutes.

// Node.js / Express
const crypto = require('crypto');

app.post('/allio-webhooks', express.raw({ type: 'application/json' }), (req, res) => {
  const timestamp = req.get('X-Allio-Timestamp');
  const signature = req.get('X-Allio-Signature') || '';
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return res.sendStatus(400);

  const key = crypto.createHash('sha256').update(process.env.ALLIO_WEBHOOK_SECRET).digest('hex');
  const expected = 'sha256=' + crypto.createHmac('sha256', key)
    .update(`${timestamp}.${req.body.toString('utf8')}`)
    .digest('hex');

  const valid = signature.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
  if (!valid) return res.sendStatus(401);

  const event = JSON.parse(req.body.toString('utf8'));
  // Deduplicate on event.id before processing
  res.sendStatus(200);
});
# Python
import hashlib, hmac, time

def verify_allio_webhook(raw_body: bytes, timestamp: str, signature: str, secret: str) -> bool:
    if abs(time.time() - int(timestamp)) > 300:
        return False
    key = hashlib.sha256(secret.encode()).hexdigest().encode()
    expected = "sha256=" + hmac.new(key, f"{timestamp}.".encode() + raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, signature)

Retries & idempotency

  • Respond with any 2xx status within 10 seconds. Redirects are not followed.
  • Booking events are delivered asynchronously (normally within a minute) and retried with exponential backoff after 30 s, 2 min, 10 min, 30 min, 1 h, 3 h, 6 h and 12 h (9 attempts, about 22 hours).
  • A retry has the same id / X-Allio-Event-Id and an identical body. Store processed event ids and ignore duplicates. Events may arrive out of order — use created_at and data.updated_at to discard stale updates.
  • After 3 events in a row have exhausted all retries, the webhook is deactivated. Re-enable it with PATCH /v1/webhooks/:id and {"is_active": true}.

Managing subscriptions

Webhooks can be managed in Settings or via the API (max 5 per account, HTTPS only). The secret is only returned once, when the webhook is created. Subscribing to booking.* events requires the same access as the Bookings API.

# Create
curl -X POST "https://api.allio.dk/v1/webhooks" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://example.com/allio-webhooks", "events": ["booking.created", "booking.updated", "booking.deleted"] }'

# Response (201)
{ "success": true, "data": { "id": "wh_…", "url": "https://example.com/allio-webhooks",
  "events": ["booking.created", "booking.updated", "booking.deleted"],
  "secret": "whsec_…", "is_active": true, "created_at": "2026-10-11T10:30:00Z" } }

# List / get (incl. the 20 most recent deliveries)
curl "https://api.allio.dk/v1/webhooks" -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"
curl "https://api.allio.dk/v1/webhooks/WEBHOOK_ID" -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"

# Change events or deactivate
curl -X PATCH "https://api.allio.dk/v1/webhooks/WEBHOOK_ID" \
  -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "events": ["booking.created"], "is_active": false }'

# Send a signed test event
curl -X POST "https://api.allio.dk/v1/webhooks/WEBHOOK_ID/test" -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"

# Delete
curl -X DELETE "https://api.allio.dk/v1/webhooks/WEBHOOK_ID" -H "Authorization: Bearer allio_sk_xxxxxxxxxxxxx"

Error Handling

When an error occurs, the API returns a JSON response with success: false and an error object containing details:

{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request body"
  }
}

Booking errors include error.details.reason with the precise cause (e.g. employee_not_available, resource_not_available, service_not_found, employee_cannot_perform_service, customer_identity_required), and validation errors include error.details.field.

Error Codes

CodeDescription
VALIDATION_ERRORRequest body validation failed
NOT_FOUNDRequested resource does not exist
UNAUTHORIZEDMissing or invalid API key
STRIPE_NOT_CONNECTEDStripe Connect not configured
GOOGLE_NOT_CONNECTEDGoogle Business not connected
RATE_LIMIT_EXCEEDEDToo many requests
FORBIDDENThe API key's user may not access this resource for the organization (HTTP 403)
NATIVE_BOOKING_DISABLEDAllio Booking is not enabled or set up for the organization (HTTP 403)
BOOKING_CONFLICTThe time is taken, blocked, or a required employee/resource is busy (HTTP 409)
BOOKING_CANCELLEDThe booking is cancelled and cannot be rescheduled (HTTP 409)
INVALID_BOOKING_TIMEOutside opening hours or an invalid booking time (HTTP 422)
BOOKING_ERRORThe booking operation failed unexpectedly (HTTP 500); see details.reason
METHOD_NOT_ALLOWEDHTTP method not supported for this endpoint (HTTP 405)
DUPLICATE_EMAILAn active customer in the organization already has this email — details.existing_customer_id holds its id (HTTP 409)
DUPLICATE_PHONEAn active customer in the organization already has this phone number — details.existing_customer_id holds its id (HTTP 409)
INTERNAL_ERRORUnexpected server error

Integration Use Cases

🗓️ Booking Systems

Sync bookings both ways with /v1/bookings and the booking.* webhooks. When a booking is confirmed, create an order with generate_payment_link: true to automatically generate a payment link and send it to your customer.

📊 CRM Integration

Sync customers, conversations, and order history between Allio and your CRM. Use webhooks to get real-time notifications when orders are paid or messages are received.

💬 Helpdesk Integration

Import inbox messages into your helpdesk or ticket system using the /v1/inbox endpoints.

⭐ Review Management

Build custom dashboards or automate responses using the /v1/reviews endpoints.

📱 POS Systems

Use the /v1/orders/:id/qr endpoint to generate QR codes for in-store payments.

⚡ Automation

Build custom workflows using webhooks. Trigger actions in your systems when orders are created, payments received, or messages arrive.

Support

Need help with the API? Contact us at support@allio.dk or visit the Settings page to manage your API keys.