{
  "openapi": "3.1.0",
  "info": {
    "title": "Daily Public API",
    "version": "1.0.0",
    "summary": "Read-only access to business data in Daily.",
    "description": "The Daily Public API provides authenticated, business-scoped, read-only access to operational data. All operations use HTTPS and bearer API keys.",
    "contact": {
      "name": "Daily support",
      "url": "https://wa.me/972523914844"
    }
  },
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
  "servers": [
    {
      "url": "https://api.godaily.co.il/v1",
      "description": "Production"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Business",
      "description": "Business identity and contact details."
    },
    {
      "name": "Customers",
      "description": "Customer records."
    },
    {
      "name": "Suppliers",
      "description": "Supplier records."
    },
    {
      "name": "Leads",
      "description": "Sales leads."
    },
    {
      "name": "Products",
      "description": "Products and raw materials."
    },
    {
      "name": "Documents",
      "description": "Business documents and temporary PDF links."
    },
    {
      "name": "Payments",
      "description": "Recorded document payments without sensitive payment credentials."
    },
    {
      "name": "Inventory",
      "description": "Inventory levels and movements."
    },
    {
      "name": "Tasks",
      "description": "Business tasks."
    }
  ],
  "paths": {
    "/business": {
      "get": {
        "tags": [
          "Business"
        ],
        "operationId": "getBusiness",
        "summary": "Retrieve the active business",
        "description": "Returns identity and public contact fields for the business bound to the authenticated API key.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-permission": "business:read",
        "x-required-permission-label": "פרטי העסק",
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Business"
                    },
                    "request_id": {
                      "$ref": "#/components/schemas/RequestId"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "0b703598-20d1-4eeb-9012-12db41ac8018",
                    "object": "business",
                    "name": "סטודיו נורת׳סטאר בע״מ",
                    "english_name": "Northstar Studio Ltd.",
                    "business_number": "515990281",
                    "business_type": "company",
                    "email": "finance@northstar.test",
                    "phone": "+972-3-555-0142",
                    "address": {
                      "street": "HaArba’a 28",
                      "city": "Tel Aviv-Yafo",
                      "postal_code": "6473925",
                      "country": "IL"
                    },
                    "created_at": "2025-02-03T08:30:00.000Z",
                    "updated_at": "2026-07-21T11:45:00.000Z"
                  },
                  "request_id": "req_docsquickstart01"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/customers": {
      "get": {
        "tags": [
          "Customers"
        ],
        "operationId": "listCustomers",
        "summary": "List customers",
        "description": "Searches customer name, business number, email, and contact person. Results are ordered by `updated_at` descending, then ID descending.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-permission": "customers:read",
        "x-required-permission-label": "לקוחות",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of objects to return. Defaults to 50.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque cursor returned in `page.next_cursor`. Do not construct or modify it.",
            "schema": {
              "type": "string",
              "maxLength": 512
            }
          },
          {
            "name": "created_after",
            "in": "query",
            "description": "Return objects created strictly after this ISO 8601 timestamp.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-07-01T00:00:00.000Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "description": "Return objects updated strictly after this ISO 8601 timestamp.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-07-01T00:00:00.000Z"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by public status.",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "inactive"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Case-insensitive resource search. Leading and trailing whitespace is removed.",
            "schema": {
              "type": "string",
              "maxLength": 100
            },
            "example": "Northstar"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "page",
                    "request_id"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Customer"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    },
                    "request_id": {
                      "$ref": "#/components/schemas/RequestId"
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "44f34dad-a427-4c65-ae26-b0a43f8f65f7",
                      "object": "customer",
                      "type": "customer",
                      "name": "Orion Retail",
                      "business_number": "515880391",
                      "contact_person": "Noa Levi",
                      "email": "billing@orion-retail.test",
                      "additional_emails": [
                        "ops@orion-retail.test"
                      ],
                      "phone": "+972-52-555-0128",
                      "phones": [
                        {
                          "value": "+972-52-555-0128",
                          "primary": true
                        }
                      ],
                      "address": {
                        "street": "HaArba’a",
                        "street_number": "28",
                        "city": "Tel Aviv-Yafo",
                        "postal_code": "6473925",
                        "country_code": "IL"
                      },
                      "status": "active",
                      "currency": "ILS",
                      "tags": [
                        "retail",
                        "priority"
                      ],
                      "created_at": "2025-06-17T09:20:00.000Z",
                      "updated_at": "2026-07-19T14:12:00.000Z"
                    }
                  ],
                  "page": {
                    "has_more": true,
                    "next_cursor": "eyJyZXNvdXJjZSI6ImN1c3RvbWVycyIsInYiOjF9"
                  },
                  "request_id": "req_docsquickstart01"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/customers/{id}": {
      "get": {
        "tags": [
          "Customers"
        ],
        "operationId": "getCustomer",
        "summary": "Retrieve a customer",
        "description": "Returns one customer owned by the authenticated business.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-permission": "customers:read",
        "x-required-permission-label": "לקוחות",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Resource UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    },
                    "request_id": {
                      "$ref": "#/components/schemas/RequestId"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "44f34dad-a427-4c65-ae26-b0a43f8f65f7",
                    "object": "customer",
                    "type": "customer",
                    "name": "Orion Retail",
                    "business_number": "515880391",
                    "contact_person": "Noa Levi",
                    "email": "billing@orion-retail.test",
                    "additional_emails": [
                      "ops@orion-retail.test"
                    ],
                    "phone": "+972-52-555-0128",
                    "phones": [
                      {
                        "value": "+972-52-555-0128",
                        "primary": true
                      }
                    ],
                    "address": {
                      "street": "HaArba’a",
                      "street_number": "28",
                      "city": "Tel Aviv-Yafo",
                      "postal_code": "6473925",
                      "country_code": "IL"
                    },
                    "status": "active",
                    "currency": "ILS",
                    "tags": [
                      "retail",
                      "priority"
                    ],
                    "created_at": "2025-06-17T09:20:00.000Z",
                    "updated_at": "2026-07-19T14:12:00.000Z"
                  },
                  "request_id": "req_docsquickstart01"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/suppliers": {
      "get": {
        "tags": [
          "Suppliers"
        ],
        "operationId": "listSuppliers",
        "summary": "List suppliers",
        "description": "Searches supplier name, business number, email, and contact person. Results are ordered by `updated_at` descending, then ID descending.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-permission": "suppliers:read",
        "x-required-permission-label": "ספקים",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of objects to return. Defaults to 50.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque cursor returned in `page.next_cursor`. Do not construct or modify it.",
            "schema": {
              "type": "string",
              "maxLength": 512
            }
          },
          {
            "name": "created_after",
            "in": "query",
            "description": "Return objects created strictly after this ISO 8601 timestamp.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-07-01T00:00:00.000Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "description": "Return objects updated strictly after this ISO 8601 timestamp.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-07-01T00:00:00.000Z"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by public status.",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "inactive"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Case-insensitive resource search. Leading and trailing whitespace is removed.",
            "schema": {
              "type": "string",
              "maxLength": 100
            },
            "example": "Northstar"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "page",
                    "request_id"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Supplier"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    },
                    "request_id": {
                      "$ref": "#/components/schemas/RequestId"
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "37b06123-d1d7-4978-a1c7-17ffdbeb1c49",
                      "object": "supplier",
                      "type": "supplier",
                      "name": "Atlas Office Supply",
                      "business_number": "515880391",
                      "contact_person": "Noa Levi",
                      "email": "accounts@atlas-supply.test",
                      "additional_emails": [
                        "ops@orion-retail.test"
                      ],
                      "phone": "+972-52-555-0128",
                      "phones": [
                        {
                          "value": "+972-52-555-0128",
                          "primary": true
                        }
                      ],
                      "address": {
                        "street": "HaArba’a",
                        "street_number": "28",
                        "city": "Tel Aviv-Yafo",
                        "postal_code": "6473925",
                        "country_code": "IL"
                      },
                      "status": "active",
                      "currency": "ILS",
                      "tags": [
                        "retail",
                        "priority"
                      ],
                      "created_at": "2025-06-17T09:20:00.000Z",
                      "updated_at": "2026-07-19T14:12:00.000Z"
                    }
                  ],
                  "page": {
                    "has_more": true,
                    "next_cursor": "eyJyZXNvdXJjZSI6ImN1c3RvbWVycyIsInYiOjF9"
                  },
                  "request_id": "req_docsquickstart01"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/suppliers/{id}": {
      "get": {
        "tags": [
          "Suppliers"
        ],
        "operationId": "getSupplier",
        "summary": "Retrieve a supplier",
        "description": "Returns one supplier owned by the authenticated business.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-permission": "suppliers:read",
        "x-required-permission-label": "ספקים",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Resource UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Supplier"
                    },
                    "request_id": {
                      "$ref": "#/components/schemas/RequestId"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "37b06123-d1d7-4978-a1c7-17ffdbeb1c49",
                    "object": "supplier",
                    "type": "supplier",
                    "name": "Atlas Office Supply",
                    "business_number": "515880391",
                    "contact_person": "Noa Levi",
                    "email": "accounts@atlas-supply.test",
                    "additional_emails": [
                      "ops@orion-retail.test"
                    ],
                    "phone": "+972-52-555-0128",
                    "phones": [
                      {
                        "value": "+972-52-555-0128",
                        "primary": true
                      }
                    ],
                    "address": {
                      "street": "HaArba’a",
                      "street_number": "28",
                      "city": "Tel Aviv-Yafo",
                      "postal_code": "6473925",
                      "country_code": "IL"
                    },
                    "status": "active",
                    "currency": "ILS",
                    "tags": [
                      "retail",
                      "priority"
                    ],
                    "created_at": "2025-06-17T09:20:00.000Z",
                    "updated_at": "2026-07-19T14:12:00.000Z"
                  },
                  "request_id": "req_docsquickstart01"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/leads": {
      "get": {
        "tags": [
          "Leads"
        ],
        "operationId": "listLeads",
        "summary": "List leads",
        "description": "Searches lead name, contact name, email, and phone. Results are ordered by `updated_at` descending, then ID descending.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-permission": "leads:read",
        "x-required-permission-label": "לידים",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of objects to return. Defaults to 50.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque cursor returned in `page.next_cursor`. Do not construct or modify it.",
            "schema": {
              "type": "string",
              "maxLength": 512
            }
          },
          {
            "name": "created_after",
            "in": "query",
            "description": "Return objects created strictly after this ISO 8601 timestamp.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-07-01T00:00:00.000Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "description": "Return objects updated strictly after this ISO 8601 timestamp.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-07-01T00:00:00.000Z"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by public status.",
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "contacted",
                "in_progress",
                "proposal",
                "negotiation",
                "won",
                "lost"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Case-insensitive resource search. Leading and trailing whitespace is removed.",
            "schema": {
              "type": "string",
              "maxLength": 100
            },
            "example": "Northstar"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "page",
                    "request_id"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Lead"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    },
                    "request_id": {
                      "$ref": "#/components/schemas/RequestId"
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "20c85f5f-d823-411f-bbf7-f5b76ea77235",
                      "object": "lead",
                      "name": "Nova Hospitality",
                      "contact_name": "Eitan Bar",
                      "email": "eitan@nova-hospitality.test",
                      "phone": "+972-54-555-0174",
                      "address": "Herzliya",
                      "source": "website",
                      "status": "proposal",
                      "owner": {
                        "id": "913f5ab6-9525-483c-9aa1-73d561b8bfa8",
                        "display_name": "Maya Cohen"
                      },
                      "converted_customer_id": "0b703598-20d1-4eeb-9012-12db41ac8018",
                      "created_at": "2026-07-08T07:45:00.000Z",
                      "updated_at": "2026-07-20T10:05:00.000Z"
                    }
                  ],
                  "page": {
                    "has_more": true,
                    "next_cursor": "eyJyZXNvdXJjZSI6ImN1c3RvbWVycyIsInYiOjF9"
                  },
                  "request_id": "req_docsquickstart01"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/leads/{id}": {
      "get": {
        "tags": [
          "Leads"
        ],
        "operationId": "getLead",
        "summary": "Retrieve a lead",
        "description": "Returns one lead owned by the authenticated business.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-permission": "leads:read",
        "x-required-permission-label": "לידים",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Resource UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Lead"
                    },
                    "request_id": {
                      "$ref": "#/components/schemas/RequestId"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "20c85f5f-d823-411f-bbf7-f5b76ea77235",
                    "object": "lead",
                    "name": "Nova Hospitality",
                    "contact_name": "Eitan Bar",
                    "email": "eitan@nova-hospitality.test",
                    "phone": "+972-54-555-0174",
                    "address": "Herzliya",
                    "source": "website",
                    "status": "proposal",
                    "owner": {
                      "id": "913f5ab6-9525-483c-9aa1-73d561b8bfa8",
                      "display_name": "Maya Cohen"
                    },
                    "converted_customer_id": "0b703598-20d1-4eeb-9012-12db41ac8018",
                    "created_at": "2026-07-08T07:45:00.000Z",
                    "updated_at": "2026-07-20T10:05:00.000Z"
                  },
                  "request_id": "req_docsquickstart01"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/products": {
      "get": {
        "tags": [
          "Products"
        ],
        "operationId": "listProducts",
        "summary": "List products",
        "description": "Searches product name, SKU, and barcode. Results are ordered by `updated_at` descending, then ID descending.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-permission": "products:read",
        "x-required-permission-label": "מוצרים ושירותים",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of objects to return. Defaults to 50.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque cursor returned in `page.next_cursor`. Do not construct or modify it.",
            "schema": {
              "type": "string",
              "maxLength": 512
            }
          },
          {
            "name": "created_after",
            "in": "query",
            "description": "Return objects created strictly after this ISO 8601 timestamp.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-07-01T00:00:00.000Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "description": "Return objects updated strictly after this ISO 8601 timestamp.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-07-01T00:00:00.000Z"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by public status.",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "inactive"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Case-insensitive resource search. Leading and trailing whitespace is removed.",
            "schema": {
              "type": "string",
              "maxLength": 100
            },
            "example": "Northstar"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "page",
                    "request_id"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Product"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    },
                    "request_id": {
                      "$ref": "#/components/schemas/RequestId"
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "44cfbbd5-185d-4c9d-8597-588c25e574e8",
                      "object": "product",
                      "type": "product",
                      "name": "Brand workshop",
                      "description": null,
                      "sku": "WORKSHOP-01",
                      "barcode": "7290012345678",
                      "price_minor": 185000,
                      "currency": "ILS",
                      "vat_behavior": "excluding_vat",
                      "unit": null,
                      "status": "active",
                      "inventory_tracked": false,
                      "created_at": "2025-11-02T12:00:00.000Z",
                      "updated_at": "2026-07-18T08:15:00.000Z"
                    }
                  ],
                  "page": {
                    "has_more": true,
                    "next_cursor": "eyJyZXNvdXJjZSI6ImN1c3RvbWVycyIsInYiOjF9"
                  },
                  "request_id": "req_docsquickstart01"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/products/{id}": {
      "get": {
        "tags": [
          "Products"
        ],
        "operationId": "getProduct",
        "summary": "Retrieve a product",
        "description": "Returns one product or raw material owned by the authenticated business.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-permission": "products:read",
        "x-required-permission-label": "מוצרים ושירותים",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Resource UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Product"
                    },
                    "request_id": {
                      "$ref": "#/components/schemas/RequestId"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "44cfbbd5-185d-4c9d-8597-588c25e574e8",
                    "object": "product",
                    "type": "product",
                    "name": "Brand workshop",
                    "description": null,
                    "sku": "WORKSHOP-01",
                    "barcode": "7290012345678",
                    "price_minor": 185000,
                    "currency": "ILS",
                    "vat_behavior": "excluding_vat",
                    "unit": null,
                    "status": "active",
                    "inventory_tracked": false,
                    "created_at": "2025-11-02T12:00:00.000Z",
                    "updated_at": "2026-07-18T08:15:00.000Z"
                  },
                  "request_id": "req_docsquickstart01"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/documents": {
      "get": {
        "tags": [
          "Documents"
        ],
        "operationId": "listDocuments",
        "summary": "List documents",
        "description": "Searches document title and customer name. Results are ordered by `updated_at` descending, then ID descending.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-permission": "documents:read",
        "x-required-permission-label": "מסמכים",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of objects to return. Defaults to 50.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque cursor returned in `page.next_cursor`. Do not construct or modify it.",
            "schema": {
              "type": "string",
              "maxLength": 512
            }
          },
          {
            "name": "created_after",
            "in": "query",
            "description": "Return objects created strictly after this ISO 8601 timestamp.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-07-01T00:00:00.000Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "description": "Return objects updated strictly after this ISO 8601 timestamp.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-07-01T00:00:00.000Z"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by public status.",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "converted",
                "pending_payment",
                "closed",
                "credited",
                "returned",
                "partially_paid",
                "partially_credited",
                "partially_returned"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Case-insensitive resource search. Leading and trailing whitespace is removed.",
            "schema": {
              "type": "string",
              "maxLength": 100
            },
            "example": "Northstar"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "page",
                    "request_id"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Document"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    },
                    "request_id": {
                      "$ref": "#/components/schemas/RequestId"
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "813d0b3f-ab6c-43d4-9173-8f224566ba2f",
                      "object": "document",
                      "document_type": "invoice",
                      "document_number": 1042,
                      "title": "Invoice 1042",
                      "status": "pending_payment",
                      "language": "en",
                      "customer": {
                        "id": "44f34dad-a427-4c65-ae26-b0a43f8f65f7",
                        "name": "Orion Retail"
                      },
                      "issue_date": "2026-07-15",
                      "due_date": "2026-08-14",
                      "currency": "ILS",
                      "subtotal_minor": 185000,
                      "discount_minor": null,
                      "vat_minor": 33300,
                      "total_minor": 218300,
                      "payment_status": "unpaid",
                      "pdf_available": true,
                      "line_items": [
                        {
                          "id": "ccf43b06-f708-41b7-8408-a96f31b637f2",
                          "line_number": 1,
                          "product_id": "44cfbbd5-185d-4c9d-8597-588c25e574e8",
                          "name": "Brand workshop",
                          "sku": "WORKSHOP-01",
                          "quantity": "1.000",
                          "unit_price_minor": 185000,
                          "total_minor": 185000,
                          "currency": "ILS",
                          "vat_included": false
                        }
                      ],
                      "related_document_ids": [],
                      "created_at": "2026-07-15T08:05:00.000Z",
                      "updated_at": "2026-07-15T08:06:00.000Z"
                    }
                  ],
                  "page": {
                    "has_more": true,
                    "next_cursor": "eyJyZXNvdXJjZSI6ImN1c3RvbWVycyIsInYiOjF9"
                  },
                  "request_id": "req_docsquickstart01"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/documents/{id}": {
      "get": {
        "tags": [
          "Documents"
        ],
        "operationId": "getDocument",
        "summary": "Retrieve a document",
        "description": "Returns a document, its line items, related document IDs, and PDF availability.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-permission": "documents:read",
        "x-required-permission-label": "מסמכים",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Resource UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Document"
                    },
                    "request_id": {
                      "$ref": "#/components/schemas/RequestId"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "813d0b3f-ab6c-43d4-9173-8f224566ba2f",
                    "object": "document",
                    "document_type": "invoice",
                    "document_number": 1042,
                    "title": "Invoice 1042",
                    "status": "pending_payment",
                    "language": "en",
                    "customer": {
                      "id": "44f34dad-a427-4c65-ae26-b0a43f8f65f7",
                      "name": "Orion Retail"
                    },
                    "issue_date": "2026-07-15",
                    "due_date": "2026-08-14",
                    "currency": "ILS",
                    "subtotal_minor": 185000,
                    "discount_minor": null,
                    "vat_minor": 33300,
                    "total_minor": 218300,
                    "payment_status": "unpaid",
                    "pdf_available": true,
                    "line_items": [
                      {
                        "id": "ccf43b06-f708-41b7-8408-a96f31b637f2",
                        "line_number": 1,
                        "product_id": "44cfbbd5-185d-4c9d-8597-588c25e574e8",
                        "name": "Brand workshop",
                        "sku": "WORKSHOP-01",
                        "quantity": "1.000",
                        "unit_price_minor": 185000,
                        "total_minor": 185000,
                        "currency": "ILS",
                        "vat_included": false
                      }
                    ],
                    "related_document_ids": [],
                    "created_at": "2026-07-15T08:05:00.000Z",
                    "updated_at": "2026-07-15T08:06:00.000Z"
                  },
                  "request_id": "req_docsquickstart01"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/documents/{id}/pdf": {
      "get": {
        "tags": [
          "Documents"
        ],
        "operationId": "getDocumentPdf",
        "summary": "Create a temporary PDF download link",
        "description": "Returns a signed download URL that expires after five minutes. Fetch a new URL when it expires.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-permission": "documents:read",
        "x-required-permission-label": "מסמכים",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Resource UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocumentPdf"
                    },
                    "request_id": {
                      "$ref": "#/components/schemas/RequestId"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "813d0b3f-ab6c-43d4-9173-8f224566ba2f",
                    "object": "document_pdf",
                    "url": "https://files.daily.test/documents/invoice-1042.pdf?expires=300",
                    "expires_at": "2026-07-21T12:05:00.000Z",
                    "file_name": "invoice-1042.pdf"
                  },
                  "request_id": "req_docsquickstart01"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/payments": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "listPayments",
        "summary": "List payments",
        "description": "Returns recorded payments without payment credentials, card data, transaction IDs, or bank account data. Search is not supported. Results are ordered by `updated_at` descending, then ID descending.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-permission": "payments:read",
        "x-required-permission-label": "תשלומים",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of objects to return. Defaults to 50.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque cursor returned in `page.next_cursor`. Do not construct or modify it.",
            "schema": {
              "type": "string",
              "maxLength": 512
            }
          },
          {
            "name": "created_after",
            "in": "query",
            "description": "Return objects created strictly after this ISO 8601 timestamp.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-07-01T00:00:00.000Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "description": "Return objects updated strictly after this ISO 8601 timestamp.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-07-01T00:00:00.000Z"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by public status.",
            "schema": {
              "type": "string",
              "enum": [
                "recorded"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "page",
                    "request_id"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Payment"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    },
                    "request_id": {
                      "$ref": "#/components/schemas/RequestId"
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "9eaf89fa-dc55-4130-ac85-598f8a5430c5",
                      "object": "payment",
                      "document_id": "813d0b3f-ab6c-43d4-9173-8f224566ba2f",
                      "customer_id": "44f34dad-a427-4c65-ae26-b0a43f8f65f7",
                      "amount_minor": 218300,
                      "currency": "ILS",
                      "payment_method": "bank_transfer",
                      "payment_date": "2026-07-20",
                      "status": "recorded",
                      "created_at": "2026-07-20T09:15:00.000Z",
                      "updated_at": "2026-07-20T09:15:00.000Z"
                    }
                  ],
                  "page": {
                    "has_more": true,
                    "next_cursor": "eyJyZXNvdXJjZSI6ImN1c3RvbWVycyIsInYiOjF9"
                  },
                  "request_id": "req_docsquickstart01"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/payments/{id}": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "getPayment",
        "summary": "Retrieve a payment",
        "description": "Returns one recorded payment without sensitive payment details.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-permission": "payments:read",
        "x-required-permission-label": "תשלומים",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Resource UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Payment"
                    },
                    "request_id": {
                      "$ref": "#/components/schemas/RequestId"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "9eaf89fa-dc55-4130-ac85-598f8a5430c5",
                    "object": "payment",
                    "document_id": "813d0b3f-ab6c-43d4-9173-8f224566ba2f",
                    "customer_id": "44f34dad-a427-4c65-ae26-b0a43f8f65f7",
                    "amount_minor": 218300,
                    "currency": "ILS",
                    "payment_method": "bank_transfer",
                    "payment_date": "2026-07-20",
                    "status": "recorded",
                    "created_at": "2026-07-20T09:15:00.000Z",
                    "updated_at": "2026-07-20T09:15:00.000Z"
                  },
                  "request_id": "req_docsquickstart01"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/inventory": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "operationId": "listInventory",
        "summary": "List inventory levels",
        "description": "Searches the product name. Results include inventory-tracked products only and are ordered by `updated_at` descending, then ID descending.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-permission": "inventory:read",
        "x-required-permission-label": "מלאי",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of objects to return. Defaults to 50.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque cursor returned in `page.next_cursor`. Do not construct or modify it.",
            "schema": {
              "type": "string",
              "maxLength": 512
            }
          },
          {
            "name": "created_after",
            "in": "query",
            "description": "Return objects created strictly after this ISO 8601 timestamp.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-07-01T00:00:00.000Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "description": "Return objects updated strictly after this ISO 8601 timestamp.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-07-01T00:00:00.000Z"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by public status.",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "inactive"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Case-insensitive resource search. Leading and trailing whitespace is removed.",
            "schema": {
              "type": "string",
              "maxLength": 100
            },
            "example": "Northstar"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "page",
                    "request_id"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InventoryLevel"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    },
                    "request_id": {
                      "$ref": "#/components/schemas/RequestId"
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "44cfbbd5-185d-4c9d-8597-588c25e574e8",
                      "object": "inventory_level",
                      "product_id": "44cfbbd5-185d-4c9d-8597-588c25e574e8",
                      "product_name": "Workshop workbook",
                      "sku": "BOOK-01",
                      "quantity": "42.000",
                      "low_stock_threshold": "10.000",
                      "status": "active",
                      "created_at": "2025-12-01T09:00:00.000Z",
                      "updated_at": "2026-07-20T09:16:00.000Z"
                    }
                  ],
                  "page": {
                    "has_more": true,
                    "next_cursor": "eyJyZXNvdXJjZSI6ImN1c3RvbWVycyIsInYiOjF9"
                  },
                  "request_id": "req_docsquickstart01"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/inventory/movements": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "operationId": "listInventoryMovements",
        "summary": "List inventory movements",
        "description": "Search and `updated_after` are not supported. Results are ordered by `created_at` descending, then ID descending.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-permission": "inventory:read",
        "x-required-permission-label": "מלאי",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of objects to return. Defaults to 50.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque cursor returned in `page.next_cursor`. Do not construct or modify it.",
            "schema": {
              "type": "string",
              "maxLength": 512
            }
          },
          {
            "name": "created_after",
            "in": "query",
            "description": "Return objects created strictly after this ISO 8601 timestamp.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-07-01T00:00:00.000Z"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by movement direction.",
            "schema": {
              "type": "string",
              "enum": [
                "increase",
                "decrease"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "page",
                    "request_id"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InventoryMovement"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    },
                    "request_id": {
                      "$ref": "#/components/schemas/RequestId"
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "2d545552-8dfa-4f5c-86d7-293390f6ec3e",
                      "object": "inventory_movement",
                      "product_id": "44cfbbd5-185d-4c9d-8597-588c25e574e8",
                      "product_name": "Workshop workbook",
                      "sku": "BOOK-01",
                      "document_id": "813d0b3f-ab6c-43d4-9173-8f224566ba2f",
                      "direction": "decrease",
                      "quantity": "2.000",
                      "created_at": "2026-07-20T09:16:00.000Z"
                    }
                  ],
                  "page": {
                    "has_more": true,
                    "next_cursor": "eyJyZXNvdXJjZSI6ImN1c3RvbWVycyIsInYiOjF9"
                  },
                  "request_id": "req_docsquickstart01"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/tasks": {
      "get": {
        "tags": [
          "Tasks"
        ],
        "operationId": "listTasks",
        "summary": "List tasks",
        "description": "Searches task title. Results are ordered by `updated_at` descending, then ID descending.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-permission": "tasks:read",
        "x-required-permission-label": "משימות",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of objects to return. Defaults to 50.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque cursor returned in `page.next_cursor`. Do not construct or modify it.",
            "schema": {
              "type": "string",
              "maxLength": 512
            }
          },
          {
            "name": "created_after",
            "in": "query",
            "description": "Return objects created strictly after this ISO 8601 timestamp.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-07-01T00:00:00.000Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "description": "Return objects updated strictly after this ISO 8601 timestamp.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-07-01T00:00:00.000Z"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by public status.",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "completed",
                "canceled"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Case-insensitive resource search. Leading and trailing whitespace is removed.",
            "schema": {
              "type": "string",
              "maxLength": 100
            },
            "example": "Northstar"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "page",
                    "request_id"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Task"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    },
                    "request_id": {
                      "$ref": "#/components/schemas/RequestId"
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "9139e779-dd20-4418-b67a-20975607ce40",
                      "object": "task",
                      "title": "Confirm workshop schedule",
                      "description": null,
                      "status": "open",
                      "priority": "high",
                      "due_date": "2026-07-25",
                      "due_at": "2026-07-25T07:00:00.000Z",
                      "customer_id": "44f34dad-a427-4c65-ae26-b0a43f8f65f7",
                      "document_id": "813d0b3f-ab6c-43d4-9173-8f224566ba2f",
                      "lead_id": "20c85f5f-d823-411f-bbf7-f5b76ea77235",
                      "assigned_user": {
                        "id": "913f5ab6-9525-483c-9aa1-73d561b8bfa8",
                        "display_name": "Maya Cohen"
                      },
                      "created_at": "2026-07-20T10:10:00.000Z",
                      "updated_at": "2026-07-21T08:30:00.000Z"
                    }
                  ],
                  "page": {
                    "has_more": true,
                    "next_cursor": "eyJyZXNvdXJjZSI6ImN1c3RvbWVycyIsInYiOjF9"
                  },
                  "request_id": "req_docsquickstart01"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/tasks/{id}": {
      "get": {
        "tags": [
          "Tasks"
        ],
        "operationId": "getTask",
        "summary": "Retrieve a task",
        "description": "Returns one task owned by the authenticated business.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-permission": "tasks:read",
        "x-required-permission-label": "משימות",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Resource UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Task"
                    },
                    "request_id": {
                      "$ref": "#/components/schemas/RequestId"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "9139e779-dd20-4418-b67a-20975607ce40",
                    "object": "task",
                    "title": "Confirm workshop schedule",
                    "description": null,
                    "status": "open",
                    "priority": "high",
                    "due_date": "2026-07-25",
                    "due_at": "2026-07-25T07:00:00.000Z",
                    "customer_id": "44f34dad-a427-4c65-ae26-b0a43f8f65f7",
                    "document_id": "813d0b3f-ab6c-43d4-9173-8f224566ba2f",
                    "lead_id": "20c85f5f-d823-411f-bbf7-f5b76ea77235",
                    "assigned_user": {
                      "id": "913f5ab6-9525-483c-9aa1-73d561b8bfa8",
                      "display_name": "Maya Cohen"
                    },
                    "created_at": "2026-07-20T10:10:00.000Z",
                    "updated_at": "2026-07-21T08:30:00.000Z"
                  },
                  "request_id": "req_docsquickstart01"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Daily API key",
        "description": "Use `Authorization: Bearer $DAILY_API_KEY`."
      }
    },
    "headers": {
      "RequestId": {
        "description": "Correlation ID for support and observability.",
        "schema": {
          "$ref": "#/components/schemas/RequestId"
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Invalid query parameter, cursor, resource ID, or query string longer than 2,048 characters.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "type": "invalid_request_error",
                "code": "invalid_filter",
                "message": "One or more request parameters are invalid."
              },
              "request_id": "req_docsquickstart01"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "API key missing, invalid, revoked, expired, or for the wrong environment.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "type": "authentication_error",
                "code": "invalid_api_key",
                "message": "A valid API key is required."
              },
              "request_id": "req_docsquickstart01"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Subscription access, IP allowlist, or permission denied.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "type": "authorization_error",
                "code": "insufficient_permission",
                "message": "This API key cannot access customers."
              },
              "request_id": "req_docsquickstart01"
            }
          }
        }
      },
      "NotFound": {
        "description": "Resource not found in the authenticated business.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "type": "not_found_error",
                "code": "resource_not_found",
                "message": "The requested resource was not found."
              },
              "request_id": "req_docsquickstart01"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Nginx rate limit exceeded. Retry after the number of seconds in `Retry-After`.",
        "headers": {
          "Retry-After": {
            "description": "Seconds to wait before retrying.",
            "schema": {
              "type": "integer",
              "example": 1
            }
          },
          "X-Request-ID": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "type": "rate_limit_error",
                "code": "rate_limit_exceeded",
                "message": "Too many requests."
              },
              "request_id": "req_docsquickstart01"
            }
          }
        }
      },
      "InternalError": {
        "description": "Unexpected API failure.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "type": "api_error",
                "code": "internal_error",
                "message": "An unexpected error occurred."
              },
              "request_id": "req_docsquickstart01"
            }
          }
        }
      },
      "Unavailable": {
        "description": "API upstream temporarily unavailable.",
        "headers": {
          "Retry-After": {
            "description": "Seconds to wait before retrying.",
            "schema": {
              "type": "integer",
              "example": 5
            }
          },
          "X-Request-ID": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "type": "api_error",
                "code": "service_unavailable",
                "message": "The API is temporarily unavailable."
              },
              "request_id": "req_docsquickstart01"
            }
          }
        }
      }
    },
    "schemas": {
      "RequestId": {
        "type": "string",
        "description": "Request correlation ID. Supply a value in `X-Request-ID` or use the generated value.",
        "pattern": "^[A-Za-z0-9_-]{8,100}$",
        "example": "req_docsquickstart01"
      },
      "ErrorDetail": {
        "type": "object",
        "required": [
          "type",
          "code",
          "message"
        ],
        "additionalProperties": false,
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "authentication_error",
              "authorization_error",
              "invalid_request_error",
              "not_found_error",
              "rate_limit_error",
              "api_error"
            ]
          },
          "code": {
            "type": "string",
            "enum": [
              "missing_api_key",
              "invalid_api_key",
              "revoked_api_key",
              "expired_api_key",
              "api_access_inactive",
              "ip_not_allowed",
              "insufficient_permission",
              "invalid_filter",
              "method_not_allowed",
              "resource_not_found",
              "rate_limit_exceeded",
              "internal_error",
              "service_unavailable"
            ]
          },
          "message": {
            "type": "string",
            "example": "A valid API key is required."
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error",
          "request_id"
        ],
        "additionalProperties": false,
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorDetail"
          },
          "request_id": {
            "$ref": "#/components/schemas/RequestId"
          }
        }
      },
      "Page": {
        "type": "object",
        "required": [
          "has_more",
          "next_cursor"
        ],
        "additionalProperties": false,
        "properties": {
          "has_more": {
            "type": "boolean",
            "example": true
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "example": "eyJyZXNvdXJjZSI6ImN1c3RvbWVycyIsInYiOjF9"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "Address": {
        "type": "object",
        "required": [
          "street",
          "street_number",
          "city",
          "postal_code",
          "country_code"
        ],
        "additionalProperties": false,
        "properties": {
          "street": {
            "anyOf": [
              {
                "type": "string",
                "example": "HaArba’a"
              },
              {
                "type": "null"
              }
            ]
          },
          "street_number": {
            "anyOf": [
              {
                "type": "string",
                "example": "28"
              },
              {
                "type": "null"
              }
            ]
          },
          "city": {
            "anyOf": [
              {
                "type": "string",
                "example": "Tel Aviv-Yafo"
              },
              {
                "type": "null"
              }
            ]
          },
          "postal_code": {
            "anyOf": [
              {
                "type": "string",
                "example": "6473925"
              },
              {
                "type": "null"
              }
            ]
          },
          "country_code": {
            "anyOf": [
              {
                "type": "string",
                "example": "IL"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "Business": {
        "type": "object",
        "required": [
          "id",
          "object",
          "name",
          "english_name",
          "business_number",
          "business_type",
          "email",
          "phone",
          "address",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "0b703598-20d1-4eeb-9012-12db41ac8018"
          },
          "object": {
            "type": "string",
            "const": "business"
          },
          "name": {
            "type": "string",
            "example": "סטודיו נורת׳סטאר בע״מ"
          },
          "english_name": {
            "anyOf": [
              {
                "type": "string",
                "example": "Northstar Studio Ltd."
              },
              {
                "type": "null"
              }
            ]
          },
          "business_number": {
            "anyOf": [
              {
                "type": "string",
                "example": "515990281"
              },
              {
                "type": "null"
              }
            ]
          },
          "business_type": {
            "type": "string",
            "example": "company"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "format": "email",
                "example": "finance@northstar.test"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "example": "+972-3-555-0142"
              },
              {
                "type": "null"
              }
            ]
          },
          "address": {
            "type": "object",
            "required": [
              "street",
              "city",
              "postal_code",
              "country"
            ],
            "additionalProperties": false,
            "properties": {
              "street": {
                "anyOf": [
                  {
                    "type": "string",
                    "example": "HaArba’a 28"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "city": {
                "anyOf": [
                  {
                    "type": "string",
                    "example": "Tel Aviv-Yafo"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "postal_code": {
                "anyOf": [
                  {
                    "type": "string",
                    "example": "6473925"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "country": {
                "type": "string",
                "const": "IL"
              }
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2025-02-03T08:30:00.000Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-21T11:45:00.000Z"
          }
        }
      },
      "Phone": {
        "type": "object",
        "required": [
          "value",
          "primary"
        ],
        "additionalProperties": false,
        "properties": {
          "value": {
            "type": "string",
            "example": "+972-52-555-0128"
          },
          "primary": {
            "type": "boolean",
            "example": true
          }
        }
      },
      "Counterparty": {
        "type": "object",
        "required": [
          "id",
          "object",
          "type",
          "name",
          "business_number",
          "contact_person",
          "email",
          "additional_emails",
          "phone",
          "phones",
          "address",
          "status",
          "currency",
          "tags",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "44f34dad-a427-4c65-ae26-b0a43f8f65f7"
          },
          "object": {
            "type": "string",
            "enum": [
              "customer",
              "supplier"
            ],
            "example": "customer"
          },
          "type": {
            "type": "string",
            "enum": [
              "customer",
              "supplier"
            ],
            "example": "customer"
          },
          "name": {
            "type": "string",
            "example": "Orion Retail"
          },
          "business_number": {
            "anyOf": [
              {
                "type": "string",
                "example": "515880391"
              },
              {
                "type": "null"
              }
            ]
          },
          "contact_person": {
            "anyOf": [
              {
                "type": "string",
                "example": "Noa Levi"
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "format": "email",
                "example": "billing@orion-retail.test"
              },
              {
                "type": "null"
              }
            ]
          },
          "additional_emails": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "email"
            },
            "example": [
              "ops@orion-retail.test"
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "example": "+972-52-555-0128"
              },
              {
                "type": "null"
              }
            ]
          },
          "phones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Phone"
            }
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ],
            "example": "active"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$",
            "example": "ILS"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "retail",
              "priority"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2025-06-17T09:20:00.000Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-19T14:12:00.000Z"
          }
        }
      },
      "Customer": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Counterparty"
          },
          {
            "type": "object",
            "properties": {
              "object": {
                "type": "string",
                "const": "customer"
              },
              "type": {
                "type": "string",
                "const": "customer"
              }
            }
          }
        ]
      },
      "Supplier": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Counterparty"
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "example": "37b06123-d1d7-4978-a1c7-17ffdbeb1c49"
              },
              "object": {
                "type": "string",
                "const": "supplier"
              },
              "type": {
                "type": "string",
                "const": "supplier"
              },
              "name": {
                "type": "string",
                "example": "Atlas Office Supply"
              },
              "email": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "email",
                    "example": "accounts@atlas-supply.test"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          }
        ]
      },
      "UserSummary": {
        "type": "object",
        "required": [
          "id",
          "display_name"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "913f5ab6-9525-483c-9aa1-73d561b8bfa8"
          },
          "display_name": {
            "type": "string",
            "example": "Maya Cohen"
          }
        }
      },
      "Lead": {
        "type": "object",
        "required": [
          "id",
          "object",
          "name",
          "contact_name",
          "email",
          "phone",
          "address",
          "source",
          "status",
          "owner",
          "converted_customer_id",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "20c85f5f-d823-411f-bbf7-f5b76ea77235"
          },
          "object": {
            "type": "string",
            "const": "lead"
          },
          "name": {
            "anyOf": [
              {
                "type": "string",
                "example": "Nova Hospitality"
              },
              {
                "type": "null"
              }
            ]
          },
          "contact_name": {
            "anyOf": [
              {
                "type": "string",
                "example": "Eitan Bar"
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "format": "email",
                "example": "eitan@nova-hospitality.test"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "example": "+972-54-555-0174"
              },
              {
                "type": "null"
              }
            ]
          },
          "address": {
            "anyOf": [
              {
                "type": "string",
                "example": "Herzliya"
              },
              {
                "type": "null"
              }
            ]
          },
          "source": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "referral",
                  "website",
                  "social_media",
                  "campaign",
                  "phone",
                  "event",
                  "other"
                ],
                "example": "website"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "new",
              "contacted",
              "in_progress",
              "proposal",
              "negotiation",
              "won",
              "lost"
            ],
            "example": "proposal"
          },
          "owner": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UserSummary"
              },
              {
                "type": "null"
              }
            ]
          },
          "converted_customer_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-08T07:45:00.000Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-20T10:05:00.000Z"
          }
        }
      },
      "Product": {
        "type": "object",
        "required": [
          "id",
          "object",
          "type",
          "name",
          "description",
          "sku",
          "barcode",
          "price_minor",
          "currency",
          "vat_behavior",
          "unit",
          "status",
          "inventory_tracked",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "44cfbbd5-185d-4c9d-8597-588c25e574e8"
          },
          "object": {
            "type": "string",
            "const": "product"
          },
          "type": {
            "type": "string",
            "enum": [
              "product",
              "raw_material"
            ],
            "example": "product"
          },
          "name": {
            "type": "string",
            "example": "Brand workshop"
          },
          "description": {
            "type": "null"
          },
          "sku": {
            "anyOf": [
              {
                "type": "string",
                "example": "WORKSHOP-01"
              },
              {
                "type": "null"
              }
            ]
          },
          "barcode": {
            "anyOf": [
              {
                "type": "string",
                "example": "7290012345678"
              },
              {
                "type": "null"
              }
            ]
          },
          "price_minor": {
            "type": "integer",
            "format": "int64",
            "example": 185000
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$",
            "example": "ILS"
          },
          "vat_behavior": {
            "type": "string",
            "enum": [
              "including_vat",
              "excluding_vat"
            ],
            "example": "excluding_vat"
          },
          "unit": {
            "type": "null"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ],
            "example": "active"
          },
          "inventory_tracked": {
            "type": "boolean",
            "example": false
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2025-11-02T12:00:00.000Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-18T08:15:00.000Z"
          }
        }
      },
      "DocumentLineItem": {
        "type": "object",
        "required": [
          "id",
          "line_number",
          "product_id",
          "name",
          "sku",
          "quantity",
          "unit_price_minor",
          "total_minor",
          "currency",
          "vat_included"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "ccf43b06-f708-41b7-8408-a96f31b637f2"
          },
          "line_number": {
            "type": "integer",
            "example": 1
          },
          "product_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "example": "44cfbbd5-185d-4c9d-8597-588c25e574e8"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string",
            "example": "Brand workshop"
          },
          "sku": {
            "anyOf": [
              {
                "type": "string",
                "example": "WORKSHOP-01"
              },
              {
                "type": "null"
              }
            ]
          },
          "quantity": {
            "type": "string",
            "pattern": "^-?\\d+\\.\\d{3}$",
            "example": "1.000"
          },
          "unit_price_minor": {
            "type": "integer",
            "format": "int64",
            "example": 185000
          },
          "total_minor": {
            "type": "integer",
            "format": "int64",
            "example": 185000
          },
          "currency": {
            "type": "string",
            "example": "ILS"
          },
          "vat_included": {
            "type": "boolean",
            "example": false
          }
        }
      },
      "Document": {
        "type": "object",
        "required": [
          "id",
          "object",
          "document_type",
          "document_number",
          "title",
          "status",
          "language",
          "customer",
          "issue_date",
          "due_date",
          "currency",
          "subtotal_minor",
          "discount_minor",
          "vat_minor",
          "total_minor",
          "payment_status",
          "pdf_available",
          "line_items",
          "related_document_ids",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "813d0b3f-ab6c-43d4-9173-8f224566ba2f"
          },
          "object": {
            "type": "string",
            "const": "document"
          },
          "document_type": {
            "type": "string",
            "enum": [
              "invoice_receipt",
              "invoice",
              "receipt",
              "credit_invoice",
              "credit_receipt",
              "quote",
              "work_order",
              "delivery_note",
              "return_note",
              "transaction_invoice",
              "purchase_order"
            ],
            "example": "invoice"
          },
          "document_number": {
            "type": "integer",
            "example": 1042
          },
          "title": {
            "type": "string",
            "example": "Invoice 1042"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "converted",
              "pending_payment",
              "closed",
              "credited",
              "returned",
              "partially_paid",
              "partially_credited",
              "partially_returned"
            ],
            "example": "pending_payment"
          },
          "language": {
            "type": "string",
            "enum": [
              "he",
              "en"
            ],
            "example": "en"
          },
          "customer": {
            "type": "object",
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "example": "44f34dad-a427-4c65-ae26-b0a43f8f65f7"
              },
              "name": {
                "type": "string",
                "example": "Orion Retail"
              }
            }
          },
          "issue_date": {
            "type": "string",
            "format": "date",
            "example": "2026-07-15"
          },
          "due_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date",
                "example": "2026-08-14"
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "type": "string",
            "example": "ILS"
          },
          "subtotal_minor": {
            "type": "integer",
            "format": "int64",
            "example": 185000
          },
          "discount_minor": {
            "type": "null"
          },
          "vat_minor": {
            "type": "integer",
            "format": "int64",
            "example": 33300
          },
          "total_minor": {
            "type": "integer",
            "format": "int64",
            "example": 218300
          },
          "payment_status": {
            "type": "string",
            "enum": [
              "paid",
              "partially_paid",
              "unpaid"
            ],
            "example": "unpaid"
          },
          "pdf_available": {
            "type": "boolean",
            "example": true
          },
          "line_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentLineItem"
            }
          },
          "related_document_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "example": []
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-15T08:05:00.000Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-15T08:06:00.000Z"
          }
        }
      },
      "DocumentPdf": {
        "type": "object",
        "required": [
          "id",
          "object",
          "url",
          "expires_at",
          "file_name"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "813d0b3f-ab6c-43d4-9173-8f224566ba2f"
          },
          "object": {
            "type": "string",
            "const": "document_pdf"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "example": "https://files.daily.test/documents/invoice-1042.pdf?expires=300"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-21T12:05:00.000Z"
          },
          "file_name": {
            "type": "string",
            "example": "invoice-1042.pdf"
          }
        }
      },
      "Payment": {
        "type": "object",
        "required": [
          "id",
          "object",
          "document_id",
          "customer_id",
          "amount_minor",
          "currency",
          "payment_method",
          "payment_date",
          "status",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "9eaf89fa-dc55-4130-ac85-598f8a5430c5"
          },
          "object": {
            "type": "string",
            "const": "payment"
          },
          "document_id": {
            "type": "string",
            "format": "uuid",
            "example": "813d0b3f-ab6c-43d4-9173-8f224566ba2f"
          },
          "customer_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "example": "44f34dad-a427-4c65-ae26-b0a43f8f65f7"
              },
              {
                "type": "null"
              }
            ]
          },
          "amount_minor": {
            "type": "integer",
            "format": "int64",
            "example": 218300
          },
          "currency": {
            "type": "string",
            "example": "ILS"
          },
          "payment_method": {
            "type": "string",
            "enum": [
              "card",
              "cash",
              "bank_transfer",
              "check",
              "paypal",
              "other"
            ],
            "example": "bank_transfer"
          },
          "payment_date": {
            "type": "string",
            "format": "date",
            "example": "2026-07-20"
          },
          "status": {
            "type": "string",
            "const": "recorded"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-20T09:15:00.000Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-20T09:15:00.000Z"
          }
        }
      },
      "InventoryLevel": {
        "type": "object",
        "required": [
          "id",
          "object",
          "product_id",
          "product_name",
          "sku",
          "quantity",
          "low_stock_threshold",
          "status",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "44cfbbd5-185d-4c9d-8597-588c25e574e8"
          },
          "object": {
            "type": "string",
            "const": "inventory_level"
          },
          "product_id": {
            "type": "string",
            "format": "uuid",
            "example": "44cfbbd5-185d-4c9d-8597-588c25e574e8"
          },
          "product_name": {
            "type": "string",
            "example": "Workshop workbook"
          },
          "sku": {
            "anyOf": [
              {
                "type": "string",
                "example": "BOOK-01"
              },
              {
                "type": "null"
              }
            ]
          },
          "quantity": {
            "type": "string",
            "pattern": "^-?\\d+\\.\\d{3}$",
            "example": "42.000"
          },
          "low_stock_threshold": {
            "type": "string",
            "pattern": "^-?\\d+\\.\\d{3}$",
            "example": "10.000"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ],
            "example": "active"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2025-12-01T09:00:00.000Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-20T09:16:00.000Z"
          }
        }
      },
      "InventoryMovement": {
        "type": "object",
        "required": [
          "id",
          "object",
          "product_id",
          "product_name",
          "sku",
          "document_id",
          "direction",
          "quantity",
          "created_at"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "2d545552-8dfa-4f5c-86d7-293390f6ec3e"
          },
          "object": {
            "type": "string",
            "const": "inventory_movement"
          },
          "product_id": {
            "type": "string",
            "format": "uuid",
            "example": "44cfbbd5-185d-4c9d-8597-588c25e574e8"
          },
          "product_name": {
            "type": "string",
            "example": "Workshop workbook"
          },
          "sku": {
            "anyOf": [
              {
                "type": "string",
                "example": "BOOK-01"
              },
              {
                "type": "null"
              }
            ]
          },
          "document_id": {
            "type": "string",
            "format": "uuid",
            "example": "813d0b3f-ab6c-43d4-9173-8f224566ba2f"
          },
          "direction": {
            "type": "string",
            "enum": [
              "increase",
              "decrease"
            ],
            "example": "decrease"
          },
          "quantity": {
            "type": "string",
            "pattern": "^-?\\d+\\.\\d{3}$",
            "example": "2.000"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-20T09:16:00.000Z"
          }
        }
      },
      "Task": {
        "type": "object",
        "required": [
          "id",
          "object",
          "title",
          "description",
          "status",
          "priority",
          "due_date",
          "due_at",
          "customer_id",
          "document_id",
          "lead_id",
          "assigned_user",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "9139e779-dd20-4418-b67a-20975607ce40"
          },
          "object": {
            "type": "string",
            "const": "task"
          },
          "title": {
            "type": "string",
            "example": "Confirm workshop schedule"
          },
          "description": {
            "type": "null"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "completed",
              "canceled",
              "unknown"
            ],
            "example": "open"
          },
          "priority": {
            "type": "string",
            "enum": [
              "high",
              "normal"
            ],
            "example": "high"
          },
          "due_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date",
                "example": "2026-07-25"
              },
              {
                "type": "null"
              }
            ]
          },
          "due_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "example": "2026-07-25T07:00:00.000Z"
              },
              {
                "type": "null"
              }
            ]
          },
          "customer_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "example": "44f34dad-a427-4c65-ae26-b0a43f8f65f7"
              },
              {
                "type": "null"
              }
            ]
          },
          "document_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "example": "813d0b3f-ab6c-43d4-9173-8f224566ba2f"
              },
              {
                "type": "null"
              }
            ]
          },
          "lead_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "example": "20c85f5f-d823-411f-bbf7-f5b76ea77235"
              },
              {
                "type": "null"
              }
            ]
          },
          "assigned_user": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UserSummary"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-20T10:10:00.000Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-21T08:30:00.000Z"
          }
        }
      }
    }
  }
}
