{
    "openapi": "3.0.3",
    "info": {
        "title": "AppZet Billing Partner API",
        "version": "1.0.0",
        "description": "Read-only access to one restaurant's data with a key the owner makes under Settings > API keys. Send the key as 'Authorization: Bearer azk_live_...'. At most 60 calls a minute per key. Money is in rupees as numbers; dates are ISO 8601."
    },
    "servers": [
        {
            "url": "https://appzetsbilling.com/api/partner/v1"
        }
    ],
    "components": {
        "securitySchemes": {
            "bearerKey": {
                "type": "http",
                "scheme": "bearer",
                "description": "An AppZet partner API key."
            }
        }
    },
    "paths": {
        "/me": {
            "get": {
                "operationId": "me",
                "summary": "About this key",
                "description": "Returns the key's name, the shop, what the key may read and when it expires. A quick way to test a new key.",
                "tags": [
                    "key"
                ],
                "security": [
                    {
                        "bearerKey": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "name": "Accountant tool",
                                        "shop": "Bamboo Kitchen",
                                        "scopes": [
                                            "bills",
                                            "payments"
                                        ],
                                        "expires_at": null
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "The key is missing, not valid, switched off or expired.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "error": {
                                        "code": "invalid_key",
                                        "message": "The API key is missing or not valid."
                                    }
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key may not read this, or the shop's plan does not include the Partner API.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "error": {
                                        "code": "scope",
                                        "message": "This key may not read 'bills'."
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "More than 60 calls in a minute. Wait and try again."
                    }
                }
            }
        },
        "/menu": {
            "get": {
                "operationId": "menu",
                "summary": "The menu and prices",
                "description": "Every item that is on the menu with its category, price (or sizes) and whether it can be sold right now (serving hours, out of stock today and combo parts are considered). Needs the 'menu' tick on the key.",
                "tags": [
                    "menu"
                ],
                "security": [
                    {
                        "bearerKey": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": [
                                        {
                                            "id": 12,
                                            "name": "Chicken biryani",
                                            "category": "Main course",
                                            "menu": "Lunch",
                                            "price": 280,
                                            "price_type": "single",
                                            "sold_by": "piece",
                                            "is_combo": false,
                                            "sizes": [],
                                            "available": true
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "The key is missing, not valid, switched off or expired.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "error": {
                                        "code": "invalid_key",
                                        "message": "The API key is missing or not valid."
                                    }
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key may not read this, or the shop's plan does not include the Partner API.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "error": {
                                        "code": "scope",
                                        "message": "This key may not read 'bills'."
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "More than 60 calls in a minute. Wait and try again."
                    }
                }
            }
        },
        "/bills": {
            "get": {
                "operationId": "bills",
                "summary": "Bills",
                "description": "Finished bills with items, payments and refunds, oldest first. At most 93 days at a time; the last 30 days when no dates are given. customer_id is included only when the key may also read customers. Needs the 'bills' tick on the key.",
                "tags": [
                    "bills"
                ],
                "security": [
                    {
                        "bearerKey": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": [
                                        {
                                            "id": 1043,
                                            "invoice_number": "BK/26-27/1043",
                                            "date": "2026-10-30T13:05:00+05:30",
                                            "type": "dine_in",
                                            "status": "completed",
                                            "total": 420,
                                            "paid": 420,
                                            "due": 0,
                                            "gst": 20,
                                            "discount": 0,
                                            "items": [
                                                {
                                                    "product_id": 12,
                                                    "name": "Chicken biryani",
                                                    "quantity": 1,
                                                    "unit_price": 280
                                                }
                                            ],
                                            "payments": [
                                                {
                                                    "method": "UPI",
                                                    "amount": 420
                                                }
                                            ],
                                            "refunds": []
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 50,
                                        "total": 1,
                                        "pages": 1
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "The key is missing, not valid, switched off or expired.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "error": {
                                        "code": "invalid_key",
                                        "message": "The API key is missing or not valid."
                                    }
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key may not read this, or the shop's plan does not include the Partner API.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "error": {
                                        "code": "scope",
                                        "message": "This key may not read 'bills'."
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "More than 60 calls in a minute. Wait and try again."
                    }
                },
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "First day, YYYY-MM-DD.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "Last day, YYYY-MM-DD.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "completed (default), void or all.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, from 1.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Rows per page, 1 to 100 (default 50).",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ]
            }
        },
        "/bills/{id}": {
            "get": {
                "operationId": "bill",
                "summary": "One bill",
                "description": "One bill by its id, with the same fields as the list. 404 when it is not this shop's. Needs the 'bills' tick on the key.",
                "tags": [
                    "bills"
                ],
                "security": [
                    {
                        "bearerKey": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "id": 1043,
                                        "invoice_number": "BK/26-27/1043",
                                        "total": 420
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "The key is missing, not valid, switched off or expired.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "error": {
                                        "code": "invalid_key",
                                        "message": "The API key is missing or not valid."
                                    }
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key may not read this, or the shop's plan does not include the Partner API.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "error": {
                                        "code": "scope",
                                        "message": "This key may not read 'bills'."
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "More than 60 calls in a minute. Wait and try again."
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The bill id.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ]
            }
        },
        "/stock": {
            "get": {
                "operationId": "stock",
                "summary": "Stock levels",
                "description": "Ready items (cakes, packs, bottles) with their counts, and ingredients with their quantities and alert levels. Needs the 'stock' tick on the key.",
                "tags": [
                    "stock"
                ],
                "security": [
                    {
                        "bearerKey": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "ready_items": [
                                            {
                                                "id": 31,
                                                "name": "Cola 500ml",
                                                "quantity": 24,
                                                "alert_at": 6
                                            }
                                        ],
                                        "ingredients": [
                                            {
                                                "id": 5,
                                                "name": "Basmati rice",
                                                "quantity": 18.5,
                                                "alert_at": 5,
                                                "unit": "kg"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "The key is missing, not valid, switched off or expired.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "error": {
                                        "code": "invalid_key",
                                        "message": "The API key is missing or not valid."
                                    }
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key may not read this, or the shop's plan does not include the Partner API.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "error": {
                                        "code": "scope",
                                        "message": "This key may not read 'bills'."
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "More than 60 calls in a minute. Wait and try again."
                    }
                }
            }
        },
        "/payment-types": {
            "get": {
                "operationId": "payment_types",
                "summary": "Payment types",
                "description": "The ways a customer can pay: cash, UPI, card and your own. Needs the 'payments' tick on the key.",
                "tags": [
                    "payments"
                ],
                "security": [
                    {
                        "bearerKey": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": [
                                        {
                                            "id": 1,
                                            "name": "Cash",
                                            "active": true
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "The key is missing, not valid, switched off or expired.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "error": {
                                        "code": "invalid_key",
                                        "message": "The API key is missing or not valid."
                                    }
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key may not read this, or the shop's plan does not include the Partner API.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "error": {
                                        "code": "scope",
                                        "message": "This key may not read 'bills'."
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "More than 60 calls in a minute. Wait and try again."
                    }
                }
            }
        },
        "/customers": {
            "get": {
                "operationId": "customers",
                "summary": "Customers",
                "description": "Customers with their offers consent. Customers who asked to be erased never appear. Needs the 'customers' tick on the key.",
                "tags": [
                    "customers"
                ],
                "security": [
                    {
                        "bearerKey": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": [
                                        {
                                            "id": 7,
                                            "name": "Priya Nair",
                                            "phone": "9876511201",
                                            "email": null,
                                            "offers_consent": "agreed",
                                            "created_at": "2026-09-02T10:11:00+05:30"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 50,
                                        "total": 1,
                                        "pages": 1
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "The key is missing, not valid, switched off or expired.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "error": {
                                        "code": "invalid_key",
                                        "message": "The API key is missing or not valid."
                                    }
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key may not read this, or the shop's plan does not include the Partner API.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "error": {
                                        "code": "scope",
                                        "message": "This key may not read 'bills'."
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "More than 60 calls in a minute. Wait and try again."
                    }
                },
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, from 1.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Rows per page, 1 to 100 (default 50).",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ]
            }
        }
    }
}