API reference
The MenuOrder public API is a REST API over the same data the studio and the till work from. Every call is scoped to the business that connected your integration, and to the permissions on your key.
Base URL
https://menu-order.com/api/v1
Every path below is relative to it. Responses are JSON, money is integer minor units with a currency code, and times are UTC.
Authentication
Create a key in the developer console and send it as a bearer token. An X-API-Key header works too.
curl https://menu-order.com/api/v1/me \ -H "Authorization: Bearer mk_live_your_key"
Sandbox keys
Start with mk_sandbox_… while you build and test. A business approves it exactly the way it approves a live key.
Live keys
mk_live_… for production traffic, once a business has connected you.
Connecting a business
A key says who is calling, never which business agreed to be called. Ask the business from the developer console using its storefront address; the owner approves the connection in their own settings, choosing nothing more than the permissions you asked for. Until then every business call answers 403 not_connected. The business can remove access at any time, and your key stops reading it at once.
Every business call names the business it is for: ?business=nonna-rosa.
One-click connect
This is the smooth way in, and the one to build a product on. The business clicks your button, approves your app on its own MenuOrder screen, and your server is handed a token for that one business. Nobody pastes a key and nobody waits for a request to be read.
1. Create your app credentials
In the developer console you get an app id and an app secret, and you register the address a business comes back to. The app id is public and goes in the link. The secret is shown once, stays on your server, and is only used on the token call.
2. Send the owner to your connect link
https://menu-order.com/api/v1/oauth/authorize \ ?app_id=mapp_1a2b3c4d5e6f7a8b \ &redirect_uri=https://app.swifttill.com/menuorder/callback \ &scope=menu:read \ &state=8f3c2a
The return address must match one you registered, character for character. state comes back untouched, so you can match the answer to the click that started it.
3. Take the code back to your server
The owner is sent to redirect_uri?code=…&state=…, or with error=access_denied if they decline. The code is good for ten minutes and works once.
4. Swap it for a token
curl https://menu-order.com/api/v1/oauth/token \ -d grant_type=authorization_code \ -d app_id=mapp_1a2b3c4d5e6f7a8b \ -d app_secret=msk_your_app_secret \ -d code=mac_the_code_you_were_given \ -d redirect_uri=https://app.swifttill.com/menuorder/callback
{
"access_token": "mat_…",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "mrt_…",
"scope": "menu:read",
"business": { "id": "…", "name": "Nonna Rosa", "slug": "nonna-rosa" }
}The access token lasts an hour and already names its business, so calls need no ?business=. Swap the refresh token for a new pair before it runs out; it lasts thirty days. Replacing your app secret revokes every token at once, and a business withdrawing access in its settings stops its token on the very next call.
Errors
A failed call answers with the HTTP status that explains it and the same shape every time.
{
"error": {
"code": "unauthorized",
"message": "That API key is missing, revoked, or not recognised."
}
}- 401 the key is missing, revoked or not recognised.
- 403 the key is valid but lacks the scope for this call.
- 404 the record does not exist, or is not visible to this key.
- 429 too many calls. Back off and retry.
Live now
GET/me
The developer, environment and scopes behind the key. Use it to check a key works before wiring it into your product.
{
"object": "developer",
"company_name": "SwiftTill POS",
"environment": "live",
"scopes": ["menu:read", "orders:read", "orders:write"],
"api_version": "v1"
}GET/menu?business=<storefront>
Every dish on the business's menu, grouped by course, with prices, sold-out flags and dietary notes. Needs the business's approval.
Scope: menu:read
{
"object": "menu",
"business": { "name": "Nonna Rosa", "slug": "nonna-rosa", "currency": "AUD" },
"categories": [
{
"name": "Pasta",
"items": [
{ "id": "…", "name": "Rigatoni", "price_cents": 2400, "sold_out": false }
]
}
],
"count": 1
}GET/oauth/authorize?app_id=…&redirect_uri=…&scope=…&state=…
The connect link a business clicks. It checks the app and its return address, then opens the approval screen for the owner.
https://menu-order.com/api/v1/oauth/authorize \ ?app_id=mapp_1a2b3c4d5e6f7a8b \ &redirect_uri=https://app.swifttill.com/menuorder/callback \ &scope=menu:read \ &state=8f3c2a
POST/oauth/token
Your server swaps the approved code for a one-hour access token, or swaps a refresh token for a fresh pair.
curl https://menu-order.com/api/v1/oauth/token \ -d grant_type=authorization_code \ -d app_id=mapp_1a2b3c4d5e6f7a8b \ -d app_secret=msk_your_app_secret \ -d code=mac_the_code_you_were_given \ -d redirect_uri=https://app.swifttill.com/menuorder/callback
Scopes
A key may only do what its scopes allow. Ask for the smallest set your integration needs.
Menu
- menu:readRead the menu, prices and availability
- menu:writeChange prices, availability and sold-out stock
Orders
- orders:readRead orders and their status history
- orders:writeCreate orders and move them through the kitchen
Kitchen
- kitchen:readRead the active kitchen tickets
- kitchen:writeBump and recall kitchen tickets
Tables
- tables:readRead the floor, tables and open sessions
- tables:writeOpen, move and close tables
Inventory
- inventory:readRead stock levels and movements
- inventory:writeRecord deliveries, counts, waste and adjustments
Staff
- staff:readRead staff and shifts
Payments
- payments:writeRecord counter payments and refunds
Customers
- loyalty:readRead customers, points and gift card balances
- loyalty:writeAdd points, redeem rewards and gift cards
Webhooks
- webhooks:manageCreate and remove webhook subscriptions
Planned for v1
These addresses are agreed but not answering yet. They are listed so you can plan the integration; nothing below should be called in production.
Menu
- GET /menu/items
- PATCH /menu/items/{id}/price
- PATCH /menu/items/{id}/stock
- PATCH /menu/items/{id}/availability
Orders
- POST /orders
- GET /orders
- GET /orders/{id}
- PATCH /orders/{id}/status
- POST /orders/{id}/items/{lineId}/done
Kitchen
- GET /kitchen/tickets
- POST /kitchen/tickets/{id}/bump
- GET /kitchen/ready
Tables
- GET /floor
- POST /tables/{id}/open
- POST /tables/{id}/close
- GET /table-sessions
Webhooks
- GET /webhooks
- POST /webhooks
- DELETE /webhooks/{id}
Events
order.createdorder.status_changedorder.cancelledorder.paidtable.openedtable.closedinventory.low_stockmenu.item.updated
Ready to call it?
Create a developer account, issue a key and check it against /v1/me.