{
  "openapi": "3.1.0",
  "info": {
    "title": "HelloBooks Public API",
    "version": "1.0.0",
    "summary": "Third-party accounting API for HelloBooks organisations.",
    "description": "Machine-readable description of the HelloBooks public API, **generated** from the route registry rather than written by hand. Regenerate with `node scripts/generate-openapi.js`; `tests/publicApiOpenapi.test.js` fails the build when a live route has no entry here.\n\n## What this document is honest about\n\nResponse and request **field lists are not published yet**. The field contract that would supply them (`routes/publicApi.contract.js`) is present (routes/publicApi.contract.js); 76 of 105 resources have a published field baseline, and its generated baseline is deliberately empty at increment 1. Rather than emit confident empty schemas, every unresolved shape here is an unconstrained object marked `x-hellobooks-field-contract: \"unpublished\"`. Absence of properties means *not yet described*, never *no fields*.\n\n## Authentication and scopes\n\nOAuth 2.0 authorization code. The access token carries the `marketplace_app` audience and is bound to a single AppInstall, and so to a single (org, entity) pair.\n\nScopes are granular: **14 domains x {read, write} = 28 scopes**, plus the two legacy bundles. Each of the 466 factory operations names the scope of its own resource domain — `sales:read` for an invoice, `payroll:read` for an employee, `paymentmethods:read` for a stored card — so a token scoped to sales cannot reach payroll or card details at all.\n\n`book:read` and `book:write` remain **grantable bundle scopes**, not deprecated aliases: `book:read` expands to every `<domain>:read` and `book:write` to every `<domain>:write` (never to reads). Each operation's `security` therefore lists the granular scope AND the bundle that satisfies it as alternatives, which is how a generated client learns both grants are valid. The full domain table and both expansions are in `components.securitySchemes.marketplaceOAuth2.x-hellobooks-scope-model`.\n\nTwo surfaces stay coarse deliberately: dynamic client registration and the `/books/drafts` flow require only the bundles, because AI-MCP-Hellobooks understands exactly four scope strings and a granular scope would grant its connector nothing. Those operations are marked `x-hellobooks-scope-grain: \"coarse-bundle\"`.\n\nNo scope is required for `GET /health`, `GET /me` — service endpoints that carry no tenant payload. They are still behind the bearer token; there is no anonymous endpoint on this gateway.\n\n## Tenancy\n\nEvery resource path carries `{orgId}` and `{entityId}`. `requireTenantParamMatch` rejects any value that is not the install's own OrgRefId / EntityRefId with 403 `tenant_scope_violation`. `GET /me` is how a client discovers the pair it is allowed to use.\n\n## Rate limits\n\nCounted per `(clientId, installId)`. Default **120 requests / 60 seconds**, overridable per app via `AppApiKey.RateLimit.MaxRequests`; when no override exists and plan enforcement is switched on, the ceiling comes from the org plan's `ApiRequestsPerMinute`. On failure of the limiter's Redis store the request is allowed through (`passOnStoreError`). Responses carry RFC 9651 draft-8 `RateLimit` and `RateLimit-Policy` headers; a 429 adds `Retry-After`.\n\n## Billing\n\nEvery request except `/health`, `/me` and the books draft→commit flow is pre-charged against the tenant's AI-credit wallet and settles only on a response below 400. A depleted wallet returns 402.\n\n## Error shapes\n\nThere are **two**, and they are not interchangeable. Gateway middlewares return `{ error: \"<code>\", message }` where `error` is a string. Plan-entitlement denials return `{ success: false, error: { code, plan, upgradeTo, upgradeUrl, feature } }` where `error` is an object. Both can arrive on 403. Clients must branch on the type of `error` before reading it.",
    "license": {
      "name": "Proprietary",
      "identifier": "LicenseRef-HelloBooks-Proprietary"
    }
  },
  "servers": [
    {
      "url": "https://api.hellobooks.ai/public/v1",
      "variables": {
        "host": {
          "default": "https://api.hellobooks.ai",
          "description": "HelloBooks auth-service host."
        }
      }
    }
  ],
  "security": [
    {
      "marketplaceOAuth2": [
        "book:read"
      ]
    }
  ],
  "tags": [
    {
      "name": "service",
      "description": "Gateway self-description."
    },
    {
      "name": "bookkeeping",
      "description": "Draft → confirm → commit flow."
    },
    {
      "name": "webhooks",
      "description": "Subscription management (delivery dormant)."
    },
    {
      "name": "customers",
      "description": "Hand-written customer routes predating the factory."
    },
    {
      "name": "documents",
      "description": "Document auto-numbering."
    },
    {
      "name": "account",
      "description": "Registry resource `account` → `controllers/GRPC/Accounting/account.grpc`."
    },
    {
      "name": "accountsByPayee",
      "description": "Registry resource `accountsByPayee` → `controllers/GRPC/Accounting/accountsByPayee.grpc`."
    },
    {
      "name": "agedPayables",
      "description": "Registry resource `agedPayables` → `controllers/GRPC/Accounting/agedPayables.grpc`."
    },
    {
      "name": "agedPayablesSummary",
      "description": "Registry resource `agedPayablesSummary` → `controllers/GRPC/Accounting/agedPayables.grpc`."
    },
    {
      "name": "agedReceivables",
      "description": "Registry resource `agedReceivables` → `controllers/GRPC/Accounting/agedReceivables.grpc`."
    },
    {
      "name": "agedReceivablesSummary",
      "description": "Registry resource `agedReceivablesSummary` → `controllers/GRPC/Accounting/agedReceivables.grpc`."
    },
    {
      "name": "approvalRule",
      "description": "Registry resource `approvalRule` → `controllers/GRPC/Accounting/approvalRule.grpc`."
    },
    {
      "name": "assetAttachment",
      "description": "Registry resource `assetAttachment` → `controllers/GRPC/Accounting/assetAttachment.grpc`."
    },
    {
      "name": "assetDisposal",
      "description": "Registry resource `assetDisposal` → `controllers/GRPC/Accounting/assetDisposal.grpc`."
    },
    {
      "name": "assetGroup",
      "description": "Registry resource `assetGroup` → `controllers/GRPC/Accounting/assetGroup.grpc`."
    },
    {
      "name": "assetSurvey",
      "description": "Registry resource `assetSurvey` → `controllers/GRPC/Accounting/assetSurvey.grpc`."
    },
    {
      "name": "assetTimingDifference",
      "description": "Registry resource `assetTimingDifference` → `controllers/GRPC/Accounting/assetTimingDifference.grpc`."
    },
    {
      "name": "assetTransfer",
      "description": "Registry resource `assetTransfer` → `controllers/GRPC/Accounting/assetTransfer.grpc`."
    },
    {
      "name": "balanceSheet",
      "description": "Registry resource `balanceSheet` → `controllers/GRPC/Accounting/reports/balanceSheet.grpc`."
    },
    {
      "name": "bill",
      "description": "Registry resource `bill` → `controllers/GRPC/Accounting/bill.grpc`."
    },
    {
      "name": "billAddress",
      "description": "Registry resource `billAddress` → `controllers/GRPC/Accounting/billAddress.grpc`."
    },
    {
      "name": "billLine",
      "description": "Registry resource `billLine` → `controllers/GRPC/Accounting/billLine.grpc`."
    },
    {
      "name": "budget",
      "description": "Registry resource `budget` → `controllers/GRPC/Accounting/budget.grpc`."
    },
    {
      "name": "businessOwner",
      "description": "Registry resource `businessOwner` → `controllers/GRPC/Accounting/businessOwner.grpc`."
    },
    {
      "name": "cashFlow",
      "description": "Registry resource `cashFlow` → `controllers/GRPC/Accounting/reports/cashFlow.grpc`."
    },
    {
      "name": "cashbook",
      "description": "Registry resource `cashbook` → `controllers/GRPC/Accounting/cashbook.grpc`."
    },
    {
      "name": "class",
      "description": "Registry resource `class` → `controllers/GRPC/Accounting/class.grpc`."
    },
    {
      "name": "comment",
      "description": "Registry resource `comment` → `controllers/GRPC/Accounting/comment.grpc`."
    },
    {
      "name": "customer",
      "description": "Registry resource `customer` → `controllers/GRPC/Accounting/customer.grpc`."
    },
    {
      "name": "customerAddress",
      "description": "Registry resource `customerAddress` → `controllers/GRPC/Accounting/customerAddress.grpc`."
    },
    {
      "name": "customerAdvance",
      "description": "Registry resource `customerAdvance` → `controllers/GRPC/Accounting/customerAdvance.grpc`."
    },
    {
      "name": "customerAdvanceApplication",
      "description": "Registry resource `customerAdvanceApplication` → `controllers/GRPC/Accounting/customerAdvanceApplication.grpc`."
    },
    {
      "name": "customerAdvanceRecurringLink",
      "description": "Registry resource `customerAdvanceRecurringLink` → `controllers/GRPC/Accounting/customerAdvanceRecurringLink.grpc`."
    },
    {
      "name": "customerAdvanceRefund",
      "description": "Registry resource `customerAdvanceRefund` → `controllers/GRPC/Accounting/customerAdvanceRefund.grpc`."
    },
    {
      "name": "customerAdvanceSchedule",
      "description": "Registry resource `customerAdvanceSchedule` → `controllers/GRPC/Accounting/customerAdvanceSchedule.grpc`."
    },
    {
      "name": "customerBalance",
      "description": "Registry resource `customerBalance` → `controllers/GRPC/Accounting/customerBalance.grpc`."
    },
    {
      "name": "customerContactPersons",
      "description": "Registry resource `customerContactPersons` → `controllers/GRPC/Accounting/customerContactPerson.grpc`."
    },
    {
      "name": "customerCreditCard",
      "description": "Registry resource `customerCreditCard` → `controllers/GRPC/Accounting/customerCreditCardDetail.grpc`."
    },
    {
      "name": "customerDebitCard",
      "description": "Registry resource `customerDebitCard` → `controllers/GRPC/Accounting/customerDebitCardDetail.grpc`."
    },
    {
      "name": "customerGroup",
      "description": "Registry resource `customerGroup` → `controllers/GRPC/Accounting/customerGroup.grpc`."
    },
    {
      "name": "deliveryChallan",
      "description": "Registry resource `deliveryChallan` → `controllers/GRPC/Accounting/deliveryChallan.grpc`."
    },
    {
      "name": "deliveryChallanAddress",
      "description": "Registry resource `deliveryChallanAddress` → `controllers/GRPC/Accounting/deliveryChallanAddress.grpc`."
    },
    {
      "name": "deliveryChallanLine",
      "description": "Registry resource `deliveryChallanLine` → `controllers/GRPC/Accounting/deliveryChallanLine.grpc`."
    },
    {
      "name": "employee",
      "description": "Registry resource `employee` → `controllers/GRPC/Accounting/employee.grpc`."
    },
    {
      "name": "employeeAddress",
      "description": "Registry resource `employeeAddress` → `controllers/GRPC/Accounting/employeeAddress.grpc`."
    },
    {
      "name": "employeeCreditCard",
      "description": "Registry resource `employeeCreditCard` → `controllers/GRPC/Accounting/employeeCreditCardDetail.grpc`."
    },
    {
      "name": "employeeDebitCard",
      "description": "Registry resource `employeeDebitCard` → `controllers/GRPC/Accounting/employeeDebitCardDetail.grpc`."
    },
    {
      "name": "expenseClaim",
      "description": "Registry resource `expenseClaim` → `controllers/GRPC/Accounting/expenseClaim.grpc`."
    },
    {
      "name": "expenseReceipt",
      "description": "Registry resource `expenseReceipt` → `controllers/GRPC/Accounting/expenseReceipt.grpc`."
    },
    {
      "name": "fixedAsset",
      "description": "Registry resource `fixedAsset` → `controllers/GRPC/Accounting/fixedAssets.grpc`."
    },
    {
      "name": "generalLedger",
      "description": "Registry resource `generalLedger` → `controllers/GRPC/Accounting/generalLedger.grpc`."
    },
    {
      "name": "goodReceiptNoteLine",
      "description": "Registry resource `goodReceiptNoteLine` → `controllers/GRPC/Accounting/goodReceiptNoteLine.grpc`."
    },
    {
      "name": "goodReceiptNotes",
      "description": "Registry resource `goodReceiptNotes` → `controllers/GRPC/Accounting/goodReceiptNote.grpc`."
    },
    {
      "name": "grossProfit",
      "description": "Registry resource `grossProfit` → `controllers/GRPC/Accounting/reports/grossProfit.grpc`."
    },
    {
      "name": "invoice",
      "description": "Registry resource `invoice` → `controllers/GRPC/Accounting/invoice.grpc`."
    },
    {
      "name": "invoiceAddress",
      "description": "Registry resource `invoiceAddress` → `controllers/GRPC/Accounting/invoiceAddress.grpc`."
    },
    {
      "name": "invoiceLine",
      "description": "Registry resource `invoiceLine` → `controllers/GRPC/Accounting/invoiceLine.grpc`."
    },
    {
      "name": "invoiceLinkedBill",
      "description": "Registry resource `invoiceLinkedBill` → `controllers/GRPC/Accounting/invoiceLinkedBill.grpc`."
    },
    {
      "name": "item",
      "description": "Registry resource `item` → `controllers/GRPC/Accounting/item.grpc`."
    },
    {
      "name": "journal",
      "description": "Registry resource `journal` → `controllers/GRPC/Accounting/reports/journal.grpc`."
    },
    {
      "name": "lead",
      "description": "Registry resource `lead` → `controllers/GRPC/Accounting/lead.grpc`."
    },
    {
      "name": "linkedSalesCreditNoteInvoice",
      "description": "Registry resource `linkedSalesCreditNoteInvoice` → `controllers/GRPC/Accounting/linkedSalesCreditNoteInvoice.grpc`."
    },
    {
      "name": "linkedTransaction",
      "description": "Registry resource `linkedTransaction` → `controllers/GRPC/Accounting/linkedTransaction.grpc`."
    },
    {
      "name": "location",
      "description": "Registry resource `location` → `controllers/GRPC/Accounting/location.grpc`."
    },
    {
      "name": "ownerAddress",
      "description": "Registry resource `ownerAddress` → `controllers/GRPC/Accounting/businessOwnerAddress.grpc`."
    },
    {
      "name": "ownerCreditCard",
      "description": "Registry resource `ownerCreditCard` → `controllers/GRPC/Accounting/businessOwnerCreditCard.grpc`."
    },
    {
      "name": "ownerDebitCard",
      "description": "Registry resource `ownerDebitCard` → `controllers/GRPC/Accounting/businessOwnerDebitCard.grpc`."
    },
    {
      "name": "ownerLoanAccounts",
      "description": "Registry resource `ownerLoanAccounts` → `controllers/GRPC/Accounting/businessOwnerLoanAccount.grpc`."
    },
    {
      "name": "payment",
      "description": "Registry resource `payment` → `controllers/GRPC/Accounting/payment.grpc`."
    },
    {
      "name": "profitLoss",
      "description": "Registry resource `profitLoss` → `controllers/GRPC/Accounting/reports/profitLoss.grpc`."
    },
    {
      "name": "project",
      "description": "Registry resource `project` → `controllers/GRPC/Accounting/project.grpc`."
    },
    {
      "name": "purchaseCreditNote",
      "description": "Registry resource `purchaseCreditNote` → `controllers/GRPC/Accounting/purchaseCreditNote.grpc`."
    },
    {
      "name": "purchaseCreditNoteLine",
      "description": "Registry resource `purchaseCreditNoteLine` → `controllers/GRPC/Accounting/purchaseCreditNoteLine.grpc`."
    },
    {
      "name": "purchaseOrder",
      "description": "Registry resource `purchaseOrder` → `controllers/GRPC/Accounting/purchaseOrder.grpc`."
    },
    {
      "name": "purchaseOrderAddress",
      "description": "Registry resource `purchaseOrderAddress` → `controllers/GRPC/Accounting/purchaseOrderAddress.grpc`."
    },
    {
      "name": "purchaseOrderLine",
      "description": "Registry resource `purchaseOrderLine` → `controllers/GRPC/Accounting/purchaseOrderLine.grpc`."
    },
    {
      "name": "purchaseRequest",
      "description": "Registry resource `purchaseRequest` → `controllers/GRPC/Accounting/purchaseRequest.grpc`."
    },
    {
      "name": "purchaseRequestLine",
      "description": "Registry resource `purchaseRequestLine` → `controllers/GRPC/Accounting/purchaseRequestLine.grpc`."
    },
    {
      "name": "quote",
      "description": "Registry resource `quote` → `controllers/GRPC/Accounting/quote.grpc`."
    },
    {
      "name": "quoteLine",
      "description": "Registry resource `quoteLine` → `controllers/GRPC/Accounting/quoteLine.grpc`."
    },
    {
      "name": "reconcile-period",
      "description": "Registry resource `reconcile-period` → `controllers/GRPC/Accounting/reconcilePeriod.grpc`."
    },
    {
      "name": "recurringBill",
      "description": "Registry resource `recurringBill` → `controllers/GRPC/Accounting/recurringBill.grpc`."
    },
    {
      "name": "recurringInvoice",
      "description": "Registry resource `recurringInvoice` → `controllers/GRPC/Accounting/recurringInvoiceTemplate.grpc`."
    },
    {
      "name": "recurringInvoiceAttachment",
      "description": "Registry resource `recurringInvoiceAttachment` → `controllers/GRPC/Accounting/recurringInvoiceAttachment.grpc`."
    },
    {
      "name": "recurringInvoiceLineItem",
      "description": "Registry resource `recurringInvoiceLineItem` → `controllers/GRPC/Accounting/recurringInvoiceLineItem.grpc`."
    },
    {
      "name": "recurringInvoiceLog",
      "description": "Registry resource `recurringInvoiceLog` → `controllers/GRPC/Accounting/recurringInvoiceLog.grpc`."
    },
    {
      "name": "revenueByCustomer",
      "description": "Registry resource `revenueByCustomer` → `controllers/GRPC/Accounting/reports/revenueByCustomer.grpc`."
    },
    {
      "name": "rfq",
      "description": "Registry resource `rfq` → `controllers/GRPC/Accounting/rfq.grpc`."
    },
    {
      "name": "salesCreditNote",
      "description": "Registry resource `salesCreditNote` → `controllers/GRPC/Accounting/salesCreditNote.grpc`."
    },
    {
      "name": "salesCreditNoteLine",
      "description": "Registry resource `salesCreditNoteLine` → `controllers/GRPC/Accounting/salesCreditNoteLine.grpc`."
    },
    {
      "name": "salesOrder",
      "description": "Registry resource `salesOrder` → `controllers/GRPC/Accounting/salesOrder.grpc`."
    },
    {
      "name": "salesOrderLine",
      "description": "Registry resource `salesOrderLine` → `controllers/GRPC/Accounting/salesOrderLine.grpc`."
    },
    {
      "name": "taxation",
      "description": "Registry resource `taxation` → `controllers/GRPC/Accounting/taxation.grpc`."
    },
    {
      "name": "transaction",
      "description": "Registry resource `transaction` → `controllers/GRPC/Accounting/transaction.grpc`."
    },
    {
      "name": "transactionCategorizationIteration",
      "description": "Registry resource `transactionCategorizationIteration` → `controllers/GRPC/Accounting/transactionCategorizationIteration.grpc`."
    },
    {
      "name": "transactionLine",
      "description": "Registry resource `transactionLine` → `controllers/GRPC/Accounting/transactionLine.grpc`."
    },
    {
      "name": "transfer",
      "description": "Registry resource `transfer` → `controllers/GRPC/Accounting/transfer.grpc`."
    },
    {
      "name": "trialBalance",
      "description": "Registry resource `trialBalance` → `controllers/GRPC/Accounting/reports/trialBalance.grpc`."
    },
    {
      "name": "vendor",
      "description": "Registry resource `vendor` → `controllers/GRPC/Accounting/vendor.grpc`."
    },
    {
      "name": "vendorAddress",
      "description": "Registry resource `vendorAddress` → `controllers/GRPC/Accounting/vendorAddress.grpc`."
    },
    {
      "name": "vendorBalance",
      "description": "Registry resource `vendorBalance` → `controllers/GRPC/Accounting/vendorBalance.grpc`."
    },
    {
      "name": "vendorContactPersons",
      "description": "Registry resource `vendorContactPersons` → `controllers/GRPC/Accounting/vendorContactPerson.grpc`."
    },
    {
      "name": "vendorCreditCard",
      "description": "Registry resource `vendorCreditCard` → `controllers/GRPC/Accounting/vendorCreditCard.grpc`."
    },
    {
      "name": "vendorDebitCard",
      "description": "Registry resource `vendorDebitCard` → `controllers/GRPC/Accounting/vendorDebitCard.grpc`."
    },
    {
      "name": "vendorGroup",
      "description": "Registry resource `vendorGroup` → `controllers/GRPC/Accounting/vendorGroup.grpc`."
    },
    {
      "name": "vendorPrepayment",
      "description": "Registry resource `vendorPrepayment` → `controllers/GRPC/Accounting/vendorPrepayment.grpc`."
    },
    {
      "name": "vendorPrepaymentApplication",
      "description": "Registry resource `vendorPrepaymentApplication` → `controllers/GRPC/Accounting/vendorPrepaymentApplication.grpc`."
    },
    {
      "name": "vendorPrepaymentRecurringLink",
      "description": "Registry resource `vendorPrepaymentRecurringLink` → `controllers/GRPC/Accounting/vendorPrepaymentRecurringLink.grpc`."
    },
    {
      "name": "vendorPrepaymentRefund",
      "description": "Registry resource `vendorPrepaymentRefund` → `controllers/GRPC/Accounting/vendorPrepaymentRefund.grpc`."
    },
    {
      "name": "vendorPrepaymentSchedule",
      "description": "Registry resource `vendorPrepaymentSchedule` → `controllers/GRPC/Accounting/vendorPrepaymentSchedule.grpc`."
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "operationId": "healthCheck",
        "summary": "Liveness probe",
        "description": "Returns `{ ok: true, ts: <epoch ms> }`. Still behind the bearer token — there is no anonymous endpoint on this gateway. Excluded from AI-credit metering.\n\nDECLARED FIELD-CONTRACT GAP: this route is listed in `UNCONTRACTED_ROUTE_PREFIXES` in `middlewares/publicApiSerialize.middleware.js`. The response field allowlist does not apply to it; only the deny-key floor does. It is named here rather than omitted.",
        "tags": [
          "service"
        ],
        "security": [
          {
            "marketplaceOAuth2": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "ts": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "ok",
                    "ts"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "hand-written",
        "x-hellobooks-field-contract": "declared-gap",
        "x-hellobooks-tenant-guard": false,
        "x-hellobooks-required-scopes": [],
        "x-hellobooks-scope-grain": "unguarded"
      }
    },
    "/me": {
      "get": {
        "operationId": "getInstallContext",
        "summary": "Describe the calling install",
        "description": "Echoes the install the token is bound to. This is the only way a client can discover which `orgId` / `entityId` its token may use — every other route requires them in the path and 403s on a mismatch. Excluded from AI-credit metering.\n\nDECLARED FIELD-CONTRACT GAP: this route is listed in `UNCONTRACTED_ROUTE_PREFIXES` in `middlewares/publicApiSerialize.middleware.js`. The response field allowlist does not apply to it; only the deny-key floor does. It is named here rather than omitted.",
        "tags": [
          "service"
        ],
        "security": [
          {
            "marketplaceOAuth2": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "install_id": {
                      "type": "string"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "app_slug": {
                      "type": "string"
                    },
                    "org_ref_id": {
                      "type": "string"
                    },
                    "entity_ref_id": {
                      "type": "string"
                    },
                    "scopes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "hand-written",
        "x-hellobooks-field-contract": "declared-gap",
        "x-hellobooks-tenant-guard": false,
        "x-hellobooks-required-scopes": [],
        "x-hellobooks-scope-grain": "unguarded"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/account": {
      "get": {
        "operationId": "listAccount",
        "summary": "List account records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `account` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/account.grpc` → `getAccounts`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:read\")`.",
        "tags": [
          "account"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Account"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `Account` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/Account"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/account.grpc",
        "x-hellobooks-handler": "getAccounts",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:read"
        ],
        "x-hellobooks-scope-domain": "accounting"
      },
      "post": {
        "operationId": "createAccount",
        "summary": "Create account record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `account` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/account.grpc` → `createAccounts`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "account"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Account"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Account` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Account"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/account.grpc",
        "x-hellobooks-handler": "createAccounts",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountNumber": {
                    "type": "string"
                  },
                  "AccountSubType": {
                    "type": "string"
                  },
                  "AccountType": {
                    "type": "string"
                  },
                  "ArrayAccountId": {
                    "type": "string"
                  },
                  "ArrayLinkId": {
                    "type": "string"
                  },
                  "BankName": {
                    "type": "string"
                  },
                  "CashFlowCategory": {
                    "type": "string"
                  },
                  "Classification": {
                    "type": "string"
                  },
                  "Code": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "EquityPurpose": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "HboId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsArrayAccount": {
                    "type": "boolean"
                  },
                  "IsAutoGenerated": {
                    "type": "boolean"
                  },
                  "IsDiscontinued": {
                    "type": "boolean"
                  },
                  "IsFavorite": {
                    "type": "boolean"
                  },
                  "IsInternalTrf": {
                    "type": "boolean"
                  },
                  "IsParentAccount": {
                    "type": "boolean"
                  },
                  "IsPlaidAccount": {
                    "type": "boolean"
                  },
                  "IsSystemDefined": {
                    "type": "boolean"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "ParentAccountRefId": {
                    "type": "string"
                  },
                  "PlaidAccountId": {
                    "type": "string"
                  },
                  "PlaidAvailableBalance": {
                    "type": "number"
                  },
                  "PlaidBalanceAsOf": {
                    "type": "string"
                  },
                  "PlaidBalanceCurrency": {
                    "type": "string"
                  },
                  "PlaidCurrentBalance": {
                    "type": "number"
                  },
                  "PlaidItemId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "StatutoryGroup": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "SystemRole": {
                    "type": "string"
                  },
                  "TallyClosingBalance": {
                    "type": "number"
                  },
                  "TallyDepth": {
                    "type": "integer"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TallyGroupPath": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyLedgerName": {
                    "type": "string"
                  },
                  "TallyOpeningBalance": {
                    "type": "number"
                  },
                  "TallyParentGroup": {
                    "type": "string"
                  },
                  "TallyPrimaryGroup": {
                    "type": "string"
                  },
                  "TaxComponentRefId": {
                    "type": "string"
                  },
                  "TaxComponentType": {
                    "type": "string"
                  },
                  "TaxDirection": {
                    "type": "string"
                  },
                  "TaxRef": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `account`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateAccount",
        "summary": "Update account record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `account` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/account.grpc` → `updateAccounts`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "account"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Account"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Account` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Account"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/account.grpc",
        "x-hellobooks-handler": "updateAccounts",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountNumber": {
                    "type": "string"
                  },
                  "AccountSubType": {
                    "type": "string"
                  },
                  "AccountType": {
                    "type": "string"
                  },
                  "ArrayAccountId": {
                    "type": "string"
                  },
                  "ArrayLinkId": {
                    "type": "string"
                  },
                  "BankName": {
                    "type": "string"
                  },
                  "CashFlowCategory": {
                    "type": "string"
                  },
                  "Classification": {
                    "type": "string"
                  },
                  "Code": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "EquityPurpose": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "HboId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsArrayAccount": {
                    "type": "boolean"
                  },
                  "IsAutoGenerated": {
                    "type": "boolean"
                  },
                  "IsDiscontinued": {
                    "type": "boolean"
                  },
                  "IsFavorite": {
                    "type": "boolean"
                  },
                  "IsInternalTrf": {
                    "type": "boolean"
                  },
                  "IsParentAccount": {
                    "type": "boolean"
                  },
                  "IsPlaidAccount": {
                    "type": "boolean"
                  },
                  "IsSystemDefined": {
                    "type": "boolean"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "ParentAccountRefId": {
                    "type": "string"
                  },
                  "PlaidAccountId": {
                    "type": "string"
                  },
                  "PlaidAvailableBalance": {
                    "type": "number"
                  },
                  "PlaidBalanceAsOf": {
                    "type": "string"
                  },
                  "PlaidBalanceCurrency": {
                    "type": "string"
                  },
                  "PlaidCurrentBalance": {
                    "type": "number"
                  },
                  "PlaidItemId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "StatutoryGroup": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "SystemRole": {
                    "type": "string"
                  },
                  "TallyClosingBalance": {
                    "type": "number"
                  },
                  "TallyDepth": {
                    "type": "integer"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TallyGroupPath": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyLedgerName": {
                    "type": "string"
                  },
                  "TallyOpeningBalance": {
                    "type": "number"
                  },
                  "TallyParentGroup": {
                    "type": "string"
                  },
                  "TallyPrimaryGroup": {
                    "type": "string"
                  },
                  "TaxComponentRefId": {
                    "type": "string"
                  },
                  "TaxComponentType": {
                    "type": "string"
                  },
                  "TaxDirection": {
                    "type": "string"
                  },
                  "TaxRef": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `account`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteAccount",
        "summary": "Delete account record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `account` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/account.grpc` → `deleteAccounts`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "account"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Account"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Account` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Account"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/account.grpc",
        "x-hellobooks-handler": "deleteAccounts",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountNumber": {
                    "type": "string"
                  },
                  "AccountSubType": {
                    "type": "string"
                  },
                  "AccountType": {
                    "type": "string"
                  },
                  "ArrayAccountId": {
                    "type": "string"
                  },
                  "ArrayLinkId": {
                    "type": "string"
                  },
                  "BankName": {
                    "type": "string"
                  },
                  "CashFlowCategory": {
                    "type": "string"
                  },
                  "Classification": {
                    "type": "string"
                  },
                  "Code": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "EquityPurpose": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "HboId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsArrayAccount": {
                    "type": "boolean"
                  },
                  "IsAutoGenerated": {
                    "type": "boolean"
                  },
                  "IsDiscontinued": {
                    "type": "boolean"
                  },
                  "IsFavorite": {
                    "type": "boolean"
                  },
                  "IsInternalTrf": {
                    "type": "boolean"
                  },
                  "IsParentAccount": {
                    "type": "boolean"
                  },
                  "IsPlaidAccount": {
                    "type": "boolean"
                  },
                  "IsSystemDefined": {
                    "type": "boolean"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "ParentAccountRefId": {
                    "type": "string"
                  },
                  "PlaidAccountId": {
                    "type": "string"
                  },
                  "PlaidAvailableBalance": {
                    "type": "number"
                  },
                  "PlaidBalanceAsOf": {
                    "type": "string"
                  },
                  "PlaidBalanceCurrency": {
                    "type": "string"
                  },
                  "PlaidCurrentBalance": {
                    "type": "number"
                  },
                  "PlaidItemId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "StatutoryGroup": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "SystemRole": {
                    "type": "string"
                  },
                  "TallyClosingBalance": {
                    "type": "number"
                  },
                  "TallyDepth": {
                    "type": "integer"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TallyGroupPath": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyLedgerName": {
                    "type": "string"
                  },
                  "TallyOpeningBalance": {
                    "type": "number"
                  },
                  "TallyParentGroup": {
                    "type": "string"
                  },
                  "TallyPrimaryGroup": {
                    "type": "string"
                  },
                  "TaxComponentRefId": {
                    "type": "string"
                  },
                  "TaxComponentType": {
                    "type": "string"
                  },
                  "TaxDirection": {
                    "type": "string"
                  },
                  "TaxRef": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `account`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/account/restore": {
      "put": {
        "operationId": "restoreAccount",
        "summary": "Restore archived account record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `account` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/account.grpc` → `restoreAccounts`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "account"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Account"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Account` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Account"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/account.grpc",
        "x-hellobooks-handler": "restoreAccounts",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountNumber": {
                    "type": "string"
                  },
                  "AccountSubType": {
                    "type": "string"
                  },
                  "AccountType": {
                    "type": "string"
                  },
                  "ArrayAccountId": {
                    "type": "string"
                  },
                  "ArrayLinkId": {
                    "type": "string"
                  },
                  "BankName": {
                    "type": "string"
                  },
                  "CashFlowCategory": {
                    "type": "string"
                  },
                  "Classification": {
                    "type": "string"
                  },
                  "Code": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "EquityPurpose": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "HboId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsArrayAccount": {
                    "type": "boolean"
                  },
                  "IsAutoGenerated": {
                    "type": "boolean"
                  },
                  "IsDiscontinued": {
                    "type": "boolean"
                  },
                  "IsFavorite": {
                    "type": "boolean"
                  },
                  "IsInternalTrf": {
                    "type": "boolean"
                  },
                  "IsParentAccount": {
                    "type": "boolean"
                  },
                  "IsPlaidAccount": {
                    "type": "boolean"
                  },
                  "IsSystemDefined": {
                    "type": "boolean"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "ParentAccountRefId": {
                    "type": "string"
                  },
                  "PlaidAccountId": {
                    "type": "string"
                  },
                  "PlaidAvailableBalance": {
                    "type": "number"
                  },
                  "PlaidBalanceAsOf": {
                    "type": "string"
                  },
                  "PlaidBalanceCurrency": {
                    "type": "string"
                  },
                  "PlaidCurrentBalance": {
                    "type": "number"
                  },
                  "PlaidItemId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "StatutoryGroup": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "SystemRole": {
                    "type": "string"
                  },
                  "TallyClosingBalance": {
                    "type": "number"
                  },
                  "TallyDepth": {
                    "type": "integer"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TallyGroupPath": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyLedgerName": {
                    "type": "string"
                  },
                  "TallyOpeningBalance": {
                    "type": "number"
                  },
                  "TallyParentGroup": {
                    "type": "string"
                  },
                  "TallyPrimaryGroup": {
                    "type": "string"
                  },
                  "TaxComponentRefId": {
                    "type": "string"
                  },
                  "TaxComponentType": {
                    "type": "string"
                  },
                  "TaxDirection": {
                    "type": "string"
                  },
                  "TaxRef": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `account`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/account/{id}": {
      "get": {
        "operationId": "getAccount",
        "summary": "Fetch one account record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `account` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/account.grpc` → `getAccountById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:read\")`.",
        "tags": [
          "account"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Account"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Account` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Account"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/account.grpc",
        "x-hellobooks-handler": "getAccountById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:read"
        ],
        "x-hellobooks-scope-domain": "accounting"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/accountsByPayee": {
      "get": {
        "operationId": "listAccountsByPayee",
        "summary": "List accountsByPayee records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `accountsByPayee` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/accountsByPayee.grpc` → `getAccountsByAllPayee`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:read\")`.",
        "tags": [
          "accountsByPayee"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/AccountsByPayee"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `AccountsByPayee` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/AccountsByPayee"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/accountsByPayee.grpc",
        "x-hellobooks-handler": "getAccountsByAllPayee",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:read"
        ],
        "x-hellobooks-scope-domain": "banking"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/agedPayables": {
      "get": {
        "operationId": "listAgedPayables",
        "summary": "List agedPayables records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `agedPayables` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/agedPayables.grpc` → `getAgedPayables`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"reports:read\")`.",
        "tags": [
          "agedPayables"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "reports:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "name": "asOfDate",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "periodType",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customPeriods",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dynamicConfig",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agingBy",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupBy",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "basis",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeZeroBalance",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeOnlyOverdue",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "currencies",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vendorStatus",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "billStatus",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vendorIds",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locationIds",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "projectIds",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "classSlices",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "compare",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minTotal",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "maxTotal",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minOverdue",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "maxOverdue",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "depth",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "topN",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/AgedPayables"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `AgedPayables` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/AgedPayables"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/agedPayables.grpc",
        "x-hellobooks-handler": "getAgedPayables",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "reports:read"
        ],
        "x-hellobooks-scope-domain": "reports"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/agedPayablesSummary": {
      "get": {
        "operationId": "listAgedPayablesSummary",
        "summary": "List agedPayablesSummary records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `agedPayablesSummary` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/agedPayables.grpc` → `getAgedPayablesSummary`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"reports:read\")`.",
        "tags": [
          "agedPayablesSummary"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "reports:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "name": "asOfDate",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayablesSummary` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayablesSummary` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "currencies",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayablesSummary` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vendorStatus",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayablesSummary` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "billStatus",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayablesSummary` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minTotal",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayablesSummary` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "maxTotal",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayablesSummary` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minOverdue",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayablesSummary` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "maxOverdue",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedPayablesSummary` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedPayables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/AgedPayablesSummary"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `AgedPayablesSummary` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/AgedPayablesSummary"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/agedPayables.grpc",
        "x-hellobooks-handler": "getAgedPayablesSummary",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "reports:read"
        ],
        "x-hellobooks-scope-domain": "reports"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/agedReceivables": {
      "get": {
        "operationId": "listAgedReceivables",
        "summary": "List agedReceivables records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `agedReceivables` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/agedReceivables.grpc` → `getAgedReceivables`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"reports:read\")`.",
        "tags": [
          "agedReceivables"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "reports:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "name": "asOfDate",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "periodType",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customPeriods",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dynamicConfig",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agingBy",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupBy",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "basis",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeZeroBalance",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeOnlyOverdue",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "currencies",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerStatus",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invoiceStatus",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerIds",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locationIds",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "projectIds",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "classSlices",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "compare",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minTotal",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "maxTotal",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minOverdue",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "maxOverdue",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "depth",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "topN",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivables` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/AgedReceivables"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `AgedReceivables` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/AgedReceivables"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/agedReceivables.grpc",
        "x-hellobooks-handler": "getAgedReceivables",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "reports:read"
        ],
        "x-hellobooks-scope-domain": "reports"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/agedReceivablesSummary": {
      "get": {
        "operationId": "listAgedReceivablesSummary",
        "summary": "List agedReceivablesSummary records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `agedReceivablesSummary` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/agedReceivables.grpc` → `getAgedReceivablesSummary`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"reports:read\")`.",
        "tags": [
          "agedReceivablesSummary"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "reports:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "name": "asOfDate",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivablesSummary` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivablesSummary` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "currencies",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivablesSummary` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerStatus",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivablesSummary` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invoiceStatus",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivablesSummary` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minTotal",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivablesSummary` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "maxTotal",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivablesSummary` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minOverdue",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivablesSummary` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "maxOverdue",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `agedReceivablesSummary` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/agedReceivables.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/AgedReceivablesSummary"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `AgedReceivablesSummary` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/AgedReceivablesSummary"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/agedReceivables.grpc",
        "x-hellobooks-handler": "getAgedReceivablesSummary",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "reports:read"
        ],
        "x-hellobooks-scope-domain": "reports"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/approvalRule": {
      "get": {
        "operationId": "listApprovalRule",
        "summary": "List approvalRule records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `approvalRule` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/approvalRule.grpc` → `listApprovalRules`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "approvalRule"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/ApprovalRule"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `ApprovalRule` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/ApprovalRule"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/approvalRule.grpc",
        "x-hellobooks-handler": "listApprovalRules",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      },
      "post": {
        "operationId": "createApprovalRule",
        "summary": "Create approvalRule record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `approvalRule` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/approvalRule.grpc` → `createApprovalRule`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "approvalRule"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/ApprovalRule"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `ApprovalRule` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/ApprovalRule"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/approvalRule.grpc",
        "x-hellobooks-handler": "createApprovalRule",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `create` on `approvalRule`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. In addition, this gateway delegates straight to the internal controller, which in several cases expects the records under a resource-named wrapper key. This resource does not declare one — its create and update handlers disagree about the key, or it takes no records array at all — so the accepted envelope is not described here rather than guessed at.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteApprovalRule",
        "summary": "Delete approvalRule record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `approvalRule` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/approvalRule.grpc` → `deleteApprovalRules`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "approvalRule"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/ApprovalRule"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `ApprovalRule` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/ApprovalRule"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/approvalRule.grpc",
        "x-hellobooks-handler": "deleteApprovalRules",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `del` on `approvalRule`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. In addition, this gateway delegates straight to the internal controller, which in several cases expects the records under a resource-named wrapper key. This resource does not declare one — its create and update handlers disagree about the key, or it takes no records array at all — so the accepted envelope is not described here rather than guessed at.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/assetAttachment": {
      "put": {
        "operationId": "updateAssetAttachment",
        "summary": "Update assetAttachment record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `assetAttachment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/assetAttachment.grpc` → `updateAssetAttachment`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:write\")`.",
        "tags": [
          "assetAttachment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/AssetAttachment"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `AssetAttachment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/AssetAttachment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/assetAttachment.grpc",
        "x-hellobooks-handler": "updateAssetAttachment",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:write"
        ],
        "x-hellobooks-scope-domain": "fixedassets",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Description": {
                    "type": "string"
                  },
                  "FileName": {
                    "type": "string"
                  },
                  "FileSize": {
                    "type": "integer"
                  },
                  "FileType": {
                    "type": "string"
                  },
                  "FileUrl": {
                    "type": "string"
                  },
                  "FixedAssetId": {
                    "type": "string"
                  },
                  "UploadedBy": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `assetAttachment`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/assetAttachment/{id}": {
      "get": {
        "operationId": "getAssetAttachment",
        "summary": "Fetch one assetAttachment record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `assetAttachment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/assetAttachment.grpc` → `getAssetAttachmentById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:read\")`.",
        "tags": [
          "assetAttachment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/AssetAttachment"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `AssetAttachment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/AssetAttachment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/assetAttachment.grpc",
        "x-hellobooks-handler": "getAssetAttachmentById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:read"
        ],
        "x-hellobooks-scope-domain": "fixedassets"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/assetDisposal": {
      "get": {
        "operationId": "listAssetDisposal",
        "summary": "List assetDisposal records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `assetDisposal` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/assetDisposal.grpc` → `getAssetDisposals`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:read\")`.",
        "tags": [
          "assetDisposal"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/AssetDisposal"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `AssetDisposal` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/AssetDisposal"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/assetDisposal.grpc",
        "x-hellobooks-handler": "getAssetDisposals",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:read"
        ],
        "x-hellobooks-scope-domain": "fixedassets"
      },
      "post": {
        "operationId": "createAssetDisposal",
        "summary": "Create assetDisposal record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `assetDisposal` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/assetDisposal.grpc` → `createAssetDisposal`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:write\")`.",
        "tags": [
          "assetDisposal"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/AssetDisposal"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `AssetDisposal` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/AssetDisposal"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/assetDisposal.grpc",
        "x-hellobooks-handler": "createAssetDisposal",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:write"
        ],
        "x-hellobooks-scope-domain": "fixedassets",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "BookValue": {
                    "type": "number"
                  },
                  "BuyerName": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "DisposalCosts": {
                    "type": "number"
                  },
                  "DisposalDate": {
                    "type": "string"
                  },
                  "DisposalType": {
                    "type": "string"
                  },
                  "FixedAssetId": {
                    "type": "string"
                  },
                  "GainLoss": {
                    "type": "number"
                  },
                  "IsJournalized": {
                    "type": "boolean"
                  },
                  "JournalEntryId": {
                    "type": "string"
                  },
                  "NetProceeds": {
                    "type": "number"
                  },
                  "Reason": {
                    "type": "string"
                  },
                  "Rule43GSTOnSaleValue": {
                    "type": "number"
                  },
                  "Rule43IsAutoComputed": {
                    "type": "boolean"
                  },
                  "Rule43MonthsRemaining": {
                    "type": "integer"
                  },
                  "Rule43MonthsUsed": {
                    "type": "integer"
                  },
                  "Rule43OriginalITC": {
                    "type": "number"
                  },
                  "Rule43ProportionalITC": {
                    "type": "number"
                  },
                  "Rule43ReversalAmount": {
                    "type": "number"
                  },
                  "Rule43ReversalBasis": {
                    "type": "string"
                  },
                  "SaleProceeds": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `assetDisposal`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/assetDisposal/{id}": {
      "get": {
        "operationId": "getAssetDisposal",
        "summary": "Fetch one assetDisposal record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `assetDisposal` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/assetDisposal.grpc` → `getAssetDisposalById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:read\")`.",
        "tags": [
          "assetDisposal"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/AssetDisposal"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `AssetDisposal` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/AssetDisposal"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/assetDisposal.grpc",
        "x-hellobooks-handler": "getAssetDisposalById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:read"
        ],
        "x-hellobooks-scope-domain": "fixedassets"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/assetGroup": {
      "get": {
        "operationId": "listAssetGroup",
        "summary": "List assetGroup records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `assetGroup` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/assetGroup.grpc` → `getAssetGroups`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:read\")`.",
        "tags": [
          "assetGroup"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/AssetGroup"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `AssetGroup` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/AssetGroup"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/assetGroup.grpc",
        "x-hellobooks-handler": "getAssetGroups",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:read"
        ],
        "x-hellobooks-scope-domain": "fixedassets"
      },
      "post": {
        "operationId": "createAssetGroup",
        "summary": "Create assetGroup record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `assetGroup` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/assetGroup.grpc` → `createAssetGroup`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:write\")`.",
        "tags": [
          "assetGroup"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/AssetGroup"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `AssetGroup` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/AssetGroup"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/assetGroup.grpc",
        "x-hellobooks-handler": "createAssetGroup",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:write"
        ],
        "x-hellobooks-scope-domain": "fixedassets",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccumulatedDepreciationAccountId": {
                    "type": "string"
                  },
                  "Code": {
                    "type": "string"
                  },
                  "DepreciationExpenseAccountId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsBuilding": {
                    "type": "boolean"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "ParentId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `assetGroup`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateAssetGroup",
        "summary": "Update assetGroup record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `assetGroup` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/assetGroup.grpc` → `updateAssetGroup`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:write\")`.",
        "tags": [
          "assetGroup"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/AssetGroup"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `AssetGroup` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/AssetGroup"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/assetGroup.grpc",
        "x-hellobooks-handler": "updateAssetGroup",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:write"
        ],
        "x-hellobooks-scope-domain": "fixedassets",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccumulatedDepreciationAccountId": {
                    "type": "string"
                  },
                  "Code": {
                    "type": "string"
                  },
                  "DepreciationExpenseAccountId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsBuilding": {
                    "type": "boolean"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "ParentId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `assetGroup`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteAssetGroup",
        "summary": "Delete assetGroup record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `assetGroup` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/assetGroup.grpc` → `deleteAssetGroups`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:write\")`.",
        "tags": [
          "assetGroup"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/AssetGroup"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `AssetGroup` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/AssetGroup"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/assetGroup.grpc",
        "x-hellobooks-handler": "deleteAssetGroups",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:write"
        ],
        "x-hellobooks-scope-domain": "fixedassets",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccumulatedDepreciationAccountId": {
                    "type": "string"
                  },
                  "Code": {
                    "type": "string"
                  },
                  "DepreciationExpenseAccountId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsBuilding": {
                    "type": "boolean"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "ParentId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `assetGroup`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/assetGroup/{id}": {
      "get": {
        "operationId": "getAssetGroup",
        "summary": "Fetch one assetGroup record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `assetGroup` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/assetGroup.grpc` → `getAssetGroupById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:read\")`.",
        "tags": [
          "assetGroup"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/AssetGroup"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `AssetGroup` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/AssetGroup"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/assetGroup.grpc",
        "x-hellobooks-handler": "getAssetGroupById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:read"
        ],
        "x-hellobooks-scope-domain": "fixedassets"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/assetSurvey": {
      "get": {
        "operationId": "listAssetSurvey",
        "summary": "List assetSurvey records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `assetSurvey` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/assetSurvey.grpc` → `getAssetSurveys`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:read\")`.",
        "tags": [
          "assetSurvey"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/AssetSurvey"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `AssetSurvey` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/AssetSurvey"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/assetSurvey.grpc",
        "x-hellobooks-handler": "getAssetSurveys",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:read"
        ],
        "x-hellobooks-scope-domain": "fixedassets"
      },
      "post": {
        "operationId": "createAssetSurvey",
        "summary": "Create assetSurvey record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `assetSurvey` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/assetSurvey.grpc` → `createAssetSurvey`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:write\")`.",
        "tags": [
          "assetSurvey"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/AssetSurvey"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `AssetSurvey` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/AssetSurvey"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/assetSurvey.grpc",
        "x-hellobooks-handler": "createAssetSurvey",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:write"
        ],
        "x-hellobooks-scope-domain": "fixedassets",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "CompletedBy": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "Department": {
                    "type": "string"
                  },
                  "EndDate": {
                    "type": "string"
                  },
                  "LocationId": {
                    "type": "string"
                  },
                  "StartDate": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SurveyName": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `assetSurvey`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateAssetSurvey",
        "summary": "Update assetSurvey record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `assetSurvey` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/assetSurvey.grpc` → `updateAssetSurvey`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:write\")`.",
        "tags": [
          "assetSurvey"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/AssetSurvey"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `AssetSurvey` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/AssetSurvey"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/assetSurvey.grpc",
        "x-hellobooks-handler": "updateAssetSurvey",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:write"
        ],
        "x-hellobooks-scope-domain": "fixedassets",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "CompletedBy": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "Department": {
                    "type": "string"
                  },
                  "EndDate": {
                    "type": "string"
                  },
                  "LocationId": {
                    "type": "string"
                  },
                  "StartDate": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SurveyName": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `assetSurvey`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/assetSurvey/{id}": {
      "get": {
        "operationId": "getAssetSurvey",
        "summary": "Fetch one assetSurvey record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `assetSurvey` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/assetSurvey.grpc` → `getAssetSurveyById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:read\")`.",
        "tags": [
          "assetSurvey"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/AssetSurvey"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `AssetSurvey` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/AssetSurvey"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/assetSurvey.grpc",
        "x-hellobooks-handler": "getAssetSurveyById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:read"
        ],
        "x-hellobooks-scope-domain": "fixedassets"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/assetTimingDifference": {
      "get": {
        "operationId": "listAssetTimingDifference",
        "summary": "List assetTimingDifference records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `assetTimingDifference` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/assetTimingDifference.grpc` → `getAssetTimingDifferences`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:read\")`.",
        "tags": [
          "assetTimingDifference"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/AssetTimingDifference"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `AssetTimingDifference` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/AssetTimingDifference"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/assetTimingDifference.grpc",
        "x-hellobooks-handler": "getAssetTimingDifferences",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:read"
        ],
        "x-hellobooks-scope-domain": "fixedassets"
      },
      "post": {
        "operationId": "createAssetTimingDifference",
        "summary": "Create assetTimingDifference record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `assetTimingDifference` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/assetTimingDifference.grpc` → `createAssetTimingDifference`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:write\")`.",
        "tags": [
          "assetTimingDifference"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/AssetTimingDifference"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `AssetTimingDifference` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/AssetTimingDifference"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/assetTimingDifference.grpc",
        "x-hellobooks-handler": "createAssetTimingDifference",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:write"
        ],
        "x-hellobooks-scope-domain": "fixedassets",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "BookDepreciation": {
                    "type": "number"
                  },
                  "DeferredTaxAmount": {
                    "type": "number"
                  },
                  "DeferredTaxRate": {
                    "type": "number"
                  },
                  "FixedAssetId": {
                    "type": "string"
                  },
                  "IsJournalized": {
                    "type": "boolean"
                  },
                  "JournalDate": {
                    "type": "string"
                  },
                  "JournalEntryId": {
                    "type": "string"
                  },
                  "Period": {
                    "type": "string"
                  },
                  "TaxDepreciation": {
                    "type": "number"
                  },
                  "TimingDifference": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `assetTimingDifference`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateAssetTimingDifference",
        "summary": "Update assetTimingDifference record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `assetTimingDifference` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/assetTimingDifference.grpc` → `updateAssetTimingDifference`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:write\")`.",
        "tags": [
          "assetTimingDifference"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/AssetTimingDifference"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `AssetTimingDifference` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/AssetTimingDifference"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/assetTimingDifference.grpc",
        "x-hellobooks-handler": "updateAssetTimingDifference",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:write"
        ],
        "x-hellobooks-scope-domain": "fixedassets",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "BookDepreciation": {
                    "type": "number"
                  },
                  "DeferredTaxAmount": {
                    "type": "number"
                  },
                  "DeferredTaxRate": {
                    "type": "number"
                  },
                  "FixedAssetId": {
                    "type": "string"
                  },
                  "IsJournalized": {
                    "type": "boolean"
                  },
                  "JournalDate": {
                    "type": "string"
                  },
                  "JournalEntryId": {
                    "type": "string"
                  },
                  "Period": {
                    "type": "string"
                  },
                  "TaxDepreciation": {
                    "type": "number"
                  },
                  "TimingDifference": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `assetTimingDifference`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/assetTimingDifference/{id}": {
      "get": {
        "operationId": "getAssetTimingDifference",
        "summary": "Fetch one assetTimingDifference record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `assetTimingDifference` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/assetTimingDifference.grpc` → `getAssetTimingDifferenceById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:read\")`.",
        "tags": [
          "assetTimingDifference"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/AssetTimingDifference"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `AssetTimingDifference` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/AssetTimingDifference"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/assetTimingDifference.grpc",
        "x-hellobooks-handler": "getAssetTimingDifferenceById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:read"
        ],
        "x-hellobooks-scope-domain": "fixedassets"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/assetTransfer": {
      "get": {
        "operationId": "listAssetTransfer",
        "summary": "List assetTransfer records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `assetTransfer` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/assetTransfer.grpc` → `getAssetTransfers`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:read\")`.",
        "tags": [
          "assetTransfer"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/AssetTransfer"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `AssetTransfer` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/AssetTransfer"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/assetTransfer.grpc",
        "x-hellobooks-handler": "getAssetTransfers",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:read"
        ],
        "x-hellobooks-scope-domain": "fixedassets"
      },
      "post": {
        "operationId": "createAssetTransfer",
        "summary": "Create assetTransfer record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `assetTransfer` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/assetTransfer.grpc` → `createAssetTransfer`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:write\")`.",
        "tags": [
          "assetTransfer"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/AssetTransfer"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `AssetTransfer` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/AssetTransfer"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/assetTransfer.grpc",
        "x-hellobooks-handler": "createAssetTransfer",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:write"
        ],
        "x-hellobooks-scope-domain": "fixedassets",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "FixedAssetId": {
                    "type": "string"
                  },
                  "FromDepartment": {
                    "type": "string"
                  },
                  "FromLocationId": {
                    "type": "string"
                  },
                  "Reason": {
                    "type": "string"
                  },
                  "ToDepartment": {
                    "type": "string"
                  },
                  "ToLocationId": {
                    "type": "string"
                  },
                  "TransferDate": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `assetTransfer`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteAssetTransfer",
        "summary": "Delete assetTransfer record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `assetTransfer` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/assetTransfer.grpc` → `deleteAssetTransfers`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:write\")`.",
        "tags": [
          "assetTransfer"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/AssetTransfer"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `AssetTransfer` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/AssetTransfer"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/assetTransfer.grpc",
        "x-hellobooks-handler": "deleteAssetTransfers",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:write"
        ],
        "x-hellobooks-scope-domain": "fixedassets",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "FixedAssetId": {
                    "type": "string"
                  },
                  "FromDepartment": {
                    "type": "string"
                  },
                  "FromLocationId": {
                    "type": "string"
                  },
                  "Reason": {
                    "type": "string"
                  },
                  "ToDepartment": {
                    "type": "string"
                  },
                  "ToLocationId": {
                    "type": "string"
                  },
                  "TransferDate": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `assetTransfer`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/assetTransfer/restore": {
      "put": {
        "operationId": "restoreAssetTransfer",
        "summary": "Restore archived assetTransfer record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `assetTransfer` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/assetTransfer.grpc` → `restoreAssetTransfers`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:write\")`.",
        "tags": [
          "assetTransfer"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/AssetTransfer"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `AssetTransfer` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/AssetTransfer"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/assetTransfer.grpc",
        "x-hellobooks-handler": "restoreAssetTransfers",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:write"
        ],
        "x-hellobooks-scope-domain": "fixedassets",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "FixedAssetId": {
                    "type": "string"
                  },
                  "FromDepartment": {
                    "type": "string"
                  },
                  "FromLocationId": {
                    "type": "string"
                  },
                  "Reason": {
                    "type": "string"
                  },
                  "ToDepartment": {
                    "type": "string"
                  },
                  "ToLocationId": {
                    "type": "string"
                  },
                  "TransferDate": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `assetTransfer`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/balanceSheet": {
      "get": {
        "operationId": "listBalanceSheet",
        "summary": "List balanceSheet records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `balanceSheet` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/reports/balanceSheet.grpc` → `getBalanceSheets`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"reports:read\")`.",
        "tags": [
          "balanceSheet"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "reports:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/BalanceSheet"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `BalanceSheet` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/BalanceSheet"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/reports/balanceSheet.grpc",
        "x-hellobooks-handler": "getBalanceSheets",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "reports:read"
        ],
        "x-hellobooks-scope-domain": "reports"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/bill": {
      "get": {
        "operationId": "listBill",
        "summary": "List bill records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `bill` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/bill.grpc` → `getBills`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "bill"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Bill"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `Bill` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/Bill"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/bill.grpc",
        "x-hellobooks-handler": "getBills",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      },
      "post": {
        "operationId": "createBill",
        "summary": "Create bill record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `bill` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/bill.grpc` → `createBills`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "bill"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Bill"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Bill` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Bill"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/bill.grpc",
        "x-hellobooks-handler": "createBills",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AISuggesstion": {
                    "type": "object"
                  },
                  "AiIterationCount": {
                    "type": "integer"
                  },
                  "AiTotalIterCachedTokens": {
                    "type": "integer"
                  },
                  "AiTotalIterInputTokens": {
                    "type": "integer"
                  },
                  "AiTotalIterOutputTokens": {
                    "type": "integer"
                  },
                  "AiTotalIterTotalINR": {
                    "type": "number"
                  },
                  "AiTotalIterTotalUSD": {
                    "type": "number"
                  },
                  "ApprovalComment": {
                    "type": "string"
                  },
                  "ApprovalStatus": {
                    "type": "string"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BauabzugBaseAmount": {
                    "type": "number"
                  },
                  "BauabzugFreistellungNumberSnapshot": {
                    "type": "string"
                  },
                  "BauabzugRate": {
                    "type": "number"
                  },
                  "BauabzugWithheldAmount": {
                    "type": "number"
                  },
                  "BauabzugWithholding": {
                    "type": "boolean"
                  },
                  "BillMatchingAnalysis": {
                    "type": "object"
                  },
                  "BillNumber": {
                    "type": "string"
                  },
                  "BrandingThemeId": {
                    "type": "string"
                  },
                  "CapitalGoodCommonUse": {
                    "type": "boolean"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "object"
                  },
                  "ConfidencePercentage": {
                    "type": "string"
                  },
                  "ContractRefId": {
                    "type": "string"
                  },
                  "CounterpartyEntityRefId": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CreatedById": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "CustomsDutyAmount": {
                    "type": "number"
                  },
                  "DifferentialPercent": {
                    "type": "number"
                  },
                  "DueDate": {
                    "type": "string"
                  },
                  "EstimatedPaymentDate": {
                    "type": "string"
                  },
                  "EwayBillRequired": {
                    "type": "boolean"
                  },
                  "EwbGeneratedAt": {
                    "type": "string"
                  },
                  "EwbNo": {
                    "type": "string"
                  },
                  "EwbRefId": {
                    "type": "string"
                  },
                  "EwbStatus": {
                    "type": "string"
                  },
                  "EwbValidUpto": {
                    "type": "string"
                  },
                  "EwtAtcCode": {
                    "type": "string"
                  },
                  "EwtBaseAmount": {
                    "type": "number"
                  },
                  "EwtExemptCertSnapshot": {
                    "type": "string"
                  },
                  "EwtRate": {
                    "type": "number"
                  },
                  "EwtReason": {
                    "type": "string"
                  },
                  "EwtWithheldAmount": {
                    "type": "number"
                  },
                  "EwtWithholding": {
                    "type": "boolean"
                  },
                  "ExchangeGainLoss": {
                    "type": "number"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExcludeFromEwb": {
                    "type": "boolean"
                  },
                  "FRRetenueBaseAmount": {
                    "type": "number"
                  },
                  "FRRetenueBucket": {
                    "type": "string"
                  },
                  "FRRetenueDttCertNoSnapshot": {
                    "type": "string"
                  },
                  "FRRetenueRate": {
                    "type": "number"
                  },
                  "FRRetenueWithheldAmount": {
                    "type": "number"
                  },
                  "FRRetenueWithholding": {
                    "type": "boolean"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FunctionalTotalPayableAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "GoodsReceiptNoteRef": {
                    "type": "string"
                  },
                  "HasGoodsReceipt": {
                    "type": "boolean"
                  },
                  "ITCReclaimedAmount": {
                    "type": "number"
                  },
                  "ITCReclaimedAt": {
                    "type": "string"
                  },
                  "ITCReversedAmount": {
                    "type": "number"
                  },
                  "ITCReversedAt": {
                    "type": "string"
                  },
                  "IrpfBaseAmount": {
                    "type": "number"
                  },
                  "IrpfRate": {
                    "type": "number"
                  },
                  "IrpfSection": {
                    "type": "string"
                  },
                  "IrpfWithheldAmount": {
                    "type": "number"
                  },
                  "IrpfWithholding": {
                    "type": "boolean"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsCapitalGood": {
                    "type": "boolean"
                  },
                  "IsCommonUse": {
                    "type": "boolean"
                  },
                  "IsConversion": {
                    "type": "boolean"
                  },
                  "IsEcGoodsMovement": {
                    "type": "boolean"
                  },
                  "IsGstTdsApplicable": {
                    "type": "boolean"
                  },
                  "IsITCEligible": {
                    "type": "boolean"
                  },
                  "IsInterCompany": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsPublishedToQbo": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "JpConsumptionTaxAmount": {
                    "type": "number"
                  },
                  "JpConsumptionTaxBaseAmount": {
                    "type": "number"
                  },
                  "JpConsumptionTaxRate": {
                    "type": "number"
                  },
                  "JpGensenChoshuApplicable": {
                    "type": "boolean"
                  },
                  "JpGensenChoshuBaseAmount": {
                    "type": "number"
                  },
                  "JpGensenChoshuHighAmount": {
                    "type": "number"
                  },
                  "JpGensenChoshuLowAmount": {
                    "type": "number"
                  },
                  "JpGensenChoshuSection": {
                    "type": "string"
                  },
                  "JpGensenChoshuWithheldAmount": {
                    "type": "number"
                  },
                  "JpIsReducedRate": {
                    "type": "boolean"
                  },
                  "JpItcLossAmount": {
                    "type": "number"
                  },
                  "JpItcPhaseCreditPct": {
                    "type": "number"
                  },
                  "JpQualifiedInvoiceApplicable": {
                    "type": "boolean"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "NeedsReview": {
                    "type": "boolean"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "OriginalTotals": {
                    "type": "object"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PayeeAddresses": {
                    "type": "array"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PaygBaseAmount": {
                    "type": "number"
                  },
                  "PaygRate": {
                    "type": "number"
                  },
                  "PaygSection": {
                    "type": "string"
                  },
                  "PaygWithheldAmount": {
                    "type": "number"
                  },
                  "PaygWithholding": {
                    "type": "boolean"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "PphArticle": {
                    "type": "string"
                  },
                  "PphBaseAmount": {
                    "type": "number"
                  },
                  "PphBasis": {
                    "type": "string"
                  },
                  "PphNoNpwpDoubled": {
                    "type": "boolean"
                  },
                  "PphRate": {
                    "type": "number"
                  },
                  "PphReason": {
                    "type": "string"
                  },
                  "PphResolutionBasis": {
                    "type": "string"
                  },
                  "PphWithheldAmount": {
                    "type": "number"
                  },
                  "PphWithholding": {
                    "type": "boolean"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "PurchaseOrderRef": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "RCMCategory": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "Reg105BaseAmount": {
                    "type": "number"
                  },
                  "Reg105FederalRate": {
                    "type": "number"
                  },
                  "Reg105FederalWithheld": {
                    "type": "number"
                  },
                  "Reg105QcRate": {
                    "type": "number"
                  },
                  "Reg105QcWithheld": {
                    "type": "number"
                  },
                  "Reg105WaiverApplied": {
                    "type": "boolean"
                  },
                  "Reg105WaiverCertNoSnapshot": {
                    "type": "string"
                  },
                  "Reg105Withholding": {
                    "type": "boolean"
                  },
                  "ReviewReason": {
                    "type": "string"
                  },
                  "RitenutaBaseAmount": {
                    "type": "number"
                  },
                  "RitenutaBaseBasis": {
                    "type": "string"
                  },
                  "RitenutaCausale": {
                    "type": "string"
                  },
                  "RitenutaRate": {
                    "type": "number"
                  },
                  "RitenutaTaxableBase": {
                    "type": "number"
                  },
                  "RitenutaWithheldAmount": {
                    "type": "number"
                  },
                  "RitenutaWithholding": {
                    "type": "boolean"
                  },
                  "SchedularActivityCode": {
                    "type": "string"
                  },
                  "SchedularBaseAmount": {
                    "type": "number"
                  },
                  "SchedularRate": {
                    "type": "number"
                  },
                  "SchedularWithheldAmount": {
                    "type": "number"
                  },
                  "SchedularWithholding": {
                    "type": "boolean"
                  },
                  "SelfInvoiceRefId": {
                    "type": "string"
                  },
                  "SellerGSTIN": {
                    "type": "string"
                  },
                  "ServicesPerformedInQc": {
                    "type": "boolean"
                  },
                  "Source": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "SyncedTo": {
                    "type": "string"
                  },
                  "SyncedToTally": {
                    "type": "boolean"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyNumber": {
                    "type": "string"
                  },
                  "TallyVoucherSeries": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TaxMappingMessage": {
                    "type": "string"
                  },
                  "TaxRef": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TcsAmount": {
                    "type": "number"
                  },
                  "TcsBaseAmount": {
                    "type": "number"
                  },
                  "TcsRate": {
                    "type": "number"
                  },
                  "TcsRefId": {
                    "type": "string"
                  },
                  "TdsAmount": {
                    "type": "number"
                  },
                  "TdsBaseAmount": {
                    "type": "number"
                  },
                  "TdsRate": {
                    "type": "number"
                  },
                  "TdsRefId": {
                    "type": "string"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalCGST": {
                    "type": "number"
                  },
                  "TotalCess": {
                    "type": "number"
                  },
                  "TotalCessNonAdvalorem": {
                    "type": "number"
                  },
                  "TotalDiscountAmount": {
                    "type": "number"
                  },
                  "TotalIGST": {
                    "type": "number"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalSGST": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "TotalUTGST": {
                    "type": "number"
                  },
                  "VendorInvoiceDate": {
                    "type": "string"
                  },
                  "VendorInvoiceNo": {
                    "type": "string"
                  },
                  "VendorPrepaymentRefId": {
                    "type": "string"
                  },
                  "VoidReason": {
                    "type": "string"
                  },
                  "VoidedAt": {
                    "type": "string"
                  },
                  "VoidedBy": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "WhtArticle": {
                    "type": "string"
                  },
                  "WhtBaseAmount": {
                    "type": "number"
                  },
                  "WhtBasis": {
                    "type": "string"
                  },
                  "WhtCategory": {
                    "type": "string"
                  },
                  "WhtGlCode": {
                    "type": "string"
                  },
                  "WhtRate": {
                    "type": "number"
                  },
                  "WhtReason": {
                    "type": "string"
                  },
                  "WhtWithheldAmount": {
                    "type": "number"
                  },
                  "WhtWithholding": {
                    "type": "boolean"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `bill`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateBill",
        "summary": "Update bill record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `bill` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/bill.grpc` → `updateBills`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "bill"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Bill"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Bill` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Bill"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/bill.grpc",
        "x-hellobooks-handler": "updateBills",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AISuggesstion": {
                    "type": "object"
                  },
                  "AiIterationCount": {
                    "type": "integer"
                  },
                  "AiTotalIterCachedTokens": {
                    "type": "integer"
                  },
                  "AiTotalIterInputTokens": {
                    "type": "integer"
                  },
                  "AiTotalIterOutputTokens": {
                    "type": "integer"
                  },
                  "AiTotalIterTotalINR": {
                    "type": "number"
                  },
                  "AiTotalIterTotalUSD": {
                    "type": "number"
                  },
                  "ApprovalComment": {
                    "type": "string"
                  },
                  "ApprovalStatus": {
                    "type": "string"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BauabzugBaseAmount": {
                    "type": "number"
                  },
                  "BauabzugFreistellungNumberSnapshot": {
                    "type": "string"
                  },
                  "BauabzugRate": {
                    "type": "number"
                  },
                  "BauabzugWithheldAmount": {
                    "type": "number"
                  },
                  "BauabzugWithholding": {
                    "type": "boolean"
                  },
                  "BillMatchingAnalysis": {
                    "type": "object"
                  },
                  "BillNumber": {
                    "type": "string"
                  },
                  "BrandingThemeId": {
                    "type": "string"
                  },
                  "CapitalGoodCommonUse": {
                    "type": "boolean"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "object"
                  },
                  "ConfidencePercentage": {
                    "type": "string"
                  },
                  "ContractRefId": {
                    "type": "string"
                  },
                  "CounterpartyEntityRefId": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CreatedById": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "CustomsDutyAmount": {
                    "type": "number"
                  },
                  "DifferentialPercent": {
                    "type": "number"
                  },
                  "DueDate": {
                    "type": "string"
                  },
                  "EstimatedPaymentDate": {
                    "type": "string"
                  },
                  "EwayBillRequired": {
                    "type": "boolean"
                  },
                  "EwbGeneratedAt": {
                    "type": "string"
                  },
                  "EwbNo": {
                    "type": "string"
                  },
                  "EwbRefId": {
                    "type": "string"
                  },
                  "EwbStatus": {
                    "type": "string"
                  },
                  "EwbValidUpto": {
                    "type": "string"
                  },
                  "EwtAtcCode": {
                    "type": "string"
                  },
                  "EwtBaseAmount": {
                    "type": "number"
                  },
                  "EwtExemptCertSnapshot": {
                    "type": "string"
                  },
                  "EwtRate": {
                    "type": "number"
                  },
                  "EwtReason": {
                    "type": "string"
                  },
                  "EwtWithheldAmount": {
                    "type": "number"
                  },
                  "EwtWithholding": {
                    "type": "boolean"
                  },
                  "ExchangeGainLoss": {
                    "type": "number"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExcludeFromEwb": {
                    "type": "boolean"
                  },
                  "FRRetenueBaseAmount": {
                    "type": "number"
                  },
                  "FRRetenueBucket": {
                    "type": "string"
                  },
                  "FRRetenueDttCertNoSnapshot": {
                    "type": "string"
                  },
                  "FRRetenueRate": {
                    "type": "number"
                  },
                  "FRRetenueWithheldAmount": {
                    "type": "number"
                  },
                  "FRRetenueWithholding": {
                    "type": "boolean"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FunctionalTotalPayableAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "GoodsReceiptNoteRef": {
                    "type": "string"
                  },
                  "HasGoodsReceipt": {
                    "type": "boolean"
                  },
                  "ITCReclaimedAmount": {
                    "type": "number"
                  },
                  "ITCReclaimedAt": {
                    "type": "string"
                  },
                  "ITCReversedAmount": {
                    "type": "number"
                  },
                  "ITCReversedAt": {
                    "type": "string"
                  },
                  "IrpfBaseAmount": {
                    "type": "number"
                  },
                  "IrpfRate": {
                    "type": "number"
                  },
                  "IrpfSection": {
                    "type": "string"
                  },
                  "IrpfWithheldAmount": {
                    "type": "number"
                  },
                  "IrpfWithholding": {
                    "type": "boolean"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsCapitalGood": {
                    "type": "boolean"
                  },
                  "IsCommonUse": {
                    "type": "boolean"
                  },
                  "IsConversion": {
                    "type": "boolean"
                  },
                  "IsEcGoodsMovement": {
                    "type": "boolean"
                  },
                  "IsGstTdsApplicable": {
                    "type": "boolean"
                  },
                  "IsITCEligible": {
                    "type": "boolean"
                  },
                  "IsInterCompany": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsPublishedToQbo": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "JpConsumptionTaxAmount": {
                    "type": "number"
                  },
                  "JpConsumptionTaxBaseAmount": {
                    "type": "number"
                  },
                  "JpConsumptionTaxRate": {
                    "type": "number"
                  },
                  "JpGensenChoshuApplicable": {
                    "type": "boolean"
                  },
                  "JpGensenChoshuBaseAmount": {
                    "type": "number"
                  },
                  "JpGensenChoshuHighAmount": {
                    "type": "number"
                  },
                  "JpGensenChoshuLowAmount": {
                    "type": "number"
                  },
                  "JpGensenChoshuSection": {
                    "type": "string"
                  },
                  "JpGensenChoshuWithheldAmount": {
                    "type": "number"
                  },
                  "JpIsReducedRate": {
                    "type": "boolean"
                  },
                  "JpItcLossAmount": {
                    "type": "number"
                  },
                  "JpItcPhaseCreditPct": {
                    "type": "number"
                  },
                  "JpQualifiedInvoiceApplicable": {
                    "type": "boolean"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "NeedsReview": {
                    "type": "boolean"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "OriginalTotals": {
                    "type": "object"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PayeeAddresses": {
                    "type": "array"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PaygBaseAmount": {
                    "type": "number"
                  },
                  "PaygRate": {
                    "type": "number"
                  },
                  "PaygSection": {
                    "type": "string"
                  },
                  "PaygWithheldAmount": {
                    "type": "number"
                  },
                  "PaygWithholding": {
                    "type": "boolean"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "PphArticle": {
                    "type": "string"
                  },
                  "PphBaseAmount": {
                    "type": "number"
                  },
                  "PphBasis": {
                    "type": "string"
                  },
                  "PphNoNpwpDoubled": {
                    "type": "boolean"
                  },
                  "PphRate": {
                    "type": "number"
                  },
                  "PphReason": {
                    "type": "string"
                  },
                  "PphResolutionBasis": {
                    "type": "string"
                  },
                  "PphWithheldAmount": {
                    "type": "number"
                  },
                  "PphWithholding": {
                    "type": "boolean"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "PurchaseOrderRef": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "RCMCategory": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "Reg105BaseAmount": {
                    "type": "number"
                  },
                  "Reg105FederalRate": {
                    "type": "number"
                  },
                  "Reg105FederalWithheld": {
                    "type": "number"
                  },
                  "Reg105QcRate": {
                    "type": "number"
                  },
                  "Reg105QcWithheld": {
                    "type": "number"
                  },
                  "Reg105WaiverApplied": {
                    "type": "boolean"
                  },
                  "Reg105WaiverCertNoSnapshot": {
                    "type": "string"
                  },
                  "Reg105Withholding": {
                    "type": "boolean"
                  },
                  "ReviewReason": {
                    "type": "string"
                  },
                  "RitenutaBaseAmount": {
                    "type": "number"
                  },
                  "RitenutaBaseBasis": {
                    "type": "string"
                  },
                  "RitenutaCausale": {
                    "type": "string"
                  },
                  "RitenutaRate": {
                    "type": "number"
                  },
                  "RitenutaTaxableBase": {
                    "type": "number"
                  },
                  "RitenutaWithheldAmount": {
                    "type": "number"
                  },
                  "RitenutaWithholding": {
                    "type": "boolean"
                  },
                  "SchedularActivityCode": {
                    "type": "string"
                  },
                  "SchedularBaseAmount": {
                    "type": "number"
                  },
                  "SchedularRate": {
                    "type": "number"
                  },
                  "SchedularWithheldAmount": {
                    "type": "number"
                  },
                  "SchedularWithholding": {
                    "type": "boolean"
                  },
                  "SelfInvoiceRefId": {
                    "type": "string"
                  },
                  "SellerGSTIN": {
                    "type": "string"
                  },
                  "ServicesPerformedInQc": {
                    "type": "boolean"
                  },
                  "Source": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "SyncedTo": {
                    "type": "string"
                  },
                  "SyncedToTally": {
                    "type": "boolean"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyNumber": {
                    "type": "string"
                  },
                  "TallyVoucherSeries": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TaxMappingMessage": {
                    "type": "string"
                  },
                  "TaxRef": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TcsAmount": {
                    "type": "number"
                  },
                  "TcsBaseAmount": {
                    "type": "number"
                  },
                  "TcsRate": {
                    "type": "number"
                  },
                  "TcsRefId": {
                    "type": "string"
                  },
                  "TdsAmount": {
                    "type": "number"
                  },
                  "TdsBaseAmount": {
                    "type": "number"
                  },
                  "TdsRate": {
                    "type": "number"
                  },
                  "TdsRefId": {
                    "type": "string"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalCGST": {
                    "type": "number"
                  },
                  "TotalCess": {
                    "type": "number"
                  },
                  "TotalCessNonAdvalorem": {
                    "type": "number"
                  },
                  "TotalDiscountAmount": {
                    "type": "number"
                  },
                  "TotalIGST": {
                    "type": "number"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalSGST": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "TotalUTGST": {
                    "type": "number"
                  },
                  "VendorInvoiceDate": {
                    "type": "string"
                  },
                  "VendorInvoiceNo": {
                    "type": "string"
                  },
                  "VendorPrepaymentRefId": {
                    "type": "string"
                  },
                  "VoidReason": {
                    "type": "string"
                  },
                  "VoidedAt": {
                    "type": "string"
                  },
                  "VoidedBy": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "WhtArticle": {
                    "type": "string"
                  },
                  "WhtBaseAmount": {
                    "type": "number"
                  },
                  "WhtBasis": {
                    "type": "string"
                  },
                  "WhtCategory": {
                    "type": "string"
                  },
                  "WhtGlCode": {
                    "type": "string"
                  },
                  "WhtRate": {
                    "type": "number"
                  },
                  "WhtReason": {
                    "type": "string"
                  },
                  "WhtWithheldAmount": {
                    "type": "number"
                  },
                  "WhtWithholding": {
                    "type": "boolean"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `bill`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteBill",
        "summary": "Delete bill record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `bill` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/bill.grpc` → `deleteBills`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "bill"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Bill"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Bill` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Bill"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/bill.grpc",
        "x-hellobooks-handler": "deleteBills",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AISuggesstion": {
                    "type": "object"
                  },
                  "AiIterationCount": {
                    "type": "integer"
                  },
                  "AiTotalIterCachedTokens": {
                    "type": "integer"
                  },
                  "AiTotalIterInputTokens": {
                    "type": "integer"
                  },
                  "AiTotalIterOutputTokens": {
                    "type": "integer"
                  },
                  "AiTotalIterTotalINR": {
                    "type": "number"
                  },
                  "AiTotalIterTotalUSD": {
                    "type": "number"
                  },
                  "ApprovalComment": {
                    "type": "string"
                  },
                  "ApprovalStatus": {
                    "type": "string"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BauabzugBaseAmount": {
                    "type": "number"
                  },
                  "BauabzugFreistellungNumberSnapshot": {
                    "type": "string"
                  },
                  "BauabzugRate": {
                    "type": "number"
                  },
                  "BauabzugWithheldAmount": {
                    "type": "number"
                  },
                  "BauabzugWithholding": {
                    "type": "boolean"
                  },
                  "BillMatchingAnalysis": {
                    "type": "object"
                  },
                  "BillNumber": {
                    "type": "string"
                  },
                  "BrandingThemeId": {
                    "type": "string"
                  },
                  "CapitalGoodCommonUse": {
                    "type": "boolean"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "object"
                  },
                  "ConfidencePercentage": {
                    "type": "string"
                  },
                  "ContractRefId": {
                    "type": "string"
                  },
                  "CounterpartyEntityRefId": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CreatedById": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "CustomsDutyAmount": {
                    "type": "number"
                  },
                  "DifferentialPercent": {
                    "type": "number"
                  },
                  "DueDate": {
                    "type": "string"
                  },
                  "EstimatedPaymentDate": {
                    "type": "string"
                  },
                  "EwayBillRequired": {
                    "type": "boolean"
                  },
                  "EwbGeneratedAt": {
                    "type": "string"
                  },
                  "EwbNo": {
                    "type": "string"
                  },
                  "EwbRefId": {
                    "type": "string"
                  },
                  "EwbStatus": {
                    "type": "string"
                  },
                  "EwbValidUpto": {
                    "type": "string"
                  },
                  "EwtAtcCode": {
                    "type": "string"
                  },
                  "EwtBaseAmount": {
                    "type": "number"
                  },
                  "EwtExemptCertSnapshot": {
                    "type": "string"
                  },
                  "EwtRate": {
                    "type": "number"
                  },
                  "EwtReason": {
                    "type": "string"
                  },
                  "EwtWithheldAmount": {
                    "type": "number"
                  },
                  "EwtWithholding": {
                    "type": "boolean"
                  },
                  "ExchangeGainLoss": {
                    "type": "number"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExcludeFromEwb": {
                    "type": "boolean"
                  },
                  "FRRetenueBaseAmount": {
                    "type": "number"
                  },
                  "FRRetenueBucket": {
                    "type": "string"
                  },
                  "FRRetenueDttCertNoSnapshot": {
                    "type": "string"
                  },
                  "FRRetenueRate": {
                    "type": "number"
                  },
                  "FRRetenueWithheldAmount": {
                    "type": "number"
                  },
                  "FRRetenueWithholding": {
                    "type": "boolean"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FunctionalTotalPayableAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "GoodsReceiptNoteRef": {
                    "type": "string"
                  },
                  "HasGoodsReceipt": {
                    "type": "boolean"
                  },
                  "ITCReclaimedAmount": {
                    "type": "number"
                  },
                  "ITCReclaimedAt": {
                    "type": "string"
                  },
                  "ITCReversedAmount": {
                    "type": "number"
                  },
                  "ITCReversedAt": {
                    "type": "string"
                  },
                  "IrpfBaseAmount": {
                    "type": "number"
                  },
                  "IrpfRate": {
                    "type": "number"
                  },
                  "IrpfSection": {
                    "type": "string"
                  },
                  "IrpfWithheldAmount": {
                    "type": "number"
                  },
                  "IrpfWithholding": {
                    "type": "boolean"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsCapitalGood": {
                    "type": "boolean"
                  },
                  "IsCommonUse": {
                    "type": "boolean"
                  },
                  "IsConversion": {
                    "type": "boolean"
                  },
                  "IsEcGoodsMovement": {
                    "type": "boolean"
                  },
                  "IsGstTdsApplicable": {
                    "type": "boolean"
                  },
                  "IsITCEligible": {
                    "type": "boolean"
                  },
                  "IsInterCompany": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsPublishedToQbo": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "JpConsumptionTaxAmount": {
                    "type": "number"
                  },
                  "JpConsumptionTaxBaseAmount": {
                    "type": "number"
                  },
                  "JpConsumptionTaxRate": {
                    "type": "number"
                  },
                  "JpGensenChoshuApplicable": {
                    "type": "boolean"
                  },
                  "JpGensenChoshuBaseAmount": {
                    "type": "number"
                  },
                  "JpGensenChoshuHighAmount": {
                    "type": "number"
                  },
                  "JpGensenChoshuLowAmount": {
                    "type": "number"
                  },
                  "JpGensenChoshuSection": {
                    "type": "string"
                  },
                  "JpGensenChoshuWithheldAmount": {
                    "type": "number"
                  },
                  "JpIsReducedRate": {
                    "type": "boolean"
                  },
                  "JpItcLossAmount": {
                    "type": "number"
                  },
                  "JpItcPhaseCreditPct": {
                    "type": "number"
                  },
                  "JpQualifiedInvoiceApplicable": {
                    "type": "boolean"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "NeedsReview": {
                    "type": "boolean"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "OriginalTotals": {
                    "type": "object"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PayeeAddresses": {
                    "type": "array"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PaygBaseAmount": {
                    "type": "number"
                  },
                  "PaygRate": {
                    "type": "number"
                  },
                  "PaygSection": {
                    "type": "string"
                  },
                  "PaygWithheldAmount": {
                    "type": "number"
                  },
                  "PaygWithholding": {
                    "type": "boolean"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "PphArticle": {
                    "type": "string"
                  },
                  "PphBaseAmount": {
                    "type": "number"
                  },
                  "PphBasis": {
                    "type": "string"
                  },
                  "PphNoNpwpDoubled": {
                    "type": "boolean"
                  },
                  "PphRate": {
                    "type": "number"
                  },
                  "PphReason": {
                    "type": "string"
                  },
                  "PphResolutionBasis": {
                    "type": "string"
                  },
                  "PphWithheldAmount": {
                    "type": "number"
                  },
                  "PphWithholding": {
                    "type": "boolean"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "PurchaseOrderRef": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "RCMCategory": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "Reg105BaseAmount": {
                    "type": "number"
                  },
                  "Reg105FederalRate": {
                    "type": "number"
                  },
                  "Reg105FederalWithheld": {
                    "type": "number"
                  },
                  "Reg105QcRate": {
                    "type": "number"
                  },
                  "Reg105QcWithheld": {
                    "type": "number"
                  },
                  "Reg105WaiverApplied": {
                    "type": "boolean"
                  },
                  "Reg105WaiverCertNoSnapshot": {
                    "type": "string"
                  },
                  "Reg105Withholding": {
                    "type": "boolean"
                  },
                  "ReviewReason": {
                    "type": "string"
                  },
                  "RitenutaBaseAmount": {
                    "type": "number"
                  },
                  "RitenutaBaseBasis": {
                    "type": "string"
                  },
                  "RitenutaCausale": {
                    "type": "string"
                  },
                  "RitenutaRate": {
                    "type": "number"
                  },
                  "RitenutaTaxableBase": {
                    "type": "number"
                  },
                  "RitenutaWithheldAmount": {
                    "type": "number"
                  },
                  "RitenutaWithholding": {
                    "type": "boolean"
                  },
                  "SchedularActivityCode": {
                    "type": "string"
                  },
                  "SchedularBaseAmount": {
                    "type": "number"
                  },
                  "SchedularRate": {
                    "type": "number"
                  },
                  "SchedularWithheldAmount": {
                    "type": "number"
                  },
                  "SchedularWithholding": {
                    "type": "boolean"
                  },
                  "SelfInvoiceRefId": {
                    "type": "string"
                  },
                  "SellerGSTIN": {
                    "type": "string"
                  },
                  "ServicesPerformedInQc": {
                    "type": "boolean"
                  },
                  "Source": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "SyncedTo": {
                    "type": "string"
                  },
                  "SyncedToTally": {
                    "type": "boolean"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyNumber": {
                    "type": "string"
                  },
                  "TallyVoucherSeries": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TaxMappingMessage": {
                    "type": "string"
                  },
                  "TaxRef": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TcsAmount": {
                    "type": "number"
                  },
                  "TcsBaseAmount": {
                    "type": "number"
                  },
                  "TcsRate": {
                    "type": "number"
                  },
                  "TcsRefId": {
                    "type": "string"
                  },
                  "TdsAmount": {
                    "type": "number"
                  },
                  "TdsBaseAmount": {
                    "type": "number"
                  },
                  "TdsRate": {
                    "type": "number"
                  },
                  "TdsRefId": {
                    "type": "string"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalCGST": {
                    "type": "number"
                  },
                  "TotalCess": {
                    "type": "number"
                  },
                  "TotalCessNonAdvalorem": {
                    "type": "number"
                  },
                  "TotalDiscountAmount": {
                    "type": "number"
                  },
                  "TotalIGST": {
                    "type": "number"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalSGST": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "TotalUTGST": {
                    "type": "number"
                  },
                  "VendorInvoiceDate": {
                    "type": "string"
                  },
                  "VendorInvoiceNo": {
                    "type": "string"
                  },
                  "VendorPrepaymentRefId": {
                    "type": "string"
                  },
                  "VoidReason": {
                    "type": "string"
                  },
                  "VoidedAt": {
                    "type": "string"
                  },
                  "VoidedBy": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "WhtArticle": {
                    "type": "string"
                  },
                  "WhtBaseAmount": {
                    "type": "number"
                  },
                  "WhtBasis": {
                    "type": "string"
                  },
                  "WhtCategory": {
                    "type": "string"
                  },
                  "WhtGlCode": {
                    "type": "string"
                  },
                  "WhtRate": {
                    "type": "number"
                  },
                  "WhtReason": {
                    "type": "string"
                  },
                  "WhtWithheldAmount": {
                    "type": "number"
                  },
                  "WhtWithholding": {
                    "type": "boolean"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `bill`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/bill/restore": {
      "put": {
        "operationId": "restoreBill",
        "summary": "Restore archived bill record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `bill` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/bill.grpc` → `restoreBills`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "bill"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Bill"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Bill` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Bill"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/bill.grpc",
        "x-hellobooks-handler": "restoreBills",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AISuggesstion": {
                    "type": "object"
                  },
                  "AiIterationCount": {
                    "type": "integer"
                  },
                  "AiTotalIterCachedTokens": {
                    "type": "integer"
                  },
                  "AiTotalIterInputTokens": {
                    "type": "integer"
                  },
                  "AiTotalIterOutputTokens": {
                    "type": "integer"
                  },
                  "AiTotalIterTotalINR": {
                    "type": "number"
                  },
                  "AiTotalIterTotalUSD": {
                    "type": "number"
                  },
                  "ApprovalComment": {
                    "type": "string"
                  },
                  "ApprovalStatus": {
                    "type": "string"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BauabzugBaseAmount": {
                    "type": "number"
                  },
                  "BauabzugFreistellungNumberSnapshot": {
                    "type": "string"
                  },
                  "BauabzugRate": {
                    "type": "number"
                  },
                  "BauabzugWithheldAmount": {
                    "type": "number"
                  },
                  "BauabzugWithholding": {
                    "type": "boolean"
                  },
                  "BillMatchingAnalysis": {
                    "type": "object"
                  },
                  "BillNumber": {
                    "type": "string"
                  },
                  "BrandingThemeId": {
                    "type": "string"
                  },
                  "CapitalGoodCommonUse": {
                    "type": "boolean"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "object"
                  },
                  "ConfidencePercentage": {
                    "type": "string"
                  },
                  "ContractRefId": {
                    "type": "string"
                  },
                  "CounterpartyEntityRefId": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CreatedById": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "CustomsDutyAmount": {
                    "type": "number"
                  },
                  "DifferentialPercent": {
                    "type": "number"
                  },
                  "DueDate": {
                    "type": "string"
                  },
                  "EstimatedPaymentDate": {
                    "type": "string"
                  },
                  "EwayBillRequired": {
                    "type": "boolean"
                  },
                  "EwbGeneratedAt": {
                    "type": "string"
                  },
                  "EwbNo": {
                    "type": "string"
                  },
                  "EwbRefId": {
                    "type": "string"
                  },
                  "EwbStatus": {
                    "type": "string"
                  },
                  "EwbValidUpto": {
                    "type": "string"
                  },
                  "EwtAtcCode": {
                    "type": "string"
                  },
                  "EwtBaseAmount": {
                    "type": "number"
                  },
                  "EwtExemptCertSnapshot": {
                    "type": "string"
                  },
                  "EwtRate": {
                    "type": "number"
                  },
                  "EwtReason": {
                    "type": "string"
                  },
                  "EwtWithheldAmount": {
                    "type": "number"
                  },
                  "EwtWithholding": {
                    "type": "boolean"
                  },
                  "ExchangeGainLoss": {
                    "type": "number"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExcludeFromEwb": {
                    "type": "boolean"
                  },
                  "FRRetenueBaseAmount": {
                    "type": "number"
                  },
                  "FRRetenueBucket": {
                    "type": "string"
                  },
                  "FRRetenueDttCertNoSnapshot": {
                    "type": "string"
                  },
                  "FRRetenueRate": {
                    "type": "number"
                  },
                  "FRRetenueWithheldAmount": {
                    "type": "number"
                  },
                  "FRRetenueWithholding": {
                    "type": "boolean"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FunctionalTotalPayableAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "GoodsReceiptNoteRef": {
                    "type": "string"
                  },
                  "HasGoodsReceipt": {
                    "type": "boolean"
                  },
                  "ITCReclaimedAmount": {
                    "type": "number"
                  },
                  "ITCReclaimedAt": {
                    "type": "string"
                  },
                  "ITCReversedAmount": {
                    "type": "number"
                  },
                  "ITCReversedAt": {
                    "type": "string"
                  },
                  "IrpfBaseAmount": {
                    "type": "number"
                  },
                  "IrpfRate": {
                    "type": "number"
                  },
                  "IrpfSection": {
                    "type": "string"
                  },
                  "IrpfWithheldAmount": {
                    "type": "number"
                  },
                  "IrpfWithholding": {
                    "type": "boolean"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsCapitalGood": {
                    "type": "boolean"
                  },
                  "IsCommonUse": {
                    "type": "boolean"
                  },
                  "IsConversion": {
                    "type": "boolean"
                  },
                  "IsEcGoodsMovement": {
                    "type": "boolean"
                  },
                  "IsGstTdsApplicable": {
                    "type": "boolean"
                  },
                  "IsITCEligible": {
                    "type": "boolean"
                  },
                  "IsInterCompany": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsPublishedToQbo": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "JpConsumptionTaxAmount": {
                    "type": "number"
                  },
                  "JpConsumptionTaxBaseAmount": {
                    "type": "number"
                  },
                  "JpConsumptionTaxRate": {
                    "type": "number"
                  },
                  "JpGensenChoshuApplicable": {
                    "type": "boolean"
                  },
                  "JpGensenChoshuBaseAmount": {
                    "type": "number"
                  },
                  "JpGensenChoshuHighAmount": {
                    "type": "number"
                  },
                  "JpGensenChoshuLowAmount": {
                    "type": "number"
                  },
                  "JpGensenChoshuSection": {
                    "type": "string"
                  },
                  "JpGensenChoshuWithheldAmount": {
                    "type": "number"
                  },
                  "JpIsReducedRate": {
                    "type": "boolean"
                  },
                  "JpItcLossAmount": {
                    "type": "number"
                  },
                  "JpItcPhaseCreditPct": {
                    "type": "number"
                  },
                  "JpQualifiedInvoiceApplicable": {
                    "type": "boolean"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "NeedsReview": {
                    "type": "boolean"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "OriginalTotals": {
                    "type": "object"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PayeeAddresses": {
                    "type": "array"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PaygBaseAmount": {
                    "type": "number"
                  },
                  "PaygRate": {
                    "type": "number"
                  },
                  "PaygSection": {
                    "type": "string"
                  },
                  "PaygWithheldAmount": {
                    "type": "number"
                  },
                  "PaygWithholding": {
                    "type": "boolean"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "PphArticle": {
                    "type": "string"
                  },
                  "PphBaseAmount": {
                    "type": "number"
                  },
                  "PphBasis": {
                    "type": "string"
                  },
                  "PphNoNpwpDoubled": {
                    "type": "boolean"
                  },
                  "PphRate": {
                    "type": "number"
                  },
                  "PphReason": {
                    "type": "string"
                  },
                  "PphResolutionBasis": {
                    "type": "string"
                  },
                  "PphWithheldAmount": {
                    "type": "number"
                  },
                  "PphWithholding": {
                    "type": "boolean"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "PurchaseOrderRef": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "RCMCategory": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "Reg105BaseAmount": {
                    "type": "number"
                  },
                  "Reg105FederalRate": {
                    "type": "number"
                  },
                  "Reg105FederalWithheld": {
                    "type": "number"
                  },
                  "Reg105QcRate": {
                    "type": "number"
                  },
                  "Reg105QcWithheld": {
                    "type": "number"
                  },
                  "Reg105WaiverApplied": {
                    "type": "boolean"
                  },
                  "Reg105WaiverCertNoSnapshot": {
                    "type": "string"
                  },
                  "Reg105Withholding": {
                    "type": "boolean"
                  },
                  "ReviewReason": {
                    "type": "string"
                  },
                  "RitenutaBaseAmount": {
                    "type": "number"
                  },
                  "RitenutaBaseBasis": {
                    "type": "string"
                  },
                  "RitenutaCausale": {
                    "type": "string"
                  },
                  "RitenutaRate": {
                    "type": "number"
                  },
                  "RitenutaTaxableBase": {
                    "type": "number"
                  },
                  "RitenutaWithheldAmount": {
                    "type": "number"
                  },
                  "RitenutaWithholding": {
                    "type": "boolean"
                  },
                  "SchedularActivityCode": {
                    "type": "string"
                  },
                  "SchedularBaseAmount": {
                    "type": "number"
                  },
                  "SchedularRate": {
                    "type": "number"
                  },
                  "SchedularWithheldAmount": {
                    "type": "number"
                  },
                  "SchedularWithholding": {
                    "type": "boolean"
                  },
                  "SelfInvoiceRefId": {
                    "type": "string"
                  },
                  "SellerGSTIN": {
                    "type": "string"
                  },
                  "ServicesPerformedInQc": {
                    "type": "boolean"
                  },
                  "Source": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "SyncedTo": {
                    "type": "string"
                  },
                  "SyncedToTally": {
                    "type": "boolean"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyNumber": {
                    "type": "string"
                  },
                  "TallyVoucherSeries": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TaxMappingMessage": {
                    "type": "string"
                  },
                  "TaxRef": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TcsAmount": {
                    "type": "number"
                  },
                  "TcsBaseAmount": {
                    "type": "number"
                  },
                  "TcsRate": {
                    "type": "number"
                  },
                  "TcsRefId": {
                    "type": "string"
                  },
                  "TdsAmount": {
                    "type": "number"
                  },
                  "TdsBaseAmount": {
                    "type": "number"
                  },
                  "TdsRate": {
                    "type": "number"
                  },
                  "TdsRefId": {
                    "type": "string"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalCGST": {
                    "type": "number"
                  },
                  "TotalCess": {
                    "type": "number"
                  },
                  "TotalCessNonAdvalorem": {
                    "type": "number"
                  },
                  "TotalDiscountAmount": {
                    "type": "number"
                  },
                  "TotalIGST": {
                    "type": "number"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalSGST": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "TotalUTGST": {
                    "type": "number"
                  },
                  "VendorInvoiceDate": {
                    "type": "string"
                  },
                  "VendorInvoiceNo": {
                    "type": "string"
                  },
                  "VendorPrepaymentRefId": {
                    "type": "string"
                  },
                  "VoidReason": {
                    "type": "string"
                  },
                  "VoidedAt": {
                    "type": "string"
                  },
                  "VoidedBy": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "WhtArticle": {
                    "type": "string"
                  },
                  "WhtBaseAmount": {
                    "type": "number"
                  },
                  "WhtBasis": {
                    "type": "string"
                  },
                  "WhtCategory": {
                    "type": "string"
                  },
                  "WhtGlCode": {
                    "type": "string"
                  },
                  "WhtRate": {
                    "type": "number"
                  },
                  "WhtReason": {
                    "type": "string"
                  },
                  "WhtWithheldAmount": {
                    "type": "number"
                  },
                  "WhtWithholding": {
                    "type": "boolean"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `bill`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/bill/{id}": {
      "get": {
        "operationId": "getBill",
        "summary": "Fetch one bill record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `bill` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/bill.grpc` → `getBillById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "bill"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Bill"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Bill` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Bill"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/bill.grpc",
        "x-hellobooks-handler": "getBillById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/billAddress": {
      "get": {
        "operationId": "listBillAddress",
        "summary": "List billAddress records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `billAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/billAddress.grpc` → `getBillAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "billAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/BillAddress"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `BillAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/BillAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/billAddress.grpc",
        "x-hellobooks-handler": "getBillAddresses",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      },
      "post": {
        "operationId": "createBillAddress",
        "summary": "Create billAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `billAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/billAddress.grpc` → `createBillAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "billAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/BillAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `BillAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/BillAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/billAddress.grpc",
        "x-hellobooks-handler": "createBillAddresses",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `create` on `billAddress`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. In addition, this gateway delegates straight to the internal controller, which in several cases expects the records under a resource-named wrapper key. This resource does not declare one — its create and update handlers disagree about the key, or it takes no records array at all — so the accepted envelope is not described here rather than guessed at.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateBillAddress",
        "summary": "Update billAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `billAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/billAddress.grpc` → `updateBillAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "billAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/BillAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `BillAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/BillAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/billAddress.grpc",
        "x-hellobooks-handler": "updateBillAddresses",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `update` on `billAddress`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. In addition, this gateway delegates straight to the internal controller, which in several cases expects the records under a resource-named wrapper key. This resource does not declare one — its create and update handlers disagree about the key, or it takes no records array at all — so the accepted envelope is not described here rather than guessed at.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteBillAddress",
        "summary": "Delete billAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `billAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/billAddress.grpc` → `deleteBillAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "billAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/BillAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `BillAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/BillAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/billAddress.grpc",
        "x-hellobooks-handler": "deleteBillAddresses",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `del` on `billAddress`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. In addition, this gateway delegates straight to the internal controller, which in several cases expects the records under a resource-named wrapper key. This resource does not declare one — its create and update handlers disagree about the key, or it takes no records array at all — so the accepted envelope is not described here rather than guessed at.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/billAddress/restore": {
      "put": {
        "operationId": "restoreBillAddress",
        "summary": "Restore archived billAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `billAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/billAddress.grpc` → `restoreBillAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "billAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/BillAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `BillAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/BillAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/billAddress.grpc",
        "x-hellobooks-handler": "restoreBillAddresses",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `restore` on `billAddress`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. In addition, this gateway delegates straight to the internal controller, which in several cases expects the records under a resource-named wrapper key. This resource does not declare one — its create and update handlers disagree about the key, or it takes no records array at all — so the accepted envelope is not described here rather than guessed at.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/billAddress/{id}": {
      "get": {
        "operationId": "getBillAddress",
        "summary": "Fetch one billAddress record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `billAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/billAddress.grpc` → `getBillAddressById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "billAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/BillAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `BillAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/BillAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/billAddress.grpc",
        "x-hellobooks-handler": "getBillAddressById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/billLine": {
      "get": {
        "operationId": "listBillLine",
        "summary": "List billLine records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `billLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/billLine.grpc` → `getBillLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "billLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/BillLine"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `BillLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/BillLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/billLine.grpc",
        "x-hellobooks-handler": "getBillLines",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      },
      "post": {
        "operationId": "createBillLine",
        "summary": "Create billLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `billLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/billLine.grpc` → `createBillLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "billLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/BillLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `BillLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/BillLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/billLine.grpc",
        "x-hellobooks-handler": "createBillLines",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "BillId": {
                    "type": "string"
                  },
                  "BrandRefId": {
                    "type": "string"
                  },
                  "CGSTAmount": {
                    "type": "number"
                  },
                  "CGSTRate": {
                    "type": "number"
                  },
                  "CessAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremRate": {
                    "type": "number"
                  },
                  "CessRate": {
                    "type": "number"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "CostCodeRefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomerRefId": {
                    "type": "string"
                  },
                  "DepartmentRefId": {
                    "type": "string"
                  },
                  "DerivedTaxRate": {
                    "type": "number"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DiscountAmount": {
                    "type": "number"
                  },
                  "DiscountPercentage": {
                    "type": "number"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "GSTRate": {
                    "type": "number"
                  },
                  "HSNCode": {
                    "type": "string"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IGSTAmount": {
                    "type": "number"
                  },
                  "IGSTRate": {
                    "type": "number"
                  },
                  "IsDiscountBeforeTax": {
                    "type": "boolean"
                  },
                  "IsITCEligible": {
                    "type": "boolean"
                  },
                  "IsInventoryableItem": {
                    "type": "boolean"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LabourAccountHeadRef": {
                    "type": "string"
                  },
                  "LabourAmount": {
                    "type": "number"
                  },
                  "LabourHSN_SAC": {
                    "type": "string"
                  },
                  "LabourRate": {
                    "type": "number"
                  },
                  "LabourTaxAmount": {
                    "type": "number"
                  },
                  "LabourTaxRate": {
                    "type": "number"
                  },
                  "LabourTaxRefId": {
                    "type": "string"
                  },
                  "LineExchangeRate": {
                    "type": "number"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "MappedAccountSource": {
                    "type": "string"
                  },
                  "MappedItemId": {
                    "type": "string"
                  },
                  "MappedItemName": {
                    "type": "string"
                  },
                  "MappedItemSource": {
                    "type": "string"
                  },
                  "MarginValue": {
                    "type": "number"
                  },
                  "NCCDAmount": {
                    "type": "number"
                  },
                  "NCCDRate": {
                    "type": "number"
                  },
                  "OcrCreateVendorDescriptionMapping": {
                    "type": "boolean"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "ReverseCharge": {
                    "type": "boolean"
                  },
                  "SGSTAmount": {
                    "type": "number"
                  },
                  "SGSTRate": {
                    "type": "number"
                  },
                  "StateCessAmount": {
                    "type": "number"
                  },
                  "StateCessNonAdvaloremAmount": {
                    "type": "number"
                  },
                  "StateCessNonAdvaloremRate": {
                    "type": "number"
                  },
                  "StateCessRate": {
                    "type": "number"
                  },
                  "SupplyAmount": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxClassification": {
                    "type": "string"
                  },
                  "TaxConfidence": {
                    "type": "number"
                  },
                  "TaxMessage": {
                    "type": "string"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxUnconfirmed": {
                    "type": "boolean"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "UTGSTAmount": {
                    "type": "number"
                  },
                  "UTGSTRate": {
                    "type": "number"
                  },
                  "UnitPrice": {
                    "type": "number"
                  },
                  "UnitRefId": {
                    "type": "string"
                  },
                  "VendorDescriptionMappingRef": {
                    "type": "string"
                  },
                  "XeroLineItemId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `billLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateBillLine",
        "summary": "Update billLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `billLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/billLine.grpc` → `updateBillLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "billLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/BillLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `BillLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/BillLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/billLine.grpc",
        "x-hellobooks-handler": "updateBillLines",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "BillId": {
                    "type": "string"
                  },
                  "BrandRefId": {
                    "type": "string"
                  },
                  "CGSTAmount": {
                    "type": "number"
                  },
                  "CGSTRate": {
                    "type": "number"
                  },
                  "CessAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremRate": {
                    "type": "number"
                  },
                  "CessRate": {
                    "type": "number"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "CostCodeRefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomerRefId": {
                    "type": "string"
                  },
                  "DepartmentRefId": {
                    "type": "string"
                  },
                  "DerivedTaxRate": {
                    "type": "number"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DiscountAmount": {
                    "type": "number"
                  },
                  "DiscountPercentage": {
                    "type": "number"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "GSTRate": {
                    "type": "number"
                  },
                  "HSNCode": {
                    "type": "string"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IGSTAmount": {
                    "type": "number"
                  },
                  "IGSTRate": {
                    "type": "number"
                  },
                  "IsDiscountBeforeTax": {
                    "type": "boolean"
                  },
                  "IsITCEligible": {
                    "type": "boolean"
                  },
                  "IsInventoryableItem": {
                    "type": "boolean"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LabourAccountHeadRef": {
                    "type": "string"
                  },
                  "LabourAmount": {
                    "type": "number"
                  },
                  "LabourHSN_SAC": {
                    "type": "string"
                  },
                  "LabourRate": {
                    "type": "number"
                  },
                  "LabourTaxAmount": {
                    "type": "number"
                  },
                  "LabourTaxRate": {
                    "type": "number"
                  },
                  "LabourTaxRefId": {
                    "type": "string"
                  },
                  "LineExchangeRate": {
                    "type": "number"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "MappedAccountSource": {
                    "type": "string"
                  },
                  "MappedItemId": {
                    "type": "string"
                  },
                  "MappedItemName": {
                    "type": "string"
                  },
                  "MappedItemSource": {
                    "type": "string"
                  },
                  "MarginValue": {
                    "type": "number"
                  },
                  "NCCDAmount": {
                    "type": "number"
                  },
                  "NCCDRate": {
                    "type": "number"
                  },
                  "OcrCreateVendorDescriptionMapping": {
                    "type": "boolean"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "ReverseCharge": {
                    "type": "boolean"
                  },
                  "SGSTAmount": {
                    "type": "number"
                  },
                  "SGSTRate": {
                    "type": "number"
                  },
                  "StateCessAmount": {
                    "type": "number"
                  },
                  "StateCessNonAdvaloremAmount": {
                    "type": "number"
                  },
                  "StateCessNonAdvaloremRate": {
                    "type": "number"
                  },
                  "StateCessRate": {
                    "type": "number"
                  },
                  "SupplyAmount": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxClassification": {
                    "type": "string"
                  },
                  "TaxConfidence": {
                    "type": "number"
                  },
                  "TaxMessage": {
                    "type": "string"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxUnconfirmed": {
                    "type": "boolean"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "UTGSTAmount": {
                    "type": "number"
                  },
                  "UTGSTRate": {
                    "type": "number"
                  },
                  "UnitPrice": {
                    "type": "number"
                  },
                  "UnitRefId": {
                    "type": "string"
                  },
                  "VendorDescriptionMappingRef": {
                    "type": "string"
                  },
                  "XeroLineItemId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `billLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteBillLine",
        "summary": "Delete billLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `billLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/billLine.grpc` → `deleteBillLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "billLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/BillLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `BillLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/BillLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/billLine.grpc",
        "x-hellobooks-handler": "deleteBillLines",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "BillId": {
                    "type": "string"
                  },
                  "BrandRefId": {
                    "type": "string"
                  },
                  "CGSTAmount": {
                    "type": "number"
                  },
                  "CGSTRate": {
                    "type": "number"
                  },
                  "CessAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremRate": {
                    "type": "number"
                  },
                  "CessRate": {
                    "type": "number"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "CostCodeRefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomerRefId": {
                    "type": "string"
                  },
                  "DepartmentRefId": {
                    "type": "string"
                  },
                  "DerivedTaxRate": {
                    "type": "number"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DiscountAmount": {
                    "type": "number"
                  },
                  "DiscountPercentage": {
                    "type": "number"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "GSTRate": {
                    "type": "number"
                  },
                  "HSNCode": {
                    "type": "string"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IGSTAmount": {
                    "type": "number"
                  },
                  "IGSTRate": {
                    "type": "number"
                  },
                  "IsDiscountBeforeTax": {
                    "type": "boolean"
                  },
                  "IsITCEligible": {
                    "type": "boolean"
                  },
                  "IsInventoryableItem": {
                    "type": "boolean"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LabourAccountHeadRef": {
                    "type": "string"
                  },
                  "LabourAmount": {
                    "type": "number"
                  },
                  "LabourHSN_SAC": {
                    "type": "string"
                  },
                  "LabourRate": {
                    "type": "number"
                  },
                  "LabourTaxAmount": {
                    "type": "number"
                  },
                  "LabourTaxRate": {
                    "type": "number"
                  },
                  "LabourTaxRefId": {
                    "type": "string"
                  },
                  "LineExchangeRate": {
                    "type": "number"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "MappedAccountSource": {
                    "type": "string"
                  },
                  "MappedItemId": {
                    "type": "string"
                  },
                  "MappedItemName": {
                    "type": "string"
                  },
                  "MappedItemSource": {
                    "type": "string"
                  },
                  "MarginValue": {
                    "type": "number"
                  },
                  "NCCDAmount": {
                    "type": "number"
                  },
                  "NCCDRate": {
                    "type": "number"
                  },
                  "OcrCreateVendorDescriptionMapping": {
                    "type": "boolean"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "ReverseCharge": {
                    "type": "boolean"
                  },
                  "SGSTAmount": {
                    "type": "number"
                  },
                  "SGSTRate": {
                    "type": "number"
                  },
                  "StateCessAmount": {
                    "type": "number"
                  },
                  "StateCessNonAdvaloremAmount": {
                    "type": "number"
                  },
                  "StateCessNonAdvaloremRate": {
                    "type": "number"
                  },
                  "StateCessRate": {
                    "type": "number"
                  },
                  "SupplyAmount": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxClassification": {
                    "type": "string"
                  },
                  "TaxConfidence": {
                    "type": "number"
                  },
                  "TaxMessage": {
                    "type": "string"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxUnconfirmed": {
                    "type": "boolean"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "UTGSTAmount": {
                    "type": "number"
                  },
                  "UTGSTRate": {
                    "type": "number"
                  },
                  "UnitPrice": {
                    "type": "number"
                  },
                  "UnitRefId": {
                    "type": "string"
                  },
                  "VendorDescriptionMappingRef": {
                    "type": "string"
                  },
                  "XeroLineItemId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `billLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/billLine/{id}": {
      "get": {
        "operationId": "getBillLine",
        "summary": "Fetch one billLine record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `billLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/billLine.grpc` → `getBillLineById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "billLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/BillLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `BillLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/BillLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/billLine.grpc",
        "x-hellobooks-handler": "getBillLineById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/books/drafts": {
      "post": {
        "operationId": "createBookkeepingDraft",
        "summary": "Propose a bookkeeping entry as a draft",
        "description": "Step 1 of the draft → confirm → commit flow. Drafts are free: the AI-credit metering that charges every other route excludes this flow, because the commit core meters committed entries instead. Nothing reaches the ledger here.\n\nDECLARED FIELD-CONTRACT GAP: this route is listed in `UNCONTRACTED_ROUTE_PREFIXES` in `middlewares/publicApiSerialize.middleware.js`. The response field allowlist does not apply to it; only the deny-key floor does. It is named here rather than omitted.\n\nCOARSE SCOPE, ON PURPOSE — not an oversight and not a gap. This route belongs to the AI-MCP-Hellobooks connector surface, and that server enforces a fixed four-string scope model on tool dispatch (`book:read`, `book:write`, `owner:close`, `audit:export`) and ignores every other string. Requiring a granular domain scope here would gate the flow on a string the connector can never be granted. `book:read` / `book:write` remain first-class grantable bundle scopes, so nothing is lost. The same reasoning keeps dynamic client registration (`POST /oauth/register`) on the two bundles.",
        "tags": [
          "bookkeeping"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Response shape is not published for this route. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
                  "x-hellobooks-field-contract": "unpublished"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "hand-written",
        "x-hellobooks-field-contract": "declared-gap",
        "x-hellobooks-tenant-guard": true,
        "x-hellobooks-required-scopes": [
          "book:read"
        ],
        "x-hellobooks-scope-grain": "coarse-bundle",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request shape is not published for this route. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/books/drafts/{draftId}": {
      "get": {
        "operationId": "getBookkeepingDraft",
        "summary": "Read a bookkeeping draft",
        "description": "Step 1a. Returns the draft and its status.\n\nDECLARED FIELD-CONTRACT GAP: this route is listed in `UNCONTRACTED_ROUTE_PREFIXES` in `middlewares/publicApiSerialize.middleware.js`. The response field allowlist does not apply to it; only the deny-key floor does. It is named here rather than omitted.\n\nCOARSE SCOPE, ON PURPOSE — not an oversight and not a gap. This route belongs to the AI-MCP-Hellobooks connector surface, and that server enforces a fixed four-string scope model on tool dispatch (`book:read`, `book:write`, `owner:close`, `audit:export`) and ignores every other string. Requiring a granular domain scope here would gate the flow on a string the connector can never be granted. `book:read` / `book:write` remain first-class grantable bundle scopes, so nothing is lost. The same reasoning keeps dynamic client registration (`POST /oauth/register`) on the two bundles.",
        "tags": [
          "bookkeeping"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Response shape is not published for this route. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
                  "x-hellobooks-field-contract": "unpublished"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "hand-written",
        "x-hellobooks-field-contract": "declared-gap",
        "x-hellobooks-tenant-guard": true,
        "x-hellobooks-required-scopes": [
          "book:read"
        ],
        "x-hellobooks-scope-grain": "coarse-bundle",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/draftId"
          }
        ]
      }
    },
    "/orgs/{orgId}/entities/{entityId}/books/drafts/{draftId}/commit": {
      "post": {
        "operationId": "commitBookkeepingDraft",
        "summary": "Commit a confirmed draft to the ledger",
        "description": "Step 3, and the only route on this gateway that posts to the ledger through the metered commit core.\n\nDECLARED FIELD-CONTRACT GAP: this route is listed in `UNCONTRACTED_ROUTE_PREFIXES` in `middlewares/publicApiSerialize.middleware.js`. The response field allowlist does not apply to it; only the deny-key floor does. It is named here rather than omitted.\n\nCOARSE SCOPE, ON PURPOSE — not an oversight and not a gap. This route belongs to the AI-MCP-Hellobooks connector surface, and that server enforces a fixed four-string scope model on tool dispatch (`book:read`, `book:write`, `owner:close`, `audit:export`) and ignores every other string. Requiring a granular domain scope here would gate the flow on a string the connector can never be granted. `book:read` / `book:write` remain first-class grantable bundle scopes, so nothing is lost. The same reasoning keeps dynamic client registration (`POST /oauth/register`) on the two bundles.",
        "tags": [
          "bookkeeping"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Response shape is not published for this route. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
                  "x-hellobooks-field-contract": "unpublished"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "hand-written",
        "x-hellobooks-field-contract": "declared-gap",
        "x-hellobooks-tenant-guard": true,
        "x-hellobooks-required-scopes": [
          "book:write"
        ],
        "x-hellobooks-scope-grain": "coarse-bundle",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/draftId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request shape is not published for this route. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/books/drafts/{draftId}/confirm": {
      "post": {
        "operationId": "confirmBookkeepingDraft",
        "summary": "Confirm a draft for commit",
        "description": "Step 2. Requires `book:write`. Approval by a human in HelloBooks is the design intent of this flow; a connector token cannot approve its own draft through the first-party approval path.\n\nDECLARED FIELD-CONTRACT GAP: this route is listed in `UNCONTRACTED_ROUTE_PREFIXES` in `middlewares/publicApiSerialize.middleware.js`. The response field allowlist does not apply to it; only the deny-key floor does. It is named here rather than omitted.\n\nCOARSE SCOPE, ON PURPOSE — not an oversight and not a gap. This route belongs to the AI-MCP-Hellobooks connector surface, and that server enforces a fixed four-string scope model on tool dispatch (`book:read`, `book:write`, `owner:close`, `audit:export`) and ignores every other string. Requiring a granular domain scope here would gate the flow on a string the connector can never be granted. `book:read` / `book:write` remain first-class grantable bundle scopes, so nothing is lost. The same reasoning keeps dynamic client registration (`POST /oauth/register`) on the two bundles.",
        "tags": [
          "bookkeeping"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Response shape is not published for this route. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
                  "x-hellobooks-field-contract": "unpublished"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "hand-written",
        "x-hellobooks-field-contract": "declared-gap",
        "x-hellobooks-tenant-guard": true,
        "x-hellobooks-required-scopes": [
          "book:write"
        ],
        "x-hellobooks-scope-grain": "coarse-bundle",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/draftId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request shape is not published for this route. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/budget": {
      "get": {
        "operationId": "listBudget",
        "summary": "List budget records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `budget` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/budget.grpc` → `getBudgets`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:read\")`.",
        "tags": [
          "budget"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Budget"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `Budget` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/Budget"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/budget.grpc",
        "x-hellobooks-handler": "getBudgets",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:read"
        ],
        "x-hellobooks-scope-domain": "accounting"
      },
      "post": {
        "operationId": "createBudget",
        "summary": "Create budget record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `budget` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/budget.grpc` → `createBudgets`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "budget"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Budget"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Budget` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Budget"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/budget.grpc",
        "x-hellobooks-handler": "createBudgets",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "ApprovalStatus": {
                    "type": "string"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "IsActive": {
                    "type": "boolean"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "PeriodMonths": {
                    "type": "integer"
                  },
                  "RejectedReason": {
                    "type": "string"
                  },
                  "ScenarioName": {
                    "type": "string"
                  },
                  "StartMonth": {
                    "type": "string"
                  },
                  "SubmittedAt": {
                    "type": "string"
                  },
                  "SubmittedBy": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `budget`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateBudget",
        "summary": "Update budget record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `budget` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/budget.grpc` → `updateBudgets`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "budget"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Budget"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Budget` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Budget"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/budget.grpc",
        "x-hellobooks-handler": "updateBudgets",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "ApprovalStatus": {
                    "type": "string"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "IsActive": {
                    "type": "boolean"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "PeriodMonths": {
                    "type": "integer"
                  },
                  "RejectedReason": {
                    "type": "string"
                  },
                  "ScenarioName": {
                    "type": "string"
                  },
                  "StartMonth": {
                    "type": "string"
                  },
                  "SubmittedAt": {
                    "type": "string"
                  },
                  "SubmittedBy": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `budget`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteBudget",
        "summary": "Delete budget record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `budget` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/budget.grpc` → `deleteBudgets`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "budget"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Budget"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Budget` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Budget"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/budget.grpc",
        "x-hellobooks-handler": "deleteBudgets",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "ApprovalStatus": {
                    "type": "string"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "IsActive": {
                    "type": "boolean"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "PeriodMonths": {
                    "type": "integer"
                  },
                  "RejectedReason": {
                    "type": "string"
                  },
                  "ScenarioName": {
                    "type": "string"
                  },
                  "StartMonth": {
                    "type": "string"
                  },
                  "SubmittedAt": {
                    "type": "string"
                  },
                  "SubmittedBy": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `budget`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/budget/restore": {
      "put": {
        "operationId": "restoreBudget",
        "summary": "Restore archived budget record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `budget` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/budget.grpc` → `restoreBudgets`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "budget"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Budget"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Budget` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Budget"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/budget.grpc",
        "x-hellobooks-handler": "restoreBudgets",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "ApprovalStatus": {
                    "type": "string"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "IsActive": {
                    "type": "boolean"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "PeriodMonths": {
                    "type": "integer"
                  },
                  "RejectedReason": {
                    "type": "string"
                  },
                  "ScenarioName": {
                    "type": "string"
                  },
                  "StartMonth": {
                    "type": "string"
                  },
                  "SubmittedAt": {
                    "type": "string"
                  },
                  "SubmittedBy": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `budget`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/businessOwner": {
      "get": {
        "operationId": "listBusinessOwner",
        "summary": "List businessOwner records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `businessOwner` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/businessOwner.grpc` → `getBusinessOwners`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:read\")`.",
        "tags": [
          "businessOwner"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/BusinessOwner"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `BusinessOwner` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/BusinessOwner"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/businessOwner.grpc",
        "x-hellobooks-handler": "getBusinessOwners",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:read"
        ],
        "x-hellobooks-scope-domain": "contacts"
      },
      "post": {
        "operationId": "createBusinessOwner",
        "summary": "Create businessOwner record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `businessOwner` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/businessOwner.grpc` → `createBusinessOwners`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "businessOwner"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/BusinessOwner"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `BusinessOwner` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/BusinessOwner"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/businessOwner.grpc",
        "x-hellobooks-handler": "createBusinessOwners",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "ChartOfAccountRefs": {
                    "type": "array"
                  },
                  "CompanyName": {
                    "type": "string"
                  },
                  "ContactDetails": {
                    "type": "object"
                  },
                  "DefaultCapitalAccountRef": {
                    "type": "string"
                  },
                  "DisplayName": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "OwnershipPercentage": {
                    "type": "number"
                  },
                  "Tags": {
                    "type": "array"
                  },
                  "UsePersonalCCForBusiness": {
                    "type": "boolean"
                  }
                },
                "description": "Writable fields for `businessOwner`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateBusinessOwner",
        "summary": "Update businessOwner record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `businessOwner` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/businessOwner.grpc` → `updateBusinessOwners`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "businessOwner"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/BusinessOwner"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `BusinessOwner` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/BusinessOwner"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/businessOwner.grpc",
        "x-hellobooks-handler": "updateBusinessOwners",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "ChartOfAccountRefs": {
                    "type": "array"
                  },
                  "CompanyName": {
                    "type": "string"
                  },
                  "ContactDetails": {
                    "type": "object"
                  },
                  "DefaultCapitalAccountRef": {
                    "type": "string"
                  },
                  "DisplayName": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "OwnershipPercentage": {
                    "type": "number"
                  },
                  "Tags": {
                    "type": "array"
                  },
                  "UsePersonalCCForBusiness": {
                    "type": "boolean"
                  }
                },
                "description": "Writable fields for `businessOwner`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteBusinessOwner",
        "summary": "Delete businessOwner record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `businessOwner` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/businessOwner.grpc` → `deleteBusinessOwners`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "businessOwner"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/BusinessOwner"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `BusinessOwner` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/BusinessOwner"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/businessOwner.grpc",
        "x-hellobooks-handler": "deleteBusinessOwners",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "ChartOfAccountRefs": {
                    "type": "array"
                  },
                  "CompanyName": {
                    "type": "string"
                  },
                  "ContactDetails": {
                    "type": "object"
                  },
                  "DefaultCapitalAccountRef": {
                    "type": "string"
                  },
                  "DisplayName": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "OwnershipPercentage": {
                    "type": "number"
                  },
                  "Tags": {
                    "type": "array"
                  },
                  "UsePersonalCCForBusiness": {
                    "type": "boolean"
                  }
                },
                "description": "Writable fields for `businessOwner`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/businessOwner/restore": {
      "put": {
        "operationId": "restoreBusinessOwner",
        "summary": "Restore archived businessOwner record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `businessOwner` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/businessOwner.grpc` → `restoreBusinessOwners`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "businessOwner"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/BusinessOwner"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `BusinessOwner` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/BusinessOwner"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/businessOwner.grpc",
        "x-hellobooks-handler": "restoreBusinessOwners",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "ChartOfAccountRefs": {
                    "type": "array"
                  },
                  "CompanyName": {
                    "type": "string"
                  },
                  "ContactDetails": {
                    "type": "object"
                  },
                  "DefaultCapitalAccountRef": {
                    "type": "string"
                  },
                  "DisplayName": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "OwnershipPercentage": {
                    "type": "number"
                  },
                  "Tags": {
                    "type": "array"
                  },
                  "UsePersonalCCForBusiness": {
                    "type": "boolean"
                  }
                },
                "description": "Writable fields for `businessOwner`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/businessOwner/{id}": {
      "get": {
        "operationId": "getBusinessOwner",
        "summary": "Fetch one businessOwner record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `businessOwner` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/businessOwner.grpc` → `getBusinessOwnerById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:read\")`.",
        "tags": [
          "businessOwner"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/BusinessOwner"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `BusinessOwner` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/BusinessOwner"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/businessOwner.grpc",
        "x-hellobooks-handler": "getBusinessOwnerById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:read"
        ],
        "x-hellobooks-scope-domain": "contacts"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/cashFlow": {
      "get": {
        "operationId": "listCashFlow",
        "summary": "List cashFlow records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `cashFlow` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/reports/cashFlow.grpc` → `getCashFlow`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"reports:read\")`.",
        "tags": [
          "cashFlow"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "reports:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/CashFlow"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `CashFlow` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/CashFlow"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/reports/cashFlow.grpc",
        "x-hellobooks-handler": "getCashFlow",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "reports:read"
        ],
        "x-hellobooks-scope-domain": "reports"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/cashbook": {
      "get": {
        "operationId": "listCashbook",
        "summary": "List cashbook records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `cashbook` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/cashbook.grpc` → `getCashbooks`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:read\")`.",
        "tags": [
          "cashbook"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Cashbook"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `Cashbook` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/Cashbook"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/cashbook.grpc",
        "x-hellobooks-handler": "getCashbooks",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:read"
        ],
        "x-hellobooks-scope-domain": "banking"
      },
      "post": {
        "operationId": "createCashbook",
        "summary": "Create cashbook record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `cashbook` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/cashbook.grpc` → `createCashbooks`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:write\")`.",
        "tags": [
          "cashbook"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Cashbook"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Cashbook` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Cashbook"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/cashbook.grpc",
        "x-hellobooks-handler": "createCashbooks",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:write"
        ],
        "x-hellobooks-scope-domain": "banking",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CurrentBalance": {
                    "type": "number"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "TodayBalance": {
                    "type": "number"
                  },
                  "Type": {
                    "type": "string"
                  },
                  "UpdatedBy": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `cashbook`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateCashbook",
        "summary": "Update cashbook record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `cashbook` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/cashbook.grpc` → `updateCashbooks`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:write\")`.",
        "tags": [
          "cashbook"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Cashbook"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Cashbook` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Cashbook"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/cashbook.grpc",
        "x-hellobooks-handler": "updateCashbooks",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:write"
        ],
        "x-hellobooks-scope-domain": "banking",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CurrentBalance": {
                    "type": "number"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "TodayBalance": {
                    "type": "number"
                  },
                  "Type": {
                    "type": "string"
                  },
                  "UpdatedBy": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `cashbook`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteCashbook",
        "summary": "Delete cashbook record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `cashbook` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/cashbook.grpc` → `deleteCashbooks`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:write\")`.",
        "tags": [
          "cashbook"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Cashbook"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Cashbook` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Cashbook"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/cashbook.grpc",
        "x-hellobooks-handler": "deleteCashbooks",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:write"
        ],
        "x-hellobooks-scope-domain": "banking",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CurrentBalance": {
                    "type": "number"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "TodayBalance": {
                    "type": "number"
                  },
                  "Type": {
                    "type": "string"
                  },
                  "UpdatedBy": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `cashbook`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/cashbook/restore": {
      "put": {
        "operationId": "restoreCashbook",
        "summary": "Restore archived cashbook record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `cashbook` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/cashbook.grpc` → `restoreCashbooks`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:write\")`.",
        "tags": [
          "cashbook"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Cashbook"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Cashbook` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Cashbook"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/cashbook.grpc",
        "x-hellobooks-handler": "restoreCashbooks",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:write"
        ],
        "x-hellobooks-scope-domain": "banking",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CurrentBalance": {
                    "type": "number"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "TodayBalance": {
                    "type": "number"
                  },
                  "Type": {
                    "type": "string"
                  },
                  "UpdatedBy": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `cashbook`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/cashbook/{id}": {
      "get": {
        "operationId": "getCashbook",
        "summary": "Fetch one cashbook record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `cashbook` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/cashbook.grpc` → `getCashbookById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:read\")`.",
        "tags": [
          "cashbook"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Cashbook"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Cashbook` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Cashbook"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/cashbook.grpc",
        "x-hellobooks-handler": "getCashbookById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:read"
        ],
        "x-hellobooks-scope-domain": "banking"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/class": {
      "get": {
        "operationId": "listClass",
        "summary": "List class records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `class` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/class.grpc` → `getClasses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:read\")`.",
        "tags": [
          "class"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Class"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `Class` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/Class"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/class.grpc",
        "x-hellobooks-handler": "getClasses",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:read"
        ],
        "x-hellobooks-scope-domain": "accounting"
      },
      "post": {
        "operationId": "createClass",
        "summary": "Create class record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `class` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/class.grpc` → `createClasses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "class"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Class"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Class` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Class"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/class.grpc",
        "x-hellobooks-handler": "createClasses",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "ClassTrackingCategory": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "TrackingSlot": {
                    "type": "integer"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `class`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateClass",
        "summary": "Update class record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `class` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/class.grpc` → `updateClasses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "class"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Class"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Class` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Class"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/class.grpc",
        "x-hellobooks-handler": "updateClasses",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "ClassTrackingCategory": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "TrackingSlot": {
                    "type": "integer"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `class`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteClass",
        "summary": "Delete class record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `class` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/class.grpc` → `deleteClasses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "class"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Class"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Class` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Class"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/class.grpc",
        "x-hellobooks-handler": "deleteClasses",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "ClassTrackingCategory": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "TrackingSlot": {
                    "type": "integer"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `class`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/class/restore": {
      "put": {
        "operationId": "restoreClass",
        "summary": "Restore archived class record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `class` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/class.grpc` → `restoreClasses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "class"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Class"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Class` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Class"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/class.grpc",
        "x-hellobooks-handler": "restoreClasses",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "ClassTrackingCategory": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "TrackingSlot": {
                    "type": "integer"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `class`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/class/{id}": {
      "get": {
        "operationId": "getClass",
        "summary": "Fetch one class record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `class` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/class.grpc` → `getClassById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:read\")`.",
        "tags": [
          "class"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Class"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Class` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Class"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/class.grpc",
        "x-hellobooks-handler": "getClassById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:read"
        ],
        "x-hellobooks-scope-domain": "accounting"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/comment": {
      "get": {
        "operationId": "listComment",
        "summary": "List comment records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `comment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/comment.grpc` → `getComments`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"comments:read\")`.",
        "tags": [
          "comment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "comments:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Comment"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `Comment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/Comment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/comment.grpc",
        "x-hellobooks-handler": "getComments",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "comments:read"
        ],
        "x-hellobooks-scope-domain": "comments"
      },
      "post": {
        "operationId": "createComment",
        "summary": "Create comment record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `comment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/comment.grpc` → `createComment`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"comments:write\")`.",
        "tags": [
          "comment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "comments:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Comment"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Comment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Comment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/comment.grpc",
        "x-hellobooks-handler": "createComment",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "comments:write"
        ],
        "x-hellobooks-scope-domain": "comments",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "ArchivedAt": {
                    "type": "string"
                  },
                  "ArchivedBy": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "Content": {
                    "type": "string"
                  },
                  "ContentPlain": {
                    "type": "string"
                  },
                  "CreatedByAvatar": {
                    "type": "string"
                  },
                  "CreatedByEmail": {
                    "type": "string"
                  },
                  "CreatedByName": {
                    "type": "string"
                  },
                  "CreatedByUserId": {
                    "type": "string"
                  },
                  "DocumentRefId": {
                    "type": "string"
                  },
                  "DocumentType": {
                    "type": "string"
                  },
                  "EditedAt": {
                    "type": "string"
                  },
                  "ExpenseClaimRefId": {
                    "type": "string"
                  },
                  "ExpenseReceiptRefId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsEdited": {
                    "type": "boolean"
                  },
                  "IsResolved": {
                    "type": "boolean"
                  },
                  "Kind": {
                    "type": "string"
                  },
                  "MentionedUserIds": {
                    "type": "array"
                  },
                  "ParentCommentId": {
                    "type": "string"
                  },
                  "PeriodEnd": {
                    "type": "string"
                  },
                  "PeriodStart": {
                    "type": "string"
                  },
                  "QuestionPriority": {
                    "type": "string"
                  },
                  "QuestionStatus": {
                    "type": "string"
                  },
                  "ReportRowKey": {
                    "type": "string"
                  },
                  "ReportType": {
                    "type": "string"
                  },
                  "ResolvedAt": {
                    "type": "string"
                  },
                  "ResolvedByUserId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `comment`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateComment",
        "summary": "Update comment record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `comment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/comment.grpc` → `updateComment`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"comments:write\")`.",
        "tags": [
          "comment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "comments:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Comment"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Comment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Comment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/comment.grpc",
        "x-hellobooks-handler": "updateComment",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "comments:write"
        ],
        "x-hellobooks-scope-domain": "comments",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "ArchivedAt": {
                    "type": "string"
                  },
                  "ArchivedBy": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "Content": {
                    "type": "string"
                  },
                  "ContentPlain": {
                    "type": "string"
                  },
                  "CreatedByAvatar": {
                    "type": "string"
                  },
                  "CreatedByEmail": {
                    "type": "string"
                  },
                  "CreatedByName": {
                    "type": "string"
                  },
                  "CreatedByUserId": {
                    "type": "string"
                  },
                  "DocumentRefId": {
                    "type": "string"
                  },
                  "DocumentType": {
                    "type": "string"
                  },
                  "EditedAt": {
                    "type": "string"
                  },
                  "ExpenseClaimRefId": {
                    "type": "string"
                  },
                  "ExpenseReceiptRefId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsEdited": {
                    "type": "boolean"
                  },
                  "IsResolved": {
                    "type": "boolean"
                  },
                  "Kind": {
                    "type": "string"
                  },
                  "MentionedUserIds": {
                    "type": "array"
                  },
                  "ParentCommentId": {
                    "type": "string"
                  },
                  "PeriodEnd": {
                    "type": "string"
                  },
                  "PeriodStart": {
                    "type": "string"
                  },
                  "QuestionPriority": {
                    "type": "string"
                  },
                  "QuestionStatus": {
                    "type": "string"
                  },
                  "ReportRowKey": {
                    "type": "string"
                  },
                  "ReportType": {
                    "type": "string"
                  },
                  "ResolvedAt": {
                    "type": "string"
                  },
                  "ResolvedByUserId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `comment`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteComment",
        "summary": "Delete comment record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `comment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/comment.grpc` → `deleteComment`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"comments:write\")`.",
        "tags": [
          "comment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "comments:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Comment"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Comment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Comment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/comment.grpc",
        "x-hellobooks-handler": "deleteComment",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "comments:write"
        ],
        "x-hellobooks-scope-domain": "comments",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "ArchivedAt": {
                    "type": "string"
                  },
                  "ArchivedBy": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "Content": {
                    "type": "string"
                  },
                  "ContentPlain": {
                    "type": "string"
                  },
                  "CreatedByAvatar": {
                    "type": "string"
                  },
                  "CreatedByEmail": {
                    "type": "string"
                  },
                  "CreatedByName": {
                    "type": "string"
                  },
                  "CreatedByUserId": {
                    "type": "string"
                  },
                  "DocumentRefId": {
                    "type": "string"
                  },
                  "DocumentType": {
                    "type": "string"
                  },
                  "EditedAt": {
                    "type": "string"
                  },
                  "ExpenseClaimRefId": {
                    "type": "string"
                  },
                  "ExpenseReceiptRefId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsEdited": {
                    "type": "boolean"
                  },
                  "IsResolved": {
                    "type": "boolean"
                  },
                  "Kind": {
                    "type": "string"
                  },
                  "MentionedUserIds": {
                    "type": "array"
                  },
                  "ParentCommentId": {
                    "type": "string"
                  },
                  "PeriodEnd": {
                    "type": "string"
                  },
                  "PeriodStart": {
                    "type": "string"
                  },
                  "QuestionPriority": {
                    "type": "string"
                  },
                  "QuestionStatus": {
                    "type": "string"
                  },
                  "ReportRowKey": {
                    "type": "string"
                  },
                  "ReportType": {
                    "type": "string"
                  },
                  "ResolvedAt": {
                    "type": "string"
                  },
                  "ResolvedByUserId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `comment`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/comment/restore": {
      "put": {
        "operationId": "restoreComment",
        "summary": "Restore archived comment record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `comment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/comment.grpc` → `restoreComment`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"comments:write\")`.",
        "tags": [
          "comment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "comments:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Comment"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Comment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Comment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/comment.grpc",
        "x-hellobooks-handler": "restoreComment",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "comments:write"
        ],
        "x-hellobooks-scope-domain": "comments",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "ArchivedAt": {
                    "type": "string"
                  },
                  "ArchivedBy": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "Content": {
                    "type": "string"
                  },
                  "ContentPlain": {
                    "type": "string"
                  },
                  "CreatedByAvatar": {
                    "type": "string"
                  },
                  "CreatedByEmail": {
                    "type": "string"
                  },
                  "CreatedByName": {
                    "type": "string"
                  },
                  "CreatedByUserId": {
                    "type": "string"
                  },
                  "DocumentRefId": {
                    "type": "string"
                  },
                  "DocumentType": {
                    "type": "string"
                  },
                  "EditedAt": {
                    "type": "string"
                  },
                  "ExpenseClaimRefId": {
                    "type": "string"
                  },
                  "ExpenseReceiptRefId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsEdited": {
                    "type": "boolean"
                  },
                  "IsResolved": {
                    "type": "boolean"
                  },
                  "Kind": {
                    "type": "string"
                  },
                  "MentionedUserIds": {
                    "type": "array"
                  },
                  "ParentCommentId": {
                    "type": "string"
                  },
                  "PeriodEnd": {
                    "type": "string"
                  },
                  "PeriodStart": {
                    "type": "string"
                  },
                  "QuestionPriority": {
                    "type": "string"
                  },
                  "QuestionStatus": {
                    "type": "string"
                  },
                  "ReportRowKey": {
                    "type": "string"
                  },
                  "ReportType": {
                    "type": "string"
                  },
                  "ResolvedAt": {
                    "type": "string"
                  },
                  "ResolvedByUserId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `comment`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/comment/{id}": {
      "get": {
        "operationId": "getComment",
        "summary": "Fetch one comment record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `comment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/comment.grpc` → `getCommentById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"comments:read\")`.",
        "tags": [
          "comment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "comments:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Comment"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Comment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Comment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/comment.grpc",
        "x-hellobooks-handler": "getCommentById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "comments:read"
        ],
        "x-hellobooks-scope-domain": "comments"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customer": {
      "get": {
        "operationId": "listCustomer",
        "summary": "List customer records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customer` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customer.grpc` → `getCustomers`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:read\")`.",
        "tags": [
          "customer"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Customer"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `Customer` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/Customer"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customer.grpc",
        "x-hellobooks-handler": "getCustomers",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:read"
        ],
        "x-hellobooks-scope-domain": "contacts"
      },
      "post": {
        "operationId": "createCustomer",
        "summary": "Create customer record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customer` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customer.grpc` → `createCustomers`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "customer"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Customer"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Customer` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Customer"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customer.grpc",
        "x-hellobooks-handler": "createCustomers",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Attachments": {
                    "type": "object"
                  },
                  "CategorizationRule": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "CompanyName": {
                    "type": "string"
                  },
                  "ContactDetails": {
                    "type": "object"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "CustomPaymentDays": {
                    "type": "string"
                  },
                  "CustomerChartOfAccount": {
                    "type": "array"
                  },
                  "CustomerClass": {
                    "type": "array"
                  },
                  "CustomerLocation": {
                    "type": "array"
                  },
                  "CustomerProject": {
                    "type": "array"
                  },
                  "CustomerType": {
                    "type": "string"
                  },
                  "DefaultDiscountSequence": {
                    "type": "array"
                  },
                  "DefaultDiscountType": {
                    "type": "string"
                  },
                  "DefaultDiscountValue": {
                    "type": "number"
                  },
                  "DefaultExpenseAccountRef": {
                    "type": "string"
                  },
                  "DefaultPaymentTerm": {
                    "type": "string"
                  },
                  "DefaultSalesRepRefId": {
                    "type": "string"
                  },
                  "DefaultTaxRef": {
                    "type": "string"
                  },
                  "DefaultTcsRefId": {
                    "type": "string"
                  },
                  "DefaultTdsRefId": {
                    "type": "string"
                  },
                  "DisplayName": {
                    "type": "string"
                  },
                  "Dnd": {
                    "type": "boolean"
                  },
                  "DndSetAt": {
                    "type": "string"
                  },
                  "DndSource": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GroupRef": {
                    "type": "array"
                  },
                  "HboId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsRedacted": {
                    "type": "boolean"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "PaymentNotes": {
                    "type": "string"
                  },
                  "PreferredPaymentMethod": {
                    "type": "string"
                  },
                  "PriceListRefId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "RedactedAt": {
                    "type": "string"
                  },
                  "ShopifyCompanyId": {
                    "type": "string"
                  },
                  "ShopifyCustomerId": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "TallyDepth": {
                    "type": "integer"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TallyGroupPath": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyLedgerName": {
                    "type": "string"
                  },
                  "TallyParentGroup": {
                    "type": "string"
                  },
                  "TallyPrimaryGroup": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `customer`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateCustomer",
        "summary": "Update customer record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customer` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customer.grpc` → `updateCustomers`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "customer"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Customer"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Customer` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Customer"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customer.grpc",
        "x-hellobooks-handler": "updateCustomers",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Attachments": {
                    "type": "object"
                  },
                  "CategorizationRule": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "CompanyName": {
                    "type": "string"
                  },
                  "ContactDetails": {
                    "type": "object"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "CustomPaymentDays": {
                    "type": "string"
                  },
                  "CustomerChartOfAccount": {
                    "type": "array"
                  },
                  "CustomerClass": {
                    "type": "array"
                  },
                  "CustomerLocation": {
                    "type": "array"
                  },
                  "CustomerProject": {
                    "type": "array"
                  },
                  "CustomerType": {
                    "type": "string"
                  },
                  "DefaultDiscountSequence": {
                    "type": "array"
                  },
                  "DefaultDiscountType": {
                    "type": "string"
                  },
                  "DefaultDiscountValue": {
                    "type": "number"
                  },
                  "DefaultExpenseAccountRef": {
                    "type": "string"
                  },
                  "DefaultPaymentTerm": {
                    "type": "string"
                  },
                  "DefaultSalesRepRefId": {
                    "type": "string"
                  },
                  "DefaultTaxRef": {
                    "type": "string"
                  },
                  "DefaultTcsRefId": {
                    "type": "string"
                  },
                  "DefaultTdsRefId": {
                    "type": "string"
                  },
                  "DisplayName": {
                    "type": "string"
                  },
                  "Dnd": {
                    "type": "boolean"
                  },
                  "DndSetAt": {
                    "type": "string"
                  },
                  "DndSource": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GroupRef": {
                    "type": "array"
                  },
                  "HboId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsRedacted": {
                    "type": "boolean"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "PaymentNotes": {
                    "type": "string"
                  },
                  "PreferredPaymentMethod": {
                    "type": "string"
                  },
                  "PriceListRefId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "RedactedAt": {
                    "type": "string"
                  },
                  "ShopifyCompanyId": {
                    "type": "string"
                  },
                  "ShopifyCustomerId": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "TallyDepth": {
                    "type": "integer"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TallyGroupPath": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyLedgerName": {
                    "type": "string"
                  },
                  "TallyParentGroup": {
                    "type": "string"
                  },
                  "TallyPrimaryGroup": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `customer`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteCustomer",
        "summary": "Delete customer record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customer` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customer.grpc` → `deleteCustomers`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "customer"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Customer"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Customer` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Customer"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customer.grpc",
        "x-hellobooks-handler": "deleteCustomers",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Attachments": {
                    "type": "object"
                  },
                  "CategorizationRule": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "CompanyName": {
                    "type": "string"
                  },
                  "ContactDetails": {
                    "type": "object"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "CustomPaymentDays": {
                    "type": "string"
                  },
                  "CustomerChartOfAccount": {
                    "type": "array"
                  },
                  "CustomerClass": {
                    "type": "array"
                  },
                  "CustomerLocation": {
                    "type": "array"
                  },
                  "CustomerProject": {
                    "type": "array"
                  },
                  "CustomerType": {
                    "type": "string"
                  },
                  "DefaultDiscountSequence": {
                    "type": "array"
                  },
                  "DefaultDiscountType": {
                    "type": "string"
                  },
                  "DefaultDiscountValue": {
                    "type": "number"
                  },
                  "DefaultExpenseAccountRef": {
                    "type": "string"
                  },
                  "DefaultPaymentTerm": {
                    "type": "string"
                  },
                  "DefaultSalesRepRefId": {
                    "type": "string"
                  },
                  "DefaultTaxRef": {
                    "type": "string"
                  },
                  "DefaultTcsRefId": {
                    "type": "string"
                  },
                  "DefaultTdsRefId": {
                    "type": "string"
                  },
                  "DisplayName": {
                    "type": "string"
                  },
                  "Dnd": {
                    "type": "boolean"
                  },
                  "DndSetAt": {
                    "type": "string"
                  },
                  "DndSource": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GroupRef": {
                    "type": "array"
                  },
                  "HboId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsRedacted": {
                    "type": "boolean"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "PaymentNotes": {
                    "type": "string"
                  },
                  "PreferredPaymentMethod": {
                    "type": "string"
                  },
                  "PriceListRefId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "RedactedAt": {
                    "type": "string"
                  },
                  "ShopifyCompanyId": {
                    "type": "string"
                  },
                  "ShopifyCustomerId": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "TallyDepth": {
                    "type": "integer"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TallyGroupPath": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyLedgerName": {
                    "type": "string"
                  },
                  "TallyParentGroup": {
                    "type": "string"
                  },
                  "TallyPrimaryGroup": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `customer`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customer/restore": {
      "put": {
        "operationId": "restoreCustomer",
        "summary": "Restore archived customer record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customer` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customer.grpc` → `restoreCustomers`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "customer"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Customer"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Customer` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Customer"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customer.grpc",
        "x-hellobooks-handler": "restoreCustomers",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Attachments": {
                    "type": "object"
                  },
                  "CategorizationRule": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "CompanyName": {
                    "type": "string"
                  },
                  "ContactDetails": {
                    "type": "object"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "CustomPaymentDays": {
                    "type": "string"
                  },
                  "CustomerChartOfAccount": {
                    "type": "array"
                  },
                  "CustomerClass": {
                    "type": "array"
                  },
                  "CustomerLocation": {
                    "type": "array"
                  },
                  "CustomerProject": {
                    "type": "array"
                  },
                  "CustomerType": {
                    "type": "string"
                  },
                  "DefaultDiscountSequence": {
                    "type": "array"
                  },
                  "DefaultDiscountType": {
                    "type": "string"
                  },
                  "DefaultDiscountValue": {
                    "type": "number"
                  },
                  "DefaultExpenseAccountRef": {
                    "type": "string"
                  },
                  "DefaultPaymentTerm": {
                    "type": "string"
                  },
                  "DefaultSalesRepRefId": {
                    "type": "string"
                  },
                  "DefaultTaxRef": {
                    "type": "string"
                  },
                  "DefaultTcsRefId": {
                    "type": "string"
                  },
                  "DefaultTdsRefId": {
                    "type": "string"
                  },
                  "DisplayName": {
                    "type": "string"
                  },
                  "Dnd": {
                    "type": "boolean"
                  },
                  "DndSetAt": {
                    "type": "string"
                  },
                  "DndSource": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GroupRef": {
                    "type": "array"
                  },
                  "HboId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsRedacted": {
                    "type": "boolean"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "PaymentNotes": {
                    "type": "string"
                  },
                  "PreferredPaymentMethod": {
                    "type": "string"
                  },
                  "PriceListRefId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "RedactedAt": {
                    "type": "string"
                  },
                  "ShopifyCompanyId": {
                    "type": "string"
                  },
                  "ShopifyCustomerId": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "TallyDepth": {
                    "type": "integer"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TallyGroupPath": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyLedgerName": {
                    "type": "string"
                  },
                  "TallyParentGroup": {
                    "type": "string"
                  },
                  "TallyPrimaryGroup": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `customer`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customer/{id}": {
      "get": {
        "operationId": "getCustomer",
        "summary": "Fetch one customer record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customer` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customer.grpc` → `getCustomerById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:read\")`.",
        "tags": [
          "customer"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Customer"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Customer` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Customer"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customer.grpc",
        "x-hellobooks-handler": "getCustomerById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:read"
        ],
        "x-hellobooks-scope-domain": "contacts"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerAddress": {
      "get": {
        "operationId": "listCustomerAddress",
        "summary": "List customerAddress records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerAddress.grpc` → `getCustomerAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:read\")`.",
        "tags": [
          "customerAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/CustomerAddress"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `CustomerAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/CustomerAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerAddress.grpc",
        "x-hellobooks-handler": "getCustomerAddresses",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:read"
        ],
        "x-hellobooks-scope-domain": "contacts"
      },
      "post": {
        "operationId": "createCustomerAddress",
        "summary": "Create customerAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerAddress.grpc` → `createCustomerAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "customerAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerAddress.grpc",
        "x-hellobooks-handler": "createCustomerAddresses",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AddressType": {
                    "type": "string"
                  },
                  "City": {
                    "type": "string"
                  },
                  "Country": {
                    "type": "string"
                  },
                  "CustomerId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LineOne": {
                    "type": "string"
                  },
                  "LineTwo": {
                    "type": "string"
                  },
                  "Province": {
                    "type": "string"
                  },
                  "ZipCode": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `customerAddress`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateCustomerAddress",
        "summary": "Update customerAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerAddress.grpc` → `updateCustomerAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "customerAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerAddress.grpc",
        "x-hellobooks-handler": "updateCustomerAddresses",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AddressType": {
                    "type": "string"
                  },
                  "City": {
                    "type": "string"
                  },
                  "Country": {
                    "type": "string"
                  },
                  "CustomerId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LineOne": {
                    "type": "string"
                  },
                  "LineTwo": {
                    "type": "string"
                  },
                  "Province": {
                    "type": "string"
                  },
                  "ZipCode": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `customerAddress`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteCustomerAddress",
        "summary": "Delete customerAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerAddress.grpc` → `deleteCustomerAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "customerAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerAddress.grpc",
        "x-hellobooks-handler": "deleteCustomerAddresses",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AddressType": {
                    "type": "string"
                  },
                  "City": {
                    "type": "string"
                  },
                  "Country": {
                    "type": "string"
                  },
                  "CustomerId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LineOne": {
                    "type": "string"
                  },
                  "LineTwo": {
                    "type": "string"
                  },
                  "Province": {
                    "type": "string"
                  },
                  "ZipCode": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `customerAddress`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerAddress/restore": {
      "put": {
        "operationId": "restoreCustomerAddress",
        "summary": "Restore archived customerAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerAddress.grpc` → `restoreCustomerAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "customerAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerAddress.grpc",
        "x-hellobooks-handler": "restoreCustomerAddresses",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AddressType": {
                    "type": "string"
                  },
                  "City": {
                    "type": "string"
                  },
                  "Country": {
                    "type": "string"
                  },
                  "CustomerId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LineOne": {
                    "type": "string"
                  },
                  "LineTwo": {
                    "type": "string"
                  },
                  "Province": {
                    "type": "string"
                  },
                  "ZipCode": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `customerAddress`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerAddress/{id}": {
      "get": {
        "operationId": "getCustomerAddress",
        "summary": "Fetch one customerAddress record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerAddress.grpc` → `getCustomerAddressById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:read\")`.",
        "tags": [
          "customerAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerAddress.grpc",
        "x-hellobooks-handler": "getCustomerAddressById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:read"
        ],
        "x-hellobooks-scope-domain": "contacts"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerAdvance": {
      "get": {
        "operationId": "listCustomerAdvance",
        "summary": "List customerAdvance records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerAdvance` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerAdvance.grpc` → `getCustomerAdvances`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "customerAdvance"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/CustomerAdvance"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `CustomerAdvance` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/CustomerAdvance"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerAdvance.grpc",
        "x-hellobooks-handler": "getCustomerAdvances",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      },
      "post": {
        "operationId": "createCustomerAdvance",
        "summary": "Create customerAdvance record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerAdvance` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerAdvance.grpc` → `createCustomerAdvances`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "customerAdvance"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerAdvance"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerAdvance` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerAdvance"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerAdvance.grpc",
        "x-hellobooks-handler": "createCustomerAdvances",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AdvanceNumber": {
                    "type": "string"
                  },
                  "AppliedAmount": {
                    "type": "number"
                  },
                  "ApprovalRemarks": {
                    "type": "string"
                  },
                  "ApprovalRequired": {
                    "type": "boolean"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BankAccountRefId": {
                    "type": "string"
                  },
                  "ChequeDate": {
                    "type": "string"
                  },
                  "ChequeNumber": {
                    "type": "string"
                  },
                  "ClassComponentRef": {
                    "type": "string"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "CustomerRefId": {
                    "type": "string"
                  },
                  "DifferentialPercent": {
                    "type": "number"
                  },
                  "EcommerceGSTIN": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FunctionalTotalAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "GSTTreatment": {
                    "type": "string"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "InstrumentDate": {
                    "type": "string"
                  },
                  "InstrumentNumber": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsTaxInclusive": {
                    "type": "boolean"
                  },
                  "LiabilityAccountRefId": {
                    "type": "string"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "Memo": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PaymentRefId": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "PostedAt": {
                    "type": "string"
                  },
                  "PostedBy": {
                    "type": "string"
                  },
                  "PostingDate": {
                    "type": "string"
                  },
                  "PrevYearCarryFwd": {
                    "type": "number"
                  },
                  "ProjectRefId": {
                    "type": "string"
                  },
                  "QuoteRefId": {
                    "type": "string"
                  },
                  "ReceiptMethod": {
                    "type": "string"
                  },
                  "ReceiptVoucherNumber": {
                    "type": "string"
                  },
                  "RecurringInvoiceTemplateRefId": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "SalesOrderRefId": {
                    "type": "string"
                  },
                  "ScheduleType": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SubmittedAt": {
                    "type": "string"
                  },
                  "SubmittedBy": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "TCSAmount": {
                    "type": "number"
                  },
                  "TCSApplicable": {
                    "type": "boolean"
                  },
                  "TCSRate": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "TdsAmount": {
                    "type": "number"
                  },
                  "TdsBaseAmount": {
                    "type": "number"
                  },
                  "TdsRate": {
                    "type": "number"
                  },
                  "TdsRefId": {
                    "type": "string"
                  },
                  "TotalAmount": {
                    "type": "number"
                  },
                  "TransactionRefId": {
                    "type": "string"
                  },
                  "UnappliedAmount": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `customerAdvance`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateCustomerAdvance",
        "summary": "Update customerAdvance record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerAdvance` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerAdvance.grpc` → `updateCustomerAdvances`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "customerAdvance"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerAdvance"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerAdvance` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerAdvance"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerAdvance.grpc",
        "x-hellobooks-handler": "updateCustomerAdvances",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AdvanceNumber": {
                    "type": "string"
                  },
                  "AppliedAmount": {
                    "type": "number"
                  },
                  "ApprovalRemarks": {
                    "type": "string"
                  },
                  "ApprovalRequired": {
                    "type": "boolean"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BankAccountRefId": {
                    "type": "string"
                  },
                  "ChequeDate": {
                    "type": "string"
                  },
                  "ChequeNumber": {
                    "type": "string"
                  },
                  "ClassComponentRef": {
                    "type": "string"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "CustomerRefId": {
                    "type": "string"
                  },
                  "DifferentialPercent": {
                    "type": "number"
                  },
                  "EcommerceGSTIN": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FunctionalTotalAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "GSTTreatment": {
                    "type": "string"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "InstrumentDate": {
                    "type": "string"
                  },
                  "InstrumentNumber": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsTaxInclusive": {
                    "type": "boolean"
                  },
                  "LiabilityAccountRefId": {
                    "type": "string"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "Memo": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PaymentRefId": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "PostedAt": {
                    "type": "string"
                  },
                  "PostedBy": {
                    "type": "string"
                  },
                  "PostingDate": {
                    "type": "string"
                  },
                  "PrevYearCarryFwd": {
                    "type": "number"
                  },
                  "ProjectRefId": {
                    "type": "string"
                  },
                  "QuoteRefId": {
                    "type": "string"
                  },
                  "ReceiptMethod": {
                    "type": "string"
                  },
                  "ReceiptVoucherNumber": {
                    "type": "string"
                  },
                  "RecurringInvoiceTemplateRefId": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "SalesOrderRefId": {
                    "type": "string"
                  },
                  "ScheduleType": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SubmittedAt": {
                    "type": "string"
                  },
                  "SubmittedBy": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "TCSAmount": {
                    "type": "number"
                  },
                  "TCSApplicable": {
                    "type": "boolean"
                  },
                  "TCSRate": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "TdsAmount": {
                    "type": "number"
                  },
                  "TdsBaseAmount": {
                    "type": "number"
                  },
                  "TdsRate": {
                    "type": "number"
                  },
                  "TdsRefId": {
                    "type": "string"
                  },
                  "TotalAmount": {
                    "type": "number"
                  },
                  "TransactionRefId": {
                    "type": "string"
                  },
                  "UnappliedAmount": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `customerAdvance`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteCustomerAdvance",
        "summary": "Delete customerAdvance record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerAdvance` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerAdvance.grpc` → `deleteCustomerAdvances`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "customerAdvance"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerAdvance"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerAdvance` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerAdvance"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerAdvance.grpc",
        "x-hellobooks-handler": "deleteCustomerAdvances",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AdvanceNumber": {
                    "type": "string"
                  },
                  "AppliedAmount": {
                    "type": "number"
                  },
                  "ApprovalRemarks": {
                    "type": "string"
                  },
                  "ApprovalRequired": {
                    "type": "boolean"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BankAccountRefId": {
                    "type": "string"
                  },
                  "ChequeDate": {
                    "type": "string"
                  },
                  "ChequeNumber": {
                    "type": "string"
                  },
                  "ClassComponentRef": {
                    "type": "string"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "CustomerRefId": {
                    "type": "string"
                  },
                  "DifferentialPercent": {
                    "type": "number"
                  },
                  "EcommerceGSTIN": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FunctionalTotalAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "GSTTreatment": {
                    "type": "string"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "InstrumentDate": {
                    "type": "string"
                  },
                  "InstrumentNumber": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsTaxInclusive": {
                    "type": "boolean"
                  },
                  "LiabilityAccountRefId": {
                    "type": "string"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "Memo": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PaymentRefId": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "PostedAt": {
                    "type": "string"
                  },
                  "PostedBy": {
                    "type": "string"
                  },
                  "PostingDate": {
                    "type": "string"
                  },
                  "PrevYearCarryFwd": {
                    "type": "number"
                  },
                  "ProjectRefId": {
                    "type": "string"
                  },
                  "QuoteRefId": {
                    "type": "string"
                  },
                  "ReceiptMethod": {
                    "type": "string"
                  },
                  "ReceiptVoucherNumber": {
                    "type": "string"
                  },
                  "RecurringInvoiceTemplateRefId": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "SalesOrderRefId": {
                    "type": "string"
                  },
                  "ScheduleType": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SubmittedAt": {
                    "type": "string"
                  },
                  "SubmittedBy": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "TCSAmount": {
                    "type": "number"
                  },
                  "TCSApplicable": {
                    "type": "boolean"
                  },
                  "TCSRate": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "TdsAmount": {
                    "type": "number"
                  },
                  "TdsBaseAmount": {
                    "type": "number"
                  },
                  "TdsRate": {
                    "type": "number"
                  },
                  "TdsRefId": {
                    "type": "string"
                  },
                  "TotalAmount": {
                    "type": "number"
                  },
                  "TransactionRefId": {
                    "type": "string"
                  },
                  "UnappliedAmount": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `customerAdvance`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerAdvance/restore": {
      "put": {
        "operationId": "restoreCustomerAdvance",
        "summary": "Restore archived customerAdvance record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerAdvance` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerAdvance.grpc` → `restoreCustomerAdvances`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "customerAdvance"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerAdvance"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerAdvance` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerAdvance"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerAdvance.grpc",
        "x-hellobooks-handler": "restoreCustomerAdvances",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AdvanceNumber": {
                    "type": "string"
                  },
                  "AppliedAmount": {
                    "type": "number"
                  },
                  "ApprovalRemarks": {
                    "type": "string"
                  },
                  "ApprovalRequired": {
                    "type": "boolean"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BankAccountRefId": {
                    "type": "string"
                  },
                  "ChequeDate": {
                    "type": "string"
                  },
                  "ChequeNumber": {
                    "type": "string"
                  },
                  "ClassComponentRef": {
                    "type": "string"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "CustomerRefId": {
                    "type": "string"
                  },
                  "DifferentialPercent": {
                    "type": "number"
                  },
                  "EcommerceGSTIN": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FunctionalTotalAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "GSTTreatment": {
                    "type": "string"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "InstrumentDate": {
                    "type": "string"
                  },
                  "InstrumentNumber": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsTaxInclusive": {
                    "type": "boolean"
                  },
                  "LiabilityAccountRefId": {
                    "type": "string"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "Memo": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PaymentRefId": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "PostedAt": {
                    "type": "string"
                  },
                  "PostedBy": {
                    "type": "string"
                  },
                  "PostingDate": {
                    "type": "string"
                  },
                  "PrevYearCarryFwd": {
                    "type": "number"
                  },
                  "ProjectRefId": {
                    "type": "string"
                  },
                  "QuoteRefId": {
                    "type": "string"
                  },
                  "ReceiptMethod": {
                    "type": "string"
                  },
                  "ReceiptVoucherNumber": {
                    "type": "string"
                  },
                  "RecurringInvoiceTemplateRefId": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "SalesOrderRefId": {
                    "type": "string"
                  },
                  "ScheduleType": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SubmittedAt": {
                    "type": "string"
                  },
                  "SubmittedBy": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "TCSAmount": {
                    "type": "number"
                  },
                  "TCSApplicable": {
                    "type": "boolean"
                  },
                  "TCSRate": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "TdsAmount": {
                    "type": "number"
                  },
                  "TdsBaseAmount": {
                    "type": "number"
                  },
                  "TdsRate": {
                    "type": "number"
                  },
                  "TdsRefId": {
                    "type": "string"
                  },
                  "TotalAmount": {
                    "type": "number"
                  },
                  "TransactionRefId": {
                    "type": "string"
                  },
                  "UnappliedAmount": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `customerAdvance`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerAdvance/{id}": {
      "get": {
        "operationId": "getCustomerAdvance",
        "summary": "Fetch one customerAdvance record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerAdvance` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerAdvance.grpc` → `getCustomerAdvanceById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "customerAdvance"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerAdvance"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerAdvance` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerAdvance"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerAdvance.grpc",
        "x-hellobooks-handler": "getCustomerAdvanceById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerAdvanceApplication/{id}": {
      "get": {
        "operationId": "getCustomerAdvanceApplication",
        "summary": "Fetch one customerAdvanceApplication record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerAdvanceApplication` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerAdvanceApplication.grpc` → `getCustomerAdvanceApplicationById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "customerAdvanceApplication"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerAdvanceApplication"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerAdvanceApplication` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerAdvanceApplication"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerAdvanceApplication.grpc",
        "x-hellobooks-handler": "getCustomerAdvanceApplicationById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerAdvanceRecurringLink": {
      "post": {
        "operationId": "createCustomerAdvanceRecurringLink",
        "summary": "Create customerAdvanceRecurringLink record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerAdvanceRecurringLink` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerAdvanceRecurringLink.grpc` → `createCustomerAdvanceRecurringLinks`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "customerAdvanceRecurringLink"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerAdvanceRecurringLink"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerAdvanceRecurringLink` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerAdvanceRecurringLink"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerAdvanceRecurringLink.grpc",
        "x-hellobooks-handler": "createCustomerAdvanceRecurringLinks",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AdvanceId": {
                    "type": "string"
                  },
                  "AutoApplyPolicy": {
                    "type": "integer"
                  },
                  "CarryForward": {
                    "type": "integer"
                  },
                  "EffectiveFrom": {
                    "type": "string"
                  },
                  "EffectiveTo": {
                    "type": "string"
                  },
                  "FixedAmountPerCycle": {
                    "type": "number"
                  },
                  "MaxPerCycleCap": {
                    "type": "number"
                  },
                  "MinPerCycleFloor": {
                    "type": "number"
                  },
                  "PercentOfInvoice": {
                    "type": "number"
                  },
                  "Priority": {
                    "type": "integer"
                  },
                  "RecurringInvoiceTemplateRefId": {
                    "type": "string"
                  },
                  "Rounding": {
                    "type": "integer"
                  },
                  "StopWhenFullyAdjusted": {
                    "type": "boolean"
                  }
                },
                "description": "Writable fields for `customerAdvanceRecurringLink`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateCustomerAdvanceRecurringLink",
        "summary": "Update customerAdvanceRecurringLink record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerAdvanceRecurringLink` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerAdvanceRecurringLink.grpc` → `updateCustomerAdvanceRecurringLinks`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "customerAdvanceRecurringLink"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerAdvanceRecurringLink"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerAdvanceRecurringLink` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerAdvanceRecurringLink"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerAdvanceRecurringLink.grpc",
        "x-hellobooks-handler": "updateCustomerAdvanceRecurringLinks",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AdvanceId": {
                    "type": "string"
                  },
                  "AutoApplyPolicy": {
                    "type": "integer"
                  },
                  "CarryForward": {
                    "type": "integer"
                  },
                  "EffectiveFrom": {
                    "type": "string"
                  },
                  "EffectiveTo": {
                    "type": "string"
                  },
                  "FixedAmountPerCycle": {
                    "type": "number"
                  },
                  "MaxPerCycleCap": {
                    "type": "number"
                  },
                  "MinPerCycleFloor": {
                    "type": "number"
                  },
                  "PercentOfInvoice": {
                    "type": "number"
                  },
                  "Priority": {
                    "type": "integer"
                  },
                  "RecurringInvoiceTemplateRefId": {
                    "type": "string"
                  },
                  "Rounding": {
                    "type": "integer"
                  },
                  "StopWhenFullyAdjusted": {
                    "type": "boolean"
                  }
                },
                "description": "Writable fields for `customerAdvanceRecurringLink`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteCustomerAdvanceRecurringLink",
        "summary": "Delete customerAdvanceRecurringLink record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerAdvanceRecurringLink` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerAdvanceRecurringLink.grpc` → `deleteCustomerAdvanceRecurringLinks`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "customerAdvanceRecurringLink"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerAdvanceRecurringLink"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerAdvanceRecurringLink` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerAdvanceRecurringLink"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerAdvanceRecurringLink.grpc",
        "x-hellobooks-handler": "deleteCustomerAdvanceRecurringLinks",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AdvanceId": {
                    "type": "string"
                  },
                  "AutoApplyPolicy": {
                    "type": "integer"
                  },
                  "CarryForward": {
                    "type": "integer"
                  },
                  "EffectiveFrom": {
                    "type": "string"
                  },
                  "EffectiveTo": {
                    "type": "string"
                  },
                  "FixedAmountPerCycle": {
                    "type": "number"
                  },
                  "MaxPerCycleCap": {
                    "type": "number"
                  },
                  "MinPerCycleFloor": {
                    "type": "number"
                  },
                  "PercentOfInvoice": {
                    "type": "number"
                  },
                  "Priority": {
                    "type": "integer"
                  },
                  "RecurringInvoiceTemplateRefId": {
                    "type": "string"
                  },
                  "Rounding": {
                    "type": "integer"
                  },
                  "StopWhenFullyAdjusted": {
                    "type": "boolean"
                  }
                },
                "description": "Writable fields for `customerAdvanceRecurringLink`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerAdvanceRecurringLink/{id}": {
      "get": {
        "operationId": "getCustomerAdvanceRecurringLink",
        "summary": "Fetch one customerAdvanceRecurringLink record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerAdvanceRecurringLink` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerAdvanceRecurringLink.grpc` → `getCustomerAdvanceRecurringLinkById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "customerAdvanceRecurringLink"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerAdvanceRecurringLink"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerAdvanceRecurringLink` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerAdvanceRecurringLink"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerAdvanceRecurringLink.grpc",
        "x-hellobooks-handler": "getCustomerAdvanceRecurringLinkById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerAdvanceRefund": {
      "post": {
        "operationId": "createCustomerAdvanceRefund",
        "summary": "Create customerAdvanceRefund record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerAdvanceRefund` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerAdvanceRefund.grpc` → `createCustomerAdvanceRefunds`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "customerAdvanceRefund"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerAdvanceRefund"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerAdvanceRefund` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerAdvanceRefund"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerAdvanceRefund.grpc",
        "x-hellobooks-handler": "createCustomerAdvanceRefunds",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AdvanceId": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "CGSTReversal": {
                    "type": "number"
                  },
                  "GSTReversalAmount": {
                    "type": "number"
                  },
                  "IGSTReversal": {
                    "type": "number"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "JournalId": {
                    "type": "string"
                  },
                  "PaymentRefId": {
                    "type": "string"
                  },
                  "Reason": {
                    "type": "string"
                  },
                  "RefundVoucherNumber": {
                    "type": "string"
                  },
                  "SGSTReversal": {
                    "type": "number"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TransactionRefId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `customerAdvanceRefund`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerAdvanceRefund/{id}": {
      "get": {
        "operationId": "getCustomerAdvanceRefund",
        "summary": "Fetch one customerAdvanceRefund record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerAdvanceRefund` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerAdvanceRefund.grpc` → `getCustomerAdvanceRefundById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "customerAdvanceRefund"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerAdvanceRefund"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerAdvanceRefund` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerAdvanceRefund"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerAdvanceRefund.grpc",
        "x-hellobooks-handler": "getCustomerAdvanceRefundById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerAdvanceSchedule": {
      "post": {
        "operationId": "createCustomerAdvanceSchedule",
        "summary": "Create customerAdvanceSchedule record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerAdvanceSchedule` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerAdvanceSchedule.grpc` → `createCustomerAdvanceSchedules`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "customerAdvanceSchedule"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerAdvanceSchedule"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerAdvanceSchedule` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerAdvanceSchedule"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerAdvanceSchedule.grpc",
        "x-hellobooks-handler": "createCustomerAdvanceSchedules",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AdvanceId": {
                    "type": "string"
                  },
                  "AppliedAmount": {
                    "type": "number"
                  },
                  "InvoiceRefId": {
                    "type": "string"
                  },
                  "IsAdjusted": {
                    "type": "boolean"
                  },
                  "MilestoneRefId": {
                    "type": "string"
                  },
                  "PaymentRefId": {
                    "type": "string"
                  },
                  "PeriodStart": {
                    "type": "string"
                  },
                  "ScheduledAmount": {
                    "type": "number"
                  },
                  "Status": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `customerAdvanceSchedule`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateCustomerAdvanceSchedule",
        "summary": "Update customerAdvanceSchedule record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerAdvanceSchedule` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerAdvanceSchedule.grpc` → `updateCustomerAdvanceSchedules`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "customerAdvanceSchedule"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerAdvanceSchedule"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerAdvanceSchedule` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerAdvanceSchedule"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerAdvanceSchedule.grpc",
        "x-hellobooks-handler": "updateCustomerAdvanceSchedules",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AdvanceId": {
                    "type": "string"
                  },
                  "AppliedAmount": {
                    "type": "number"
                  },
                  "InvoiceRefId": {
                    "type": "string"
                  },
                  "IsAdjusted": {
                    "type": "boolean"
                  },
                  "MilestoneRefId": {
                    "type": "string"
                  },
                  "PaymentRefId": {
                    "type": "string"
                  },
                  "PeriodStart": {
                    "type": "string"
                  },
                  "ScheduledAmount": {
                    "type": "number"
                  },
                  "Status": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `customerAdvanceSchedule`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteCustomerAdvanceSchedule",
        "summary": "Delete customerAdvanceSchedule record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerAdvanceSchedule` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerAdvanceSchedule.grpc` → `deleteCustomerAdvanceSchedules`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "customerAdvanceSchedule"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerAdvanceSchedule"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerAdvanceSchedule` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerAdvanceSchedule"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerAdvanceSchedule.grpc",
        "x-hellobooks-handler": "deleteCustomerAdvanceSchedules",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AdvanceId": {
                    "type": "string"
                  },
                  "AppliedAmount": {
                    "type": "number"
                  },
                  "InvoiceRefId": {
                    "type": "string"
                  },
                  "IsAdjusted": {
                    "type": "boolean"
                  },
                  "MilestoneRefId": {
                    "type": "string"
                  },
                  "PaymentRefId": {
                    "type": "string"
                  },
                  "PeriodStart": {
                    "type": "string"
                  },
                  "ScheduledAmount": {
                    "type": "number"
                  },
                  "Status": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `customerAdvanceSchedule`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerAdvanceSchedule/{id}": {
      "get": {
        "operationId": "getCustomerAdvanceSchedule",
        "summary": "Fetch one customerAdvanceSchedule record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerAdvanceSchedule` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerAdvanceSchedule.grpc` → `getCustomerAdvanceScheduleById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "customerAdvanceSchedule"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerAdvanceSchedule"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerAdvanceSchedule` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerAdvanceSchedule"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerAdvanceSchedule.grpc",
        "x-hellobooks-handler": "getCustomerAdvanceScheduleById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerBalance": {
      "get": {
        "operationId": "listCustomerBalance",
        "summary": "List customerBalance records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerBalance` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerBalance.grpc` → `getCustomerBalances`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:read\")`.",
        "tags": [
          "customerBalance"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/CustomerBalance"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `CustomerBalance` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/CustomerBalance"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerBalance.grpc",
        "x-hellobooks-handler": "getCustomerBalances",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:read"
        ],
        "x-hellobooks-scope-domain": "contacts"
      },
      "post": {
        "operationId": "createCustomerBalance",
        "summary": "Create customerBalance record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerBalance` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerBalance.grpc` → `createCustomerBalances`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "customerBalance"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerBalance"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerBalance` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerBalance"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerBalance.grpc",
        "x-hellobooks-handler": "createCustomerBalances",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Amount": {
                    "type": "number"
                  },
                  "AsOfDate": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "CustomerId": {
                    "type": "string"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "Type": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `customerBalance`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateCustomerBalance",
        "summary": "Update customerBalance record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerBalance` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerBalance.grpc` → `updateCustomerBalances`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "customerBalance"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerBalance"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerBalance` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerBalance"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerBalance.grpc",
        "x-hellobooks-handler": "updateCustomerBalances",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Amount": {
                    "type": "number"
                  },
                  "AsOfDate": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "CustomerId": {
                    "type": "string"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "Type": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `customerBalance`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteCustomerBalance",
        "summary": "Delete customerBalance record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerBalance` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerBalance.grpc` → `deleteCustomerBalances`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "customerBalance"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerBalance"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerBalance` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerBalance"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerBalance.grpc",
        "x-hellobooks-handler": "deleteCustomerBalances",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Amount": {
                    "type": "number"
                  },
                  "AsOfDate": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "CustomerId": {
                    "type": "string"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "Type": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `customerBalance`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerBalance/{id}": {
      "get": {
        "operationId": "getCustomerBalance",
        "summary": "Fetch one customerBalance record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerBalance` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerBalance.grpc` → `getCustomerBalanceById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:read\")`.",
        "tags": [
          "customerBalance"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerBalance"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerBalance` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerBalance"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerBalance.grpc",
        "x-hellobooks-handler": "getCustomerBalanceById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:read"
        ],
        "x-hellobooks-scope-domain": "contacts"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerContactPersons": {
      "post": {
        "operationId": "createCustomerContactPersons",
        "summary": "Create customerContactPersons record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerContactPersons` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerContactPerson.grpc` → `createCustomerContactPersons`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "customerContactPersons"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerContactPersons"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerContactPersons` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerContactPersons"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerContactPerson.grpc",
        "x-hellobooks-handler": "createCustomerContactPersons",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `create` on `customerContactPersons`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"CustomerContactPersons\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "CustomerContactPersons"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateCustomerContactPersons",
        "summary": "Update customerContactPersons record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerContactPersons` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerContactPerson.grpc` → `updateCustomerContactPersons`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "customerContactPersons"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerContactPersons"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerContactPersons` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerContactPersons"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerContactPerson.grpc",
        "x-hellobooks-handler": "updateCustomerContactPersons",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `update` on `customerContactPersons`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"CustomerContactPersons\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "CustomerContactPersons"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteCustomerContactPersons",
        "summary": "Delete customerContactPersons record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerContactPersons` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerContactPerson.grpc` → `deleteCustomerContactPersons`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "customerContactPersons"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerContactPersons"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerContactPersons` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerContactPersons"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerContactPerson.grpc",
        "x-hellobooks-handler": "deleteCustomerContactPersons",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `del` on `customerContactPersons`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"CustomerContactPersons\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "CustomerContactPersons"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerContactPersons/restore": {
      "put": {
        "operationId": "restoreCustomerContactPersons",
        "summary": "Restore archived customerContactPersons record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerContactPersons` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerContactPerson.grpc` → `restoreCustomerContactPersons`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "customerContactPersons"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerContactPersons"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerContactPersons` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerContactPersons"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerContactPerson.grpc",
        "x-hellobooks-handler": "restoreCustomerContactPersons",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `restore` on `customerContactPersons`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"CustomerContactPersons\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "CustomerContactPersons"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerContactPersons/{id}": {
      "get": {
        "operationId": "getCustomerContactPersons",
        "summary": "Fetch one customerContactPersons record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerContactPersons` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerContactPerson.grpc` → `getCustomerContactPersonById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:read\")`.",
        "tags": [
          "customerContactPersons"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerContactPersons"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerContactPersons` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerContactPersons"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerContactPerson.grpc",
        "x-hellobooks-handler": "getCustomerContactPersonById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:read"
        ],
        "x-hellobooks-scope-domain": "contacts"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerCreditCard": {
      "post": {
        "operationId": "createCustomerCreditCard",
        "summary": "Create customerCreditCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerCreditCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerCreditCardDetail.grpc` → `createCustomerCreditCardDetails`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "customerCreditCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerCreditCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerCreditCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerCreditCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerCreditCardDetail.grpc",
        "x-hellobooks-handler": "createCustomerCreditCardDetails",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `create` on `customerCreditCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"CustomerCreditCardDetails\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "CustomerCreditCardDetails"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateCustomerCreditCard",
        "summary": "Update customerCreditCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerCreditCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerCreditCardDetail.grpc` → `updateCustomerCreditCardDetails`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "customerCreditCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerCreditCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerCreditCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerCreditCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerCreditCardDetail.grpc",
        "x-hellobooks-handler": "updateCustomerCreditCardDetails",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `update` on `customerCreditCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"CustomerCreditCardDetails\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "CustomerCreditCardDetails"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteCustomerCreditCard",
        "summary": "Delete customerCreditCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerCreditCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerCreditCardDetail.grpc` → `deleteCustomerCreditCardDetails`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "customerCreditCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerCreditCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerCreditCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerCreditCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerCreditCardDetail.grpc",
        "x-hellobooks-handler": "deleteCustomerCreditCardDetails",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `del` on `customerCreditCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"CustomerCreditCardDetails\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "CustomerCreditCardDetails"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerCreditCard/restore": {
      "put": {
        "operationId": "restoreCustomerCreditCard",
        "summary": "Restore archived customerCreditCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerCreditCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerCreditCardDetail.grpc` → `restoreCustomerCreditCardDetails`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "customerCreditCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerCreditCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerCreditCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerCreditCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerCreditCardDetail.grpc",
        "x-hellobooks-handler": "restoreCustomerCreditCardDetails",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `restore` on `customerCreditCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"CustomerCreditCardDetails\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "CustomerCreditCardDetails"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerCreditCard/{id}": {
      "get": {
        "operationId": "getCustomerCreditCard",
        "summary": "Fetch one customerCreditCard record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerCreditCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerCreditCardDetail.grpc` → `getCustomerCreditCardDetailById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:read\")`.",
        "tags": [
          "customerCreditCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerCreditCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerCreditCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerCreditCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerCreditCardDetail.grpc",
        "x-hellobooks-handler": "getCustomerCreditCardDetailById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:read"
        ],
        "x-hellobooks-scope-domain": "paymentmethods"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerDebitCard": {
      "post": {
        "operationId": "createCustomerDebitCard",
        "summary": "Create customerDebitCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerDebitCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerDebitCardDetail.grpc` → `createCustomerDebitCardDetails`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "customerDebitCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerDebitCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerDebitCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerDebitCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerDebitCardDetail.grpc",
        "x-hellobooks-handler": "createCustomerDebitCardDetails",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `create` on `customerDebitCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"CustomerDebitCardDetails\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "CustomerDebitCardDetails"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateCustomerDebitCard",
        "summary": "Update customerDebitCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerDebitCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerDebitCardDetail.grpc` → `updateCustomerDebitCardDetails`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "customerDebitCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerDebitCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerDebitCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerDebitCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerDebitCardDetail.grpc",
        "x-hellobooks-handler": "updateCustomerDebitCardDetails",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `update` on `customerDebitCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"CustomerDebitCardDetails\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "CustomerDebitCardDetails"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteCustomerDebitCard",
        "summary": "Delete customerDebitCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerDebitCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerDebitCardDetail.grpc` → `deleteCustomerDebitCardDetails`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "customerDebitCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerDebitCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerDebitCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerDebitCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerDebitCardDetail.grpc",
        "x-hellobooks-handler": "deleteCustomerDebitCardDetails",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `del` on `customerDebitCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"CustomerDebitCardDetails\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "CustomerDebitCardDetails"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerDebitCard/restore": {
      "put": {
        "operationId": "restoreCustomerDebitCard",
        "summary": "Restore archived customerDebitCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerDebitCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerDebitCardDetail.grpc` → `restoreCustomerDebitCardDetails`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "customerDebitCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerDebitCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerDebitCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerDebitCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerDebitCardDetail.grpc",
        "x-hellobooks-handler": "restoreCustomerDebitCardDetails",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `restore` on `customerDebitCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"CustomerDebitCardDetails\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "CustomerDebitCardDetails"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerDebitCard/{id}": {
      "get": {
        "operationId": "getCustomerDebitCard",
        "summary": "Fetch one customerDebitCard record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerDebitCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerDebitCardDetail.grpc` → `getCustomerDebitCardDetailById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:read\")`.",
        "tags": [
          "customerDebitCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerDebitCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerDebitCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerDebitCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerDebitCardDetail.grpc",
        "x-hellobooks-handler": "getCustomerDebitCardDetailById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:read"
        ],
        "x-hellobooks-scope-domain": "paymentmethods"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerGroup": {
      "get": {
        "operationId": "listCustomerGroup",
        "summary": "List customerGroup records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerGroup` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerGroup.grpc` → `getCustomerGroups`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:read\")`.",
        "tags": [
          "customerGroup"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/CustomerGroup"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `CustomerGroup` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/CustomerGroup"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerGroup.grpc",
        "x-hellobooks-handler": "getCustomerGroups",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:read"
        ],
        "x-hellobooks-scope-domain": "contacts"
      },
      "post": {
        "operationId": "createCustomerGroup",
        "summary": "Create customerGroup record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerGroup` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerGroup.grpc` → `createCustomerGroups`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "customerGroup"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerGroup"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerGroup` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerGroup"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerGroup.grpc",
        "x-hellobooks-handler": "createCustomerGroups",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Name": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `customerGroup`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateCustomerGroup",
        "summary": "Update customerGroup record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerGroup` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerGroup.grpc` → `updateCustomerGroups`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "customerGroup"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerGroup"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerGroup` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerGroup"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerGroup.grpc",
        "x-hellobooks-handler": "updateCustomerGroups",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Name": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `customerGroup`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteCustomerGroup",
        "summary": "Delete customerGroup record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerGroup` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerGroup.grpc` → `deleteCustomerGroups`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "customerGroup"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerGroup"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerGroup` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerGroup"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerGroup.grpc",
        "x-hellobooks-handler": "deleteCustomerGroups",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Name": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `customerGroup`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerGroup/restore": {
      "put": {
        "operationId": "restoreCustomerGroup",
        "summary": "Restore archived customerGroup record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerGroup` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerGroup.grpc` → `restoreCustomerGroups`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "customerGroup"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerGroup"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerGroup` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerGroup"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerGroup.grpc",
        "x-hellobooks-handler": "restoreCustomerGroups",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Name": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `customerGroup`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customerGroup/{id}": {
      "get": {
        "operationId": "getCustomerGroup",
        "summary": "Fetch one customerGroup record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `customerGroup` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/customerGroup.grpc` → `getCustomerGroupById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:read\")`.",
        "tags": [
          "customerGroup"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/CustomerGroup"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `CustomerGroup` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/CustomerGroup"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/customerGroup.grpc",
        "x-hellobooks-handler": "getCustomerGroupById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:read"
        ],
        "x-hellobooks-scope-domain": "contacts"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/customers": {
      "get": {
        "operationId": "listCustomersLegacy",
        "summary": "List customers (hand-written route)",
        "description": "Predates the generic factory. NOTE THE PLURAL: the factory's registry seg is `customer` (singular), so `GET .../customer` and `GET .../customers` are two different live routes reaching the same controller. This one has no field contract and is declared in UNCONTRACTED_ROUTE_PREFIXES.\n\nDECLARED FIELD-CONTRACT GAP: this route is listed in `UNCONTRACTED_ROUTE_PREFIXES` in `middlewares/publicApiSerialize.middleware.js`. The response field allowlist does not apply to it; only the deny-key floor does. It is named here rather than omitted.",
        "tags": [
          "customers"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Response shape is not published for this route. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
                  "x-hellobooks-field-contract": "unpublished"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "hand-written",
        "x-hellobooks-field-contract": "declared-gap",
        "x-hellobooks-tenant-guard": true,
        "x-hellobooks-required-scopes": [
          "contacts:read"
        ],
        "x-hellobooks-scope-grain": "granular",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ]
      },
      "post": {
        "operationId": "createCustomersLegacy",
        "summary": "Create customers (hand-written route)",
        "description": "Predates the generic factory; see the GET. The route normalises a bare object or a bare array into `{ Customers: [...] }` before calling the internal controller, so all three body forms are accepted.\n\nDECLARED FIELD-CONTRACT GAP: this route is listed in `UNCONTRACTED_ROUTE_PREFIXES` in `middlewares/publicApiSerialize.middleware.js`. The response field allowlist does not apply to it; only the deny-key floor does. It is named here rather than omitted.",
        "tags": [
          "customers"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Response shape is not published for this route. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
                  "x-hellobooks-field-contract": "unpublished"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "hand-written",
        "x-hellobooks-field-contract": "declared-gap",
        "x-hellobooks-tenant-guard": true,
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-grain": "granular",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "description": "Accepted as `{ Customers: [ ... ] }`, a bare array of customer objects, or a single bare customer object. Field-level shape is not published — this route is a declared field-contract gap.",
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "Customers": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      }
                    },
                    "required": [
                      "Customers"
                    ]
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  {
                    "type": "object"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/deliveryChallan": {
      "get": {
        "operationId": "listDeliveryChallan",
        "summary": "List deliveryChallan records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `deliveryChallan` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/deliveryChallan.grpc` → `getDeliveryChallans`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "deliveryChallan"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/DeliveryChallan"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `DeliveryChallan` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/DeliveryChallan"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/deliveryChallan.grpc",
        "x-hellobooks-handler": "getDeliveryChallans",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      },
      "post": {
        "operationId": "createDeliveryChallan",
        "summary": "Create deliveryChallan record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `deliveryChallan` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/deliveryChallan.grpc` → `createDeliveryChallans`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "deliveryChallan"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/DeliveryChallan"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `DeliveryChallan` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/DeliveryChallan"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/deliveryChallan.grpc",
        "x-hellobooks-handler": "createDeliveryChallans",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AWBNumber": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BackorderStatus": {
                    "type": "string"
                  },
                  "CODAmount": {
                    "type": "number"
                  },
                  "ChallanNumber": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "ConsigneeGSTIN": {
                    "type": "string"
                  },
                  "CrossDockOrderRefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomerRef": {
                    "type": "string"
                  },
                  "DeliveryDate": {
                    "type": "string"
                  },
                  "DeliveryStatus": {
                    "type": "string"
                  },
                  "DeliveryType": {
                    "type": "string"
                  },
                  "DispatchMethod": {
                    "type": "string"
                  },
                  "EwayBillRequired": {
                    "type": "boolean"
                  },
                  "EwbGeneratedAt": {
                    "type": "string"
                  },
                  "EwbNo": {
                    "type": "string"
                  },
                  "EwbRefId": {
                    "type": "string"
                  },
                  "EwbStatus": {
                    "type": "string"
                  },
                  "EwbValidUpto": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExcludeFromEwb": {
                    "type": "boolean"
                  },
                  "ExpectedDeliveryDate": {
                    "type": "string"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "InvoiceRefId": {
                    "type": "string"
                  },
                  "InvoicingStatus": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LabelUrl": {
                    "type": "string"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "MasterDiscountRef": {
                    "type": "string"
                  },
                  "PackageBreadthCm": {
                    "type": "number"
                  },
                  "PackageHeightCm": {
                    "type": "number"
                  },
                  "PackageLengthCm": {
                    "type": "number"
                  },
                  "PackageWeightKg": {
                    "type": "number"
                  },
                  "PackingOrderRefId": {
                    "type": "string"
                  },
                  "PickupScheduledDate": {
                    "type": "string"
                  },
                  "PrintStatus": {
                    "type": "string"
                  },
                  "Priority": {
                    "type": "string"
                  },
                  "QuantityShipped": {
                    "type": "number"
                  },
                  "QuoteRefId": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "SalesOrderRefId": {
                    "type": "string"
                  },
                  "ScheduledDate": {
                    "type": "string"
                  },
                  "SellerGSTIN": {
                    "type": "string"
                  },
                  "ShiprocketOrderId": {
                    "type": "string"
                  },
                  "ShiprocketShipmentId": {
                    "type": "string"
                  },
                  "ShiprocketShipmentRefId": {
                    "type": "string"
                  },
                  "ShopifyFulfillmentId": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "SrCourierId": {
                    "type": "string"
                  },
                  "StateOfOrigin": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalInvoicedAmount": {
                    "type": "number"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalQuantity": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "TrackingNumber": {
                    "type": "string"
                  },
                  "TransportMode": {
                    "type": "string"
                  },
                  "VehicleNumber": {
                    "type": "string"
                  },
                  "VehicleType": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `deliveryChallan`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateDeliveryChallan",
        "summary": "Update deliveryChallan record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `deliveryChallan` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/deliveryChallan.grpc` → `updateDeliveryChallans`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "deliveryChallan"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/DeliveryChallan"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `DeliveryChallan` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/DeliveryChallan"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/deliveryChallan.grpc",
        "x-hellobooks-handler": "updateDeliveryChallans",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AWBNumber": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BackorderStatus": {
                    "type": "string"
                  },
                  "CODAmount": {
                    "type": "number"
                  },
                  "ChallanNumber": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "ConsigneeGSTIN": {
                    "type": "string"
                  },
                  "CrossDockOrderRefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomerRef": {
                    "type": "string"
                  },
                  "DeliveryDate": {
                    "type": "string"
                  },
                  "DeliveryStatus": {
                    "type": "string"
                  },
                  "DeliveryType": {
                    "type": "string"
                  },
                  "DispatchMethod": {
                    "type": "string"
                  },
                  "EwayBillRequired": {
                    "type": "boolean"
                  },
                  "EwbGeneratedAt": {
                    "type": "string"
                  },
                  "EwbNo": {
                    "type": "string"
                  },
                  "EwbRefId": {
                    "type": "string"
                  },
                  "EwbStatus": {
                    "type": "string"
                  },
                  "EwbValidUpto": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExcludeFromEwb": {
                    "type": "boolean"
                  },
                  "ExpectedDeliveryDate": {
                    "type": "string"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "InvoiceRefId": {
                    "type": "string"
                  },
                  "InvoicingStatus": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LabelUrl": {
                    "type": "string"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "MasterDiscountRef": {
                    "type": "string"
                  },
                  "PackageBreadthCm": {
                    "type": "number"
                  },
                  "PackageHeightCm": {
                    "type": "number"
                  },
                  "PackageLengthCm": {
                    "type": "number"
                  },
                  "PackageWeightKg": {
                    "type": "number"
                  },
                  "PackingOrderRefId": {
                    "type": "string"
                  },
                  "PickupScheduledDate": {
                    "type": "string"
                  },
                  "PrintStatus": {
                    "type": "string"
                  },
                  "Priority": {
                    "type": "string"
                  },
                  "QuantityShipped": {
                    "type": "number"
                  },
                  "QuoteRefId": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "SalesOrderRefId": {
                    "type": "string"
                  },
                  "ScheduledDate": {
                    "type": "string"
                  },
                  "SellerGSTIN": {
                    "type": "string"
                  },
                  "ShiprocketOrderId": {
                    "type": "string"
                  },
                  "ShiprocketShipmentId": {
                    "type": "string"
                  },
                  "ShiprocketShipmentRefId": {
                    "type": "string"
                  },
                  "ShopifyFulfillmentId": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "SrCourierId": {
                    "type": "string"
                  },
                  "StateOfOrigin": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalInvoicedAmount": {
                    "type": "number"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalQuantity": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "TrackingNumber": {
                    "type": "string"
                  },
                  "TransportMode": {
                    "type": "string"
                  },
                  "VehicleNumber": {
                    "type": "string"
                  },
                  "VehicleType": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `deliveryChallan`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteDeliveryChallan",
        "summary": "Delete deliveryChallan record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `deliveryChallan` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/deliveryChallan.grpc` → `deleteDeliveryChallans`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "deliveryChallan"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/DeliveryChallan"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `DeliveryChallan` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/DeliveryChallan"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/deliveryChallan.grpc",
        "x-hellobooks-handler": "deleteDeliveryChallans",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AWBNumber": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BackorderStatus": {
                    "type": "string"
                  },
                  "CODAmount": {
                    "type": "number"
                  },
                  "ChallanNumber": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "ConsigneeGSTIN": {
                    "type": "string"
                  },
                  "CrossDockOrderRefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomerRef": {
                    "type": "string"
                  },
                  "DeliveryDate": {
                    "type": "string"
                  },
                  "DeliveryStatus": {
                    "type": "string"
                  },
                  "DeliveryType": {
                    "type": "string"
                  },
                  "DispatchMethod": {
                    "type": "string"
                  },
                  "EwayBillRequired": {
                    "type": "boolean"
                  },
                  "EwbGeneratedAt": {
                    "type": "string"
                  },
                  "EwbNo": {
                    "type": "string"
                  },
                  "EwbRefId": {
                    "type": "string"
                  },
                  "EwbStatus": {
                    "type": "string"
                  },
                  "EwbValidUpto": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExcludeFromEwb": {
                    "type": "boolean"
                  },
                  "ExpectedDeliveryDate": {
                    "type": "string"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "InvoiceRefId": {
                    "type": "string"
                  },
                  "InvoicingStatus": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LabelUrl": {
                    "type": "string"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "MasterDiscountRef": {
                    "type": "string"
                  },
                  "PackageBreadthCm": {
                    "type": "number"
                  },
                  "PackageHeightCm": {
                    "type": "number"
                  },
                  "PackageLengthCm": {
                    "type": "number"
                  },
                  "PackageWeightKg": {
                    "type": "number"
                  },
                  "PackingOrderRefId": {
                    "type": "string"
                  },
                  "PickupScheduledDate": {
                    "type": "string"
                  },
                  "PrintStatus": {
                    "type": "string"
                  },
                  "Priority": {
                    "type": "string"
                  },
                  "QuantityShipped": {
                    "type": "number"
                  },
                  "QuoteRefId": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "SalesOrderRefId": {
                    "type": "string"
                  },
                  "ScheduledDate": {
                    "type": "string"
                  },
                  "SellerGSTIN": {
                    "type": "string"
                  },
                  "ShiprocketOrderId": {
                    "type": "string"
                  },
                  "ShiprocketShipmentId": {
                    "type": "string"
                  },
                  "ShiprocketShipmentRefId": {
                    "type": "string"
                  },
                  "ShopifyFulfillmentId": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "SrCourierId": {
                    "type": "string"
                  },
                  "StateOfOrigin": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalInvoicedAmount": {
                    "type": "number"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalQuantity": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "TrackingNumber": {
                    "type": "string"
                  },
                  "TransportMode": {
                    "type": "string"
                  },
                  "VehicleNumber": {
                    "type": "string"
                  },
                  "VehicleType": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `deliveryChallan`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/deliveryChallan/restore": {
      "put": {
        "operationId": "restoreDeliveryChallan",
        "summary": "Restore archived deliveryChallan record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `deliveryChallan` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/deliveryChallan.grpc` → `restoreDeliveryChallans`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "deliveryChallan"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/DeliveryChallan"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `DeliveryChallan` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/DeliveryChallan"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/deliveryChallan.grpc",
        "x-hellobooks-handler": "restoreDeliveryChallans",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AWBNumber": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BackorderStatus": {
                    "type": "string"
                  },
                  "CODAmount": {
                    "type": "number"
                  },
                  "ChallanNumber": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "ConsigneeGSTIN": {
                    "type": "string"
                  },
                  "CrossDockOrderRefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomerRef": {
                    "type": "string"
                  },
                  "DeliveryDate": {
                    "type": "string"
                  },
                  "DeliveryStatus": {
                    "type": "string"
                  },
                  "DeliveryType": {
                    "type": "string"
                  },
                  "DispatchMethod": {
                    "type": "string"
                  },
                  "EwayBillRequired": {
                    "type": "boolean"
                  },
                  "EwbGeneratedAt": {
                    "type": "string"
                  },
                  "EwbNo": {
                    "type": "string"
                  },
                  "EwbRefId": {
                    "type": "string"
                  },
                  "EwbStatus": {
                    "type": "string"
                  },
                  "EwbValidUpto": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExcludeFromEwb": {
                    "type": "boolean"
                  },
                  "ExpectedDeliveryDate": {
                    "type": "string"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "InvoiceRefId": {
                    "type": "string"
                  },
                  "InvoicingStatus": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LabelUrl": {
                    "type": "string"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "MasterDiscountRef": {
                    "type": "string"
                  },
                  "PackageBreadthCm": {
                    "type": "number"
                  },
                  "PackageHeightCm": {
                    "type": "number"
                  },
                  "PackageLengthCm": {
                    "type": "number"
                  },
                  "PackageWeightKg": {
                    "type": "number"
                  },
                  "PackingOrderRefId": {
                    "type": "string"
                  },
                  "PickupScheduledDate": {
                    "type": "string"
                  },
                  "PrintStatus": {
                    "type": "string"
                  },
                  "Priority": {
                    "type": "string"
                  },
                  "QuantityShipped": {
                    "type": "number"
                  },
                  "QuoteRefId": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "SalesOrderRefId": {
                    "type": "string"
                  },
                  "ScheduledDate": {
                    "type": "string"
                  },
                  "SellerGSTIN": {
                    "type": "string"
                  },
                  "ShiprocketOrderId": {
                    "type": "string"
                  },
                  "ShiprocketShipmentId": {
                    "type": "string"
                  },
                  "ShiprocketShipmentRefId": {
                    "type": "string"
                  },
                  "ShopifyFulfillmentId": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "SrCourierId": {
                    "type": "string"
                  },
                  "StateOfOrigin": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalInvoicedAmount": {
                    "type": "number"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalQuantity": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "TrackingNumber": {
                    "type": "string"
                  },
                  "TransportMode": {
                    "type": "string"
                  },
                  "VehicleNumber": {
                    "type": "string"
                  },
                  "VehicleType": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `deliveryChallan`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/deliveryChallan/{id}": {
      "get": {
        "operationId": "getDeliveryChallan",
        "summary": "Fetch one deliveryChallan record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `deliveryChallan` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/deliveryChallan.grpc` → `getDeliveryChallanById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "deliveryChallan"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/DeliveryChallan"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `DeliveryChallan` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/DeliveryChallan"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/deliveryChallan.grpc",
        "x-hellobooks-handler": "getDeliveryChallanById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/deliveryChallanAddress": {
      "post": {
        "operationId": "createDeliveryChallanAddress",
        "summary": "Create deliveryChallanAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `deliveryChallanAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/deliveryChallanAddress.grpc` → `createDeliveryChallanAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "deliveryChallanAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/DeliveryChallanAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `DeliveryChallanAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/DeliveryChallanAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/deliveryChallanAddress.grpc",
        "x-hellobooks-handler": "createDeliveryChallanAddresses",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "City": {
                    "type": "string"
                  },
                  "DeliveryChallanId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LineOne": {
                    "type": "string"
                  },
                  "LineTwo": {
                    "type": "string"
                  },
                  "Province": {
                    "type": "string"
                  },
                  "Type": {
                    "type": "string"
                  },
                  "ZipCode": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `deliveryChallanAddress`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateDeliveryChallanAddress",
        "summary": "Update deliveryChallanAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `deliveryChallanAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/deliveryChallanAddress.grpc` → `updateDeliveryChallanAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "deliveryChallanAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/DeliveryChallanAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `DeliveryChallanAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/DeliveryChallanAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/deliveryChallanAddress.grpc",
        "x-hellobooks-handler": "updateDeliveryChallanAddresses",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "City": {
                    "type": "string"
                  },
                  "DeliveryChallanId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LineOne": {
                    "type": "string"
                  },
                  "LineTwo": {
                    "type": "string"
                  },
                  "Province": {
                    "type": "string"
                  },
                  "Type": {
                    "type": "string"
                  },
                  "ZipCode": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `deliveryChallanAddress`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteDeliveryChallanAddress",
        "summary": "Delete deliveryChallanAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `deliveryChallanAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/deliveryChallanAddress.grpc` → `deleteDeliveryChallanAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "deliveryChallanAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/DeliveryChallanAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `DeliveryChallanAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/DeliveryChallanAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/deliveryChallanAddress.grpc",
        "x-hellobooks-handler": "deleteDeliveryChallanAddresses",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "City": {
                    "type": "string"
                  },
                  "DeliveryChallanId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LineOne": {
                    "type": "string"
                  },
                  "LineTwo": {
                    "type": "string"
                  },
                  "Province": {
                    "type": "string"
                  },
                  "Type": {
                    "type": "string"
                  },
                  "ZipCode": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `deliveryChallanAddress`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/deliveryChallanAddress/restore": {
      "put": {
        "operationId": "restoreDeliveryChallanAddress",
        "summary": "Restore archived deliveryChallanAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `deliveryChallanAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/deliveryChallanAddress.grpc` → `restoreDeliveryChallanAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "deliveryChallanAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/DeliveryChallanAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `DeliveryChallanAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/DeliveryChallanAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/deliveryChallanAddress.grpc",
        "x-hellobooks-handler": "restoreDeliveryChallanAddresses",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "City": {
                    "type": "string"
                  },
                  "DeliveryChallanId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LineOne": {
                    "type": "string"
                  },
                  "LineTwo": {
                    "type": "string"
                  },
                  "Province": {
                    "type": "string"
                  },
                  "Type": {
                    "type": "string"
                  },
                  "ZipCode": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `deliveryChallanAddress`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/deliveryChallanAddress/{id}": {
      "get": {
        "operationId": "getDeliveryChallanAddress",
        "summary": "Fetch one deliveryChallanAddress record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `deliveryChallanAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/deliveryChallanAddress.grpc` → `getDeliveryChallanAddressById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "deliveryChallanAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/DeliveryChallanAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `DeliveryChallanAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/DeliveryChallanAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/deliveryChallanAddress.grpc",
        "x-hellobooks-handler": "getDeliveryChallanAddressById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/deliveryChallanLine": {
      "post": {
        "operationId": "createDeliveryChallanLine",
        "summary": "Create deliveryChallanLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `deliveryChallanLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/deliveryChallanLine.grpc` → `createDeliveryChallanLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "deliveryChallanLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/DeliveryChallanLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `DeliveryChallanLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/DeliveryChallanLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/deliveryChallanLine.grpc",
        "x-hellobooks-handler": "createDeliveryChallanLines",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "BatchNumber": {
                    "type": "string"
                  },
                  "DeliveryChallanId": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DiscountAmount": {
                    "type": "number"
                  },
                  "DiscountD2Amount": {
                    "type": "number"
                  },
                  "DiscountD2Percentage": {
                    "type": "number"
                  },
                  "DiscountD3Amount": {
                    "type": "number"
                  },
                  "DiscountD3Percentage": {
                    "type": "number"
                  },
                  "DiscountPercentage": {
                    "type": "number"
                  },
                  "FEFOLotAssignments": {
                    "type": "object"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IsDiscountBeforeTax": {
                    "type": "boolean"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "ShopifyFulfillmentLineId": {
                    "type": "string"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "UnitRefId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `deliveryChallanLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateDeliveryChallanLine",
        "summary": "Update deliveryChallanLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `deliveryChallanLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/deliveryChallanLine.grpc` → `updateDeliveryChallanLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "deliveryChallanLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/DeliveryChallanLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `DeliveryChallanLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/DeliveryChallanLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/deliveryChallanLine.grpc",
        "x-hellobooks-handler": "updateDeliveryChallanLines",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "BatchNumber": {
                    "type": "string"
                  },
                  "DeliveryChallanId": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DiscountAmount": {
                    "type": "number"
                  },
                  "DiscountD2Amount": {
                    "type": "number"
                  },
                  "DiscountD2Percentage": {
                    "type": "number"
                  },
                  "DiscountD3Amount": {
                    "type": "number"
                  },
                  "DiscountD3Percentage": {
                    "type": "number"
                  },
                  "DiscountPercentage": {
                    "type": "number"
                  },
                  "FEFOLotAssignments": {
                    "type": "object"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IsDiscountBeforeTax": {
                    "type": "boolean"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "ShopifyFulfillmentLineId": {
                    "type": "string"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "UnitRefId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `deliveryChallanLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteDeliveryChallanLine",
        "summary": "Delete deliveryChallanLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `deliveryChallanLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/deliveryChallanLine.grpc` → `deleteDeliveryChallanLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "deliveryChallanLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/DeliveryChallanLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `DeliveryChallanLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/DeliveryChallanLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/deliveryChallanLine.grpc",
        "x-hellobooks-handler": "deleteDeliveryChallanLines",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "BatchNumber": {
                    "type": "string"
                  },
                  "DeliveryChallanId": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DiscountAmount": {
                    "type": "number"
                  },
                  "DiscountD2Amount": {
                    "type": "number"
                  },
                  "DiscountD2Percentage": {
                    "type": "number"
                  },
                  "DiscountD3Amount": {
                    "type": "number"
                  },
                  "DiscountD3Percentage": {
                    "type": "number"
                  },
                  "DiscountPercentage": {
                    "type": "number"
                  },
                  "FEFOLotAssignments": {
                    "type": "object"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IsDiscountBeforeTax": {
                    "type": "boolean"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "ShopifyFulfillmentLineId": {
                    "type": "string"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "UnitRefId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `deliveryChallanLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/deliveryChallanLine/restore": {
      "put": {
        "operationId": "restoreDeliveryChallanLine",
        "summary": "Restore archived deliveryChallanLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `deliveryChallanLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/deliveryChallanLine.grpc` → `restoreDeliveryChallanLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "deliveryChallanLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/DeliveryChallanLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `DeliveryChallanLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/DeliveryChallanLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/deliveryChallanLine.grpc",
        "x-hellobooks-handler": "restoreDeliveryChallanLines",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "BatchNumber": {
                    "type": "string"
                  },
                  "DeliveryChallanId": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DiscountAmount": {
                    "type": "number"
                  },
                  "DiscountD2Amount": {
                    "type": "number"
                  },
                  "DiscountD2Percentage": {
                    "type": "number"
                  },
                  "DiscountD3Amount": {
                    "type": "number"
                  },
                  "DiscountD3Percentage": {
                    "type": "number"
                  },
                  "DiscountPercentage": {
                    "type": "number"
                  },
                  "FEFOLotAssignments": {
                    "type": "object"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IsDiscountBeforeTax": {
                    "type": "boolean"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "ShopifyFulfillmentLineId": {
                    "type": "string"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "UnitRefId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `deliveryChallanLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/deliveryChallanLine/{id}": {
      "get": {
        "operationId": "getDeliveryChallanLine",
        "summary": "Fetch one deliveryChallanLine record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `deliveryChallanLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/deliveryChallanLine.grpc` → `getDeliveryChallanLineById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "deliveryChallanLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/DeliveryChallanLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `DeliveryChallanLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/DeliveryChallanLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/deliveryChallanLine.grpc",
        "x-hellobooks-handler": "getDeliveryChallanLineById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/document-sequence-numbers": {
      "get": {
        "operationId": "getDocumentSequenceNumbers",
        "summary": "Next auto-number per document module",
        "description": "Returns the next sequence number for Invoice, Bill, Quote, SalesOrder and the other numbered modules. Call this BEFORE a create: the internal controllers reject an invoice with no InvoiceNumber. Declared field-contract gap.\n\nDECLARED FIELD-CONTRACT GAP: this route is listed in `UNCONTRACTED_ROUTE_PREFIXES` in `middlewares/publicApiSerialize.middleware.js`. The response field allowlist does not apply to it; only the deny-key floor does. It is named here rather than omitted.",
        "tags": [
          "documents"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Response shape is not published for this route. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
                  "x-hellobooks-field-contract": "unpublished"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "hand-written",
        "x-hellobooks-field-contract": "declared-gap",
        "x-hellobooks-tenant-guard": true,
        "x-hellobooks-required-scopes": [
          "accounting:read"
        ],
        "x-hellobooks-scope-grain": "granular",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ]
      }
    },
    "/orgs/{orgId}/entities/{entityId}/employee": {
      "get": {
        "operationId": "listEmployee",
        "summary": "List employee records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `employee` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/employee.grpc` → `getEmployees`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"payroll:read\")`.",
        "tags": [
          "employee"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "payroll:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Employee"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `Employee` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/Employee"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/employee.grpc",
        "x-hellobooks-handler": "getEmployees",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "payroll:read"
        ],
        "x-hellobooks-scope-domain": "payroll"
      },
      "post": {
        "operationId": "createEmployee",
        "summary": "Create employee record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `employee` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/employee.grpc` → `createEmployees`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"payroll:write\")`.",
        "tags": [
          "employee"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "payroll:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Employee"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Employee` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Employee"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/employee.grpc",
        "x-hellobooks-handler": "createEmployees",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "payroll:write"
        ],
        "x-hellobooks-scope-domain": "payroll",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AdvanceAccountId": {
                    "type": "string"
                  },
                  "ArchivedAt": {
                    "type": "string"
                  },
                  "BankDetails": {
                    "type": "object"
                  },
                  "BaseSalary": {
                    "type": "number"
                  },
                  "ContactDetails": {
                    "type": "object"
                  },
                  "CreatedById": {
                    "type": "string"
                  },
                  "DepartmentId": {
                    "type": "string"
                  },
                  "DesignationId": {
                    "type": "string"
                  },
                  "DisplayName": {
                    "type": "string"
                  },
                  "EmployeeStatus": {
                    "type": "string"
                  },
                  "EmploymentType": {
                    "type": "string"
                  },
                  "ExpenseLimit": {
                    "type": "number"
                  },
                  "FirstName": {
                    "type": "string"
                  },
                  "GustoCompanyId": {
                    "type": "string"
                  },
                  "GustoEmployeeId": {
                    "type": "string"
                  },
                  "GustoLinkedAt": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsExcludedEmployee": {
                    "type": "boolean"
                  },
                  "IsPayrollEnabled": {
                    "type": "boolean"
                  },
                  "IsPersonWithDisability": {
                    "type": "boolean"
                  },
                  "IsReimbursementEligible": {
                    "type": "boolean"
                  },
                  "JoiningDate": {
                    "type": "string"
                  },
                  "LastName": {
                    "type": "string"
                  },
                  "MiddleName": {
                    "type": "string"
                  },
                  "PayFrequency": {
                    "type": "string"
                  },
                  "PayrollExpenseAccountId": {
                    "type": "string"
                  },
                  "PayrollPayableAccountId": {
                    "type": "string"
                  },
                  "PersonalNote": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "ReimbursementAccountId": {
                    "type": "string"
                  },
                  "SalaryCurrency": {
                    "type": "string"
                  },
                  "TaxDetails": {
                    "type": "object"
                  },
                  "TerminationDate": {
                    "type": "string"
                  },
                  "UpdatedById": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `employee`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateEmployee",
        "summary": "Update employee record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `employee` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/employee.grpc` → `updateEmployees`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"payroll:write\")`.",
        "tags": [
          "employee"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "payroll:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Employee"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Employee` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Employee"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/employee.grpc",
        "x-hellobooks-handler": "updateEmployees",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "payroll:write"
        ],
        "x-hellobooks-scope-domain": "payroll",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AdvanceAccountId": {
                    "type": "string"
                  },
                  "ArchivedAt": {
                    "type": "string"
                  },
                  "BankDetails": {
                    "type": "object"
                  },
                  "BaseSalary": {
                    "type": "number"
                  },
                  "ContactDetails": {
                    "type": "object"
                  },
                  "CreatedById": {
                    "type": "string"
                  },
                  "DepartmentId": {
                    "type": "string"
                  },
                  "DesignationId": {
                    "type": "string"
                  },
                  "DisplayName": {
                    "type": "string"
                  },
                  "EmployeeStatus": {
                    "type": "string"
                  },
                  "EmploymentType": {
                    "type": "string"
                  },
                  "ExpenseLimit": {
                    "type": "number"
                  },
                  "FirstName": {
                    "type": "string"
                  },
                  "GustoCompanyId": {
                    "type": "string"
                  },
                  "GustoEmployeeId": {
                    "type": "string"
                  },
                  "GustoLinkedAt": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsExcludedEmployee": {
                    "type": "boolean"
                  },
                  "IsPayrollEnabled": {
                    "type": "boolean"
                  },
                  "IsPersonWithDisability": {
                    "type": "boolean"
                  },
                  "IsReimbursementEligible": {
                    "type": "boolean"
                  },
                  "JoiningDate": {
                    "type": "string"
                  },
                  "LastName": {
                    "type": "string"
                  },
                  "MiddleName": {
                    "type": "string"
                  },
                  "PayFrequency": {
                    "type": "string"
                  },
                  "PayrollExpenseAccountId": {
                    "type": "string"
                  },
                  "PayrollPayableAccountId": {
                    "type": "string"
                  },
                  "PersonalNote": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "ReimbursementAccountId": {
                    "type": "string"
                  },
                  "SalaryCurrency": {
                    "type": "string"
                  },
                  "TaxDetails": {
                    "type": "object"
                  },
                  "TerminationDate": {
                    "type": "string"
                  },
                  "UpdatedById": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `employee`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteEmployee",
        "summary": "Delete employee record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `employee` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/employee.grpc` → `deleteEmployees`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"payroll:write\")`.",
        "tags": [
          "employee"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "payroll:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Employee"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Employee` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Employee"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/employee.grpc",
        "x-hellobooks-handler": "deleteEmployees",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "payroll:write"
        ],
        "x-hellobooks-scope-domain": "payroll",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AdvanceAccountId": {
                    "type": "string"
                  },
                  "ArchivedAt": {
                    "type": "string"
                  },
                  "BankDetails": {
                    "type": "object"
                  },
                  "BaseSalary": {
                    "type": "number"
                  },
                  "ContactDetails": {
                    "type": "object"
                  },
                  "CreatedById": {
                    "type": "string"
                  },
                  "DepartmentId": {
                    "type": "string"
                  },
                  "DesignationId": {
                    "type": "string"
                  },
                  "DisplayName": {
                    "type": "string"
                  },
                  "EmployeeStatus": {
                    "type": "string"
                  },
                  "EmploymentType": {
                    "type": "string"
                  },
                  "ExpenseLimit": {
                    "type": "number"
                  },
                  "FirstName": {
                    "type": "string"
                  },
                  "GustoCompanyId": {
                    "type": "string"
                  },
                  "GustoEmployeeId": {
                    "type": "string"
                  },
                  "GustoLinkedAt": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsExcludedEmployee": {
                    "type": "boolean"
                  },
                  "IsPayrollEnabled": {
                    "type": "boolean"
                  },
                  "IsPersonWithDisability": {
                    "type": "boolean"
                  },
                  "IsReimbursementEligible": {
                    "type": "boolean"
                  },
                  "JoiningDate": {
                    "type": "string"
                  },
                  "LastName": {
                    "type": "string"
                  },
                  "MiddleName": {
                    "type": "string"
                  },
                  "PayFrequency": {
                    "type": "string"
                  },
                  "PayrollExpenseAccountId": {
                    "type": "string"
                  },
                  "PayrollPayableAccountId": {
                    "type": "string"
                  },
                  "PersonalNote": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "ReimbursementAccountId": {
                    "type": "string"
                  },
                  "SalaryCurrency": {
                    "type": "string"
                  },
                  "TaxDetails": {
                    "type": "object"
                  },
                  "TerminationDate": {
                    "type": "string"
                  },
                  "UpdatedById": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `employee`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/employee/restore": {
      "put": {
        "operationId": "restoreEmployee",
        "summary": "Restore archived employee record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `employee` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/employee.grpc` → `restoreEmployees`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"payroll:write\")`.",
        "tags": [
          "employee"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "payroll:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Employee"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Employee` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Employee"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/employee.grpc",
        "x-hellobooks-handler": "restoreEmployees",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "payroll:write"
        ],
        "x-hellobooks-scope-domain": "payroll",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AdvanceAccountId": {
                    "type": "string"
                  },
                  "ArchivedAt": {
                    "type": "string"
                  },
                  "BankDetails": {
                    "type": "object"
                  },
                  "BaseSalary": {
                    "type": "number"
                  },
                  "ContactDetails": {
                    "type": "object"
                  },
                  "CreatedById": {
                    "type": "string"
                  },
                  "DepartmentId": {
                    "type": "string"
                  },
                  "DesignationId": {
                    "type": "string"
                  },
                  "DisplayName": {
                    "type": "string"
                  },
                  "EmployeeStatus": {
                    "type": "string"
                  },
                  "EmploymentType": {
                    "type": "string"
                  },
                  "ExpenseLimit": {
                    "type": "number"
                  },
                  "FirstName": {
                    "type": "string"
                  },
                  "GustoCompanyId": {
                    "type": "string"
                  },
                  "GustoEmployeeId": {
                    "type": "string"
                  },
                  "GustoLinkedAt": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsExcludedEmployee": {
                    "type": "boolean"
                  },
                  "IsPayrollEnabled": {
                    "type": "boolean"
                  },
                  "IsPersonWithDisability": {
                    "type": "boolean"
                  },
                  "IsReimbursementEligible": {
                    "type": "boolean"
                  },
                  "JoiningDate": {
                    "type": "string"
                  },
                  "LastName": {
                    "type": "string"
                  },
                  "MiddleName": {
                    "type": "string"
                  },
                  "PayFrequency": {
                    "type": "string"
                  },
                  "PayrollExpenseAccountId": {
                    "type": "string"
                  },
                  "PayrollPayableAccountId": {
                    "type": "string"
                  },
                  "PersonalNote": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "ReimbursementAccountId": {
                    "type": "string"
                  },
                  "SalaryCurrency": {
                    "type": "string"
                  },
                  "TaxDetails": {
                    "type": "object"
                  },
                  "TerminationDate": {
                    "type": "string"
                  },
                  "UpdatedById": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `employee`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/employee/{id}": {
      "get": {
        "operationId": "getEmployee",
        "summary": "Fetch one employee record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `employee` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/employee.grpc` → `getEmployeeById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"payroll:read\")`.",
        "tags": [
          "employee"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "payroll:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Employee"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Employee` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Employee"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/employee.grpc",
        "x-hellobooks-handler": "getEmployeeById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "payroll:read"
        ],
        "x-hellobooks-scope-domain": "payroll"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/employeeAddress": {
      "get": {
        "operationId": "listEmployeeAddress",
        "summary": "List employeeAddress records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `employeeAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/employeeAddress.grpc` → `getEmployeeAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"payroll:read\")`.",
        "tags": [
          "employeeAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "payroll:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/EmployeeAddress"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `EmployeeAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/EmployeeAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/employeeAddress.grpc",
        "x-hellobooks-handler": "getEmployeeAddresses",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "payroll:read"
        ],
        "x-hellobooks-scope-domain": "payroll"
      },
      "post": {
        "operationId": "createEmployeeAddress",
        "summary": "Create employeeAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `employeeAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/employeeAddress.grpc` → `createEmployeeAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"payroll:write\")`.",
        "tags": [
          "employeeAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "payroll:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/EmployeeAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `EmployeeAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/EmployeeAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/employeeAddress.grpc",
        "x-hellobooks-handler": "createEmployeeAddresses",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "payroll:write"
        ],
        "x-hellobooks-scope-domain": "payroll",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AddressType": {
                    "type": "string"
                  },
                  "City": {
                    "type": "string"
                  },
                  "Country": {
                    "type": "string"
                  },
                  "EmployeeId": {
                    "type": "string"
                  },
                  "LineOne": {
                    "type": "string"
                  },
                  "LineTwo": {
                    "type": "string"
                  },
                  "Province": {
                    "type": "string"
                  },
                  "ZipCode": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `employeeAddress`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateEmployeeAddress",
        "summary": "Update employeeAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `employeeAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/employeeAddress.grpc` → `updateEmployeeAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"payroll:write\")`.",
        "tags": [
          "employeeAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "payroll:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/EmployeeAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `EmployeeAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/EmployeeAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/employeeAddress.grpc",
        "x-hellobooks-handler": "updateEmployeeAddresses",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "payroll:write"
        ],
        "x-hellobooks-scope-domain": "payroll",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AddressType": {
                    "type": "string"
                  },
                  "City": {
                    "type": "string"
                  },
                  "Country": {
                    "type": "string"
                  },
                  "EmployeeId": {
                    "type": "string"
                  },
                  "LineOne": {
                    "type": "string"
                  },
                  "LineTwo": {
                    "type": "string"
                  },
                  "Province": {
                    "type": "string"
                  },
                  "ZipCode": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `employeeAddress`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteEmployeeAddress",
        "summary": "Delete employeeAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `employeeAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/employeeAddress.grpc` → `deleteEmployeeAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"payroll:write\")`.",
        "tags": [
          "employeeAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "payroll:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/EmployeeAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `EmployeeAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/EmployeeAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/employeeAddress.grpc",
        "x-hellobooks-handler": "deleteEmployeeAddresses",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "payroll:write"
        ],
        "x-hellobooks-scope-domain": "payroll",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AddressType": {
                    "type": "string"
                  },
                  "City": {
                    "type": "string"
                  },
                  "Country": {
                    "type": "string"
                  },
                  "EmployeeId": {
                    "type": "string"
                  },
                  "LineOne": {
                    "type": "string"
                  },
                  "LineTwo": {
                    "type": "string"
                  },
                  "Province": {
                    "type": "string"
                  },
                  "ZipCode": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `employeeAddress`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/employeeAddress/restore": {
      "put": {
        "operationId": "restoreEmployeeAddress",
        "summary": "Restore archived employeeAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `employeeAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/employeeAddress.grpc` → `restoreEmployeeAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"payroll:write\")`.",
        "tags": [
          "employeeAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "payroll:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/EmployeeAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `EmployeeAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/EmployeeAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/employeeAddress.grpc",
        "x-hellobooks-handler": "restoreEmployeeAddresses",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "payroll:write"
        ],
        "x-hellobooks-scope-domain": "payroll",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AddressType": {
                    "type": "string"
                  },
                  "City": {
                    "type": "string"
                  },
                  "Country": {
                    "type": "string"
                  },
                  "EmployeeId": {
                    "type": "string"
                  },
                  "LineOne": {
                    "type": "string"
                  },
                  "LineTwo": {
                    "type": "string"
                  },
                  "Province": {
                    "type": "string"
                  },
                  "ZipCode": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `employeeAddress`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/employeeAddress/{id}": {
      "get": {
        "operationId": "getEmployeeAddress",
        "summary": "Fetch one employeeAddress record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `employeeAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/employeeAddress.grpc` → `getEmployeeAddressById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"payroll:read\")`.",
        "tags": [
          "employeeAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "payroll:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/EmployeeAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `EmployeeAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/EmployeeAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/employeeAddress.grpc",
        "x-hellobooks-handler": "getEmployeeAddressById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "payroll:read"
        ],
        "x-hellobooks-scope-domain": "payroll"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/employeeCreditCard": {
      "post": {
        "operationId": "createEmployeeCreditCard",
        "summary": "Create employeeCreditCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `employeeCreditCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/employeeCreditCardDetail.grpc` → `createEmployeeCreditCardDetails`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "employeeCreditCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/EmployeeCreditCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `EmployeeCreditCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/EmployeeCreditCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/employeeCreditCardDetail.grpc",
        "x-hellobooks-handler": "createEmployeeCreditCardDetails",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `create` on `employeeCreditCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"EmployeeCreditCardDetails\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "EmployeeCreditCardDetails"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateEmployeeCreditCard",
        "summary": "Update employeeCreditCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `employeeCreditCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/employeeCreditCardDetail.grpc` → `updateEmployeeCreditCardDetails`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "employeeCreditCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/EmployeeCreditCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `EmployeeCreditCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/EmployeeCreditCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/employeeCreditCardDetail.grpc",
        "x-hellobooks-handler": "updateEmployeeCreditCardDetails",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `update` on `employeeCreditCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"EmployeeCreditCardDetails\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "EmployeeCreditCardDetails"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteEmployeeCreditCard",
        "summary": "Delete employeeCreditCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `employeeCreditCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/employeeCreditCardDetail.grpc` → `deleteEmployeeCreditCardDetails`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "employeeCreditCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/EmployeeCreditCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `EmployeeCreditCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/EmployeeCreditCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/employeeCreditCardDetail.grpc",
        "x-hellobooks-handler": "deleteEmployeeCreditCardDetails",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `del` on `employeeCreditCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"EmployeeCreditCardDetails\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "EmployeeCreditCardDetails"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/employeeCreditCard/restore": {
      "put": {
        "operationId": "restoreEmployeeCreditCard",
        "summary": "Restore archived employeeCreditCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `employeeCreditCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/employeeCreditCardDetail.grpc` → `restoreEmployeeCreditCardDetails`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "employeeCreditCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/EmployeeCreditCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `EmployeeCreditCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/EmployeeCreditCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/employeeCreditCardDetail.grpc",
        "x-hellobooks-handler": "restoreEmployeeCreditCardDetails",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `restore` on `employeeCreditCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"EmployeeCreditCardDetails\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "EmployeeCreditCardDetails"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/employeeCreditCard/{id}": {
      "get": {
        "operationId": "getEmployeeCreditCard",
        "summary": "Fetch one employeeCreditCard record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `employeeCreditCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/employeeCreditCardDetail.grpc` → `getEmployeeCreditCardDetailById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:read\")`.",
        "tags": [
          "employeeCreditCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/EmployeeCreditCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `EmployeeCreditCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/EmployeeCreditCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/employeeCreditCardDetail.grpc",
        "x-hellobooks-handler": "getEmployeeCreditCardDetailById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:read"
        ],
        "x-hellobooks-scope-domain": "paymentmethods"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/employeeDebitCard": {
      "post": {
        "operationId": "createEmployeeDebitCard",
        "summary": "Create employeeDebitCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `employeeDebitCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/employeeDebitCardDetail.grpc` → `createEmployeeDebitCardDetails`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "employeeDebitCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/EmployeeDebitCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `EmployeeDebitCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/EmployeeDebitCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/employeeDebitCardDetail.grpc",
        "x-hellobooks-handler": "createEmployeeDebitCardDetails",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `create` on `employeeDebitCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"EmployeeDebitCardDetails\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "EmployeeDebitCardDetails"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateEmployeeDebitCard",
        "summary": "Update employeeDebitCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `employeeDebitCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/employeeDebitCardDetail.grpc` → `updateEmployeeDebitCardDetails`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "employeeDebitCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/EmployeeDebitCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `EmployeeDebitCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/EmployeeDebitCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/employeeDebitCardDetail.grpc",
        "x-hellobooks-handler": "updateEmployeeDebitCardDetails",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `update` on `employeeDebitCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"EmployeeDebitCardDetails\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "EmployeeDebitCardDetails"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteEmployeeDebitCard",
        "summary": "Delete employeeDebitCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `employeeDebitCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/employeeDebitCardDetail.grpc` → `deleteEmployeeDebitCardDetails`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "employeeDebitCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/EmployeeDebitCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `EmployeeDebitCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/EmployeeDebitCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/employeeDebitCardDetail.grpc",
        "x-hellobooks-handler": "deleteEmployeeDebitCardDetails",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `del` on `employeeDebitCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"EmployeeDebitCardDetails\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "EmployeeDebitCardDetails"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/employeeDebitCard/restore": {
      "put": {
        "operationId": "restoreEmployeeDebitCard",
        "summary": "Restore archived employeeDebitCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `employeeDebitCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/employeeDebitCardDetail.grpc` → `restoreEmployeeDebitCardDetails`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "employeeDebitCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/EmployeeDebitCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `EmployeeDebitCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/EmployeeDebitCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/employeeDebitCardDetail.grpc",
        "x-hellobooks-handler": "restoreEmployeeDebitCardDetails",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `restore` on `employeeDebitCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"EmployeeDebitCardDetails\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "EmployeeDebitCardDetails"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/employeeDebitCard/{id}": {
      "get": {
        "operationId": "getEmployeeDebitCard",
        "summary": "Fetch one employeeDebitCard record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `employeeDebitCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/employeeDebitCardDetail.grpc` → `getEmployeeDebitCardDetailById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:read\")`.",
        "tags": [
          "employeeDebitCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/EmployeeDebitCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `EmployeeDebitCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/EmployeeDebitCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/employeeDebitCardDetail.grpc",
        "x-hellobooks-handler": "getEmployeeDebitCardDetailById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:read"
        ],
        "x-hellobooks-scope-domain": "paymentmethods"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/expenseClaim": {
      "get": {
        "operationId": "listExpenseClaim",
        "summary": "List expenseClaim records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `expenseClaim` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/expenseClaim.grpc` → `getExpenseClaims`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "expenseClaim"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/ExpenseClaim"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `ExpenseClaim` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/ExpenseClaim"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/expenseClaim.grpc",
        "x-hellobooks-handler": "getExpenseClaims",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      },
      "post": {
        "operationId": "createExpenseClaim",
        "summary": "Create expenseClaim record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `expenseClaim` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/expenseClaim.grpc` → `createExpenseClaims`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "expenseClaim"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/ExpenseClaim"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `ExpenseClaim` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/ExpenseClaim"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/expenseClaim.grpc",
        "x-hellobooks-handler": "createExpenseClaims",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AppliedWorkflowId": {
                    "type": "string"
                  },
                  "ApprovedAmount": {
                    "type": "number"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedByRefId": {
                    "type": "string"
                  },
                  "ApprovedReceiptCount": {
                    "type": "integer"
                  },
                  "AttachmentsCount": {
                    "type": "integer"
                  },
                  "ClaimName": {
                    "type": "string"
                  },
                  "ClaimNo": {
                    "type": "string"
                  },
                  "ClaimType": {
                    "type": "string"
                  },
                  "CompanyMoneyAmount": {
                    "type": "number"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DirectExpenseAmount": {
                    "type": "number"
                  },
                  "EmployeeRefId": {
                    "type": "string"
                  },
                  "EndDate": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "OriginalTotals": {
                    "type": "object"
                  },
                  "PaidAmount": {
                    "type": "number"
                  },
                  "PaidAt": {
                    "type": "string"
                  },
                  "PaidByRefId": {
                    "type": "string"
                  },
                  "PaymentMethod": {
                    "type": "string"
                  },
                  "PendingReceiptCount": {
                    "type": "integer"
                  },
                  "PersonalMoneyAmount": {
                    "type": "number"
                  },
                  "PublishedAt": {
                    "type": "string"
                  },
                  "ReimbursableAmount": {
                    "type": "number"
                  },
                  "RejectedAmount": {
                    "type": "number"
                  },
                  "RejectedReceiptCount": {
                    "type": "integer"
                  },
                  "StartDate": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "Subtotal": {
                    "type": "number"
                  },
                  "TotalAmount": {
                    "type": "number"
                  },
                  "TotalCGST": {
                    "type": "number"
                  },
                  "TotalCess": {
                    "type": "number"
                  },
                  "TotalCessNonAdvalorem": {
                    "type": "number"
                  },
                  "TotalDiscount": {
                    "type": "number"
                  },
                  "TotalIGST": {
                    "type": "number"
                  },
                  "TotalSGST": {
                    "type": "number"
                  },
                  "TotalTax": {
                    "type": "number"
                  },
                  "TotalUTGST": {
                    "type": "number"
                  },
                  "VoidReason": {
                    "type": "string"
                  },
                  "VoidedAt": {
                    "type": "string"
                  },
                  "VoidedBy": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `expenseClaim`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateExpenseClaim",
        "summary": "Update expenseClaim record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `expenseClaim` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/expenseClaim.grpc` → `updateExpenseClaims`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "expenseClaim"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/ExpenseClaim"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `ExpenseClaim` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/ExpenseClaim"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/expenseClaim.grpc",
        "x-hellobooks-handler": "updateExpenseClaims",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AppliedWorkflowId": {
                    "type": "string"
                  },
                  "ApprovedAmount": {
                    "type": "number"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedByRefId": {
                    "type": "string"
                  },
                  "ApprovedReceiptCount": {
                    "type": "integer"
                  },
                  "AttachmentsCount": {
                    "type": "integer"
                  },
                  "ClaimName": {
                    "type": "string"
                  },
                  "ClaimNo": {
                    "type": "string"
                  },
                  "ClaimType": {
                    "type": "string"
                  },
                  "CompanyMoneyAmount": {
                    "type": "number"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DirectExpenseAmount": {
                    "type": "number"
                  },
                  "EmployeeRefId": {
                    "type": "string"
                  },
                  "EndDate": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "OriginalTotals": {
                    "type": "object"
                  },
                  "PaidAmount": {
                    "type": "number"
                  },
                  "PaidAt": {
                    "type": "string"
                  },
                  "PaidByRefId": {
                    "type": "string"
                  },
                  "PaymentMethod": {
                    "type": "string"
                  },
                  "PendingReceiptCount": {
                    "type": "integer"
                  },
                  "PersonalMoneyAmount": {
                    "type": "number"
                  },
                  "PublishedAt": {
                    "type": "string"
                  },
                  "ReimbursableAmount": {
                    "type": "number"
                  },
                  "RejectedAmount": {
                    "type": "number"
                  },
                  "RejectedReceiptCount": {
                    "type": "integer"
                  },
                  "StartDate": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "Subtotal": {
                    "type": "number"
                  },
                  "TotalAmount": {
                    "type": "number"
                  },
                  "TotalCGST": {
                    "type": "number"
                  },
                  "TotalCess": {
                    "type": "number"
                  },
                  "TotalCessNonAdvalorem": {
                    "type": "number"
                  },
                  "TotalDiscount": {
                    "type": "number"
                  },
                  "TotalIGST": {
                    "type": "number"
                  },
                  "TotalSGST": {
                    "type": "number"
                  },
                  "TotalTax": {
                    "type": "number"
                  },
                  "TotalUTGST": {
                    "type": "number"
                  },
                  "VoidReason": {
                    "type": "string"
                  },
                  "VoidedAt": {
                    "type": "string"
                  },
                  "VoidedBy": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `expenseClaim`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteExpenseClaim",
        "summary": "Delete expenseClaim record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `expenseClaim` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/expenseClaim.grpc` → `deleteExpenseClaims`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "expenseClaim"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/ExpenseClaim"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `ExpenseClaim` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/ExpenseClaim"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/expenseClaim.grpc",
        "x-hellobooks-handler": "deleteExpenseClaims",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AppliedWorkflowId": {
                    "type": "string"
                  },
                  "ApprovedAmount": {
                    "type": "number"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedByRefId": {
                    "type": "string"
                  },
                  "ApprovedReceiptCount": {
                    "type": "integer"
                  },
                  "AttachmentsCount": {
                    "type": "integer"
                  },
                  "ClaimName": {
                    "type": "string"
                  },
                  "ClaimNo": {
                    "type": "string"
                  },
                  "ClaimType": {
                    "type": "string"
                  },
                  "CompanyMoneyAmount": {
                    "type": "number"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DirectExpenseAmount": {
                    "type": "number"
                  },
                  "EmployeeRefId": {
                    "type": "string"
                  },
                  "EndDate": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "OriginalTotals": {
                    "type": "object"
                  },
                  "PaidAmount": {
                    "type": "number"
                  },
                  "PaidAt": {
                    "type": "string"
                  },
                  "PaidByRefId": {
                    "type": "string"
                  },
                  "PaymentMethod": {
                    "type": "string"
                  },
                  "PendingReceiptCount": {
                    "type": "integer"
                  },
                  "PersonalMoneyAmount": {
                    "type": "number"
                  },
                  "PublishedAt": {
                    "type": "string"
                  },
                  "ReimbursableAmount": {
                    "type": "number"
                  },
                  "RejectedAmount": {
                    "type": "number"
                  },
                  "RejectedReceiptCount": {
                    "type": "integer"
                  },
                  "StartDate": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "Subtotal": {
                    "type": "number"
                  },
                  "TotalAmount": {
                    "type": "number"
                  },
                  "TotalCGST": {
                    "type": "number"
                  },
                  "TotalCess": {
                    "type": "number"
                  },
                  "TotalCessNonAdvalorem": {
                    "type": "number"
                  },
                  "TotalDiscount": {
                    "type": "number"
                  },
                  "TotalIGST": {
                    "type": "number"
                  },
                  "TotalSGST": {
                    "type": "number"
                  },
                  "TotalTax": {
                    "type": "number"
                  },
                  "TotalUTGST": {
                    "type": "number"
                  },
                  "VoidReason": {
                    "type": "string"
                  },
                  "VoidedAt": {
                    "type": "string"
                  },
                  "VoidedBy": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `expenseClaim`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/expenseClaim/restore": {
      "put": {
        "operationId": "restoreExpenseClaim",
        "summary": "Restore archived expenseClaim record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `expenseClaim` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/expenseClaim.grpc` → `restoreExpenseClaims`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "expenseClaim"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/ExpenseClaim"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `ExpenseClaim` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/ExpenseClaim"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/expenseClaim.grpc",
        "x-hellobooks-handler": "restoreExpenseClaims",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AppliedWorkflowId": {
                    "type": "string"
                  },
                  "ApprovedAmount": {
                    "type": "number"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedByRefId": {
                    "type": "string"
                  },
                  "ApprovedReceiptCount": {
                    "type": "integer"
                  },
                  "AttachmentsCount": {
                    "type": "integer"
                  },
                  "ClaimName": {
                    "type": "string"
                  },
                  "ClaimNo": {
                    "type": "string"
                  },
                  "ClaimType": {
                    "type": "string"
                  },
                  "CompanyMoneyAmount": {
                    "type": "number"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DirectExpenseAmount": {
                    "type": "number"
                  },
                  "EmployeeRefId": {
                    "type": "string"
                  },
                  "EndDate": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "OriginalTotals": {
                    "type": "object"
                  },
                  "PaidAmount": {
                    "type": "number"
                  },
                  "PaidAt": {
                    "type": "string"
                  },
                  "PaidByRefId": {
                    "type": "string"
                  },
                  "PaymentMethod": {
                    "type": "string"
                  },
                  "PendingReceiptCount": {
                    "type": "integer"
                  },
                  "PersonalMoneyAmount": {
                    "type": "number"
                  },
                  "PublishedAt": {
                    "type": "string"
                  },
                  "ReimbursableAmount": {
                    "type": "number"
                  },
                  "RejectedAmount": {
                    "type": "number"
                  },
                  "RejectedReceiptCount": {
                    "type": "integer"
                  },
                  "StartDate": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "Subtotal": {
                    "type": "number"
                  },
                  "TotalAmount": {
                    "type": "number"
                  },
                  "TotalCGST": {
                    "type": "number"
                  },
                  "TotalCess": {
                    "type": "number"
                  },
                  "TotalCessNonAdvalorem": {
                    "type": "number"
                  },
                  "TotalDiscount": {
                    "type": "number"
                  },
                  "TotalIGST": {
                    "type": "number"
                  },
                  "TotalSGST": {
                    "type": "number"
                  },
                  "TotalTax": {
                    "type": "number"
                  },
                  "TotalUTGST": {
                    "type": "number"
                  },
                  "VoidReason": {
                    "type": "string"
                  },
                  "VoidedAt": {
                    "type": "string"
                  },
                  "VoidedBy": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `expenseClaim`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/expenseReceipt": {
      "get": {
        "operationId": "listExpenseReceipt",
        "summary": "List expenseReceipt records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `expenseReceipt` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/expenseReceipt.grpc` → `getExpenseReceipts`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "expenseReceipt"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/ExpenseReceipt"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `ExpenseReceipt` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/ExpenseReceipt"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/expenseReceipt.grpc",
        "x-hellobooks-handler": "getExpenseReceipts",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      },
      "put": {
        "operationId": "updateExpenseReceipt",
        "summary": "Update expenseReceipt record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `expenseReceipt` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/expenseReceipt.grpc` → `updateReceipts`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "expenseReceipt"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/ExpenseReceipt"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `ExpenseReceipt` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/ExpenseReceipt"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/expenseReceipt.grpc",
        "x-hellobooks-handler": "updateReceipts",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "ApprovalStatus": {
                    "type": "string"
                  },
                  "ApprovedAmount": {
                    "type": "number"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "AttachmentUrls": {
                    "type": "object"
                  },
                  "CGSTAmount": {
                    "type": "number"
                  },
                  "CGSTRate": {
                    "type": "number"
                  },
                  "Category": {
                    "type": "string"
                  },
                  "CessAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremAmount": {
                    "type": "number"
                  },
                  "ClaimId": {
                    "type": "string"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "CurrencyRefId": {
                    "type": "string"
                  },
                  "CustomerRefId": {
                    "type": "string"
                  },
                  "CustomerType": {
                    "type": "string"
                  },
                  "Date": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DetailsVersion": {
                    "type": "integer"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpenseDetails": {
                    "type": "object"
                  },
                  "ExpenseNumber": {
                    "type": "string"
                  },
                  "ExpenseType": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "GSTRate": {
                    "type": "number"
                  },
                  "HSNCode": {
                    "type": "string"
                  },
                  "IGSTAmount": {
                    "type": "number"
                  },
                  "IGSTRate": {
                    "type": "number"
                  },
                  "InvoiceRefId": {
                    "type": "string"
                  },
                  "InvoicedOn": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsClaimed": {
                    "type": "boolean"
                  },
                  "IsITCEligible": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "Label": {
                    "type": "string"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PaidAt": {
                    "type": "string"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PaymentAccountRef": {
                    "type": "string"
                  },
                  "PaymentType": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "RejectedAt": {
                    "type": "string"
                  },
                  "RejectionReason": {
                    "type": "string"
                  },
                  "SGSTAmount": {
                    "type": "number"
                  },
                  "SGSTRate": {
                    "type": "number"
                  },
                  "Source": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SubmittedBy": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxClassification": {
                    "type": "string"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "UTGSTAmount": {
                    "type": "number"
                  },
                  "UTGSTRate": {
                    "type": "number"
                  },
                  "UnitAmount": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `expenseReceipt`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/expenseReceipt/restore": {
      "put": {
        "operationId": "restoreExpenseReceipt",
        "summary": "Restore archived expenseReceipt record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `expenseReceipt` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/expenseReceipt.grpc` → `restoreReceipts`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "expenseReceipt"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/ExpenseReceipt"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `ExpenseReceipt` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/ExpenseReceipt"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/expenseReceipt.grpc",
        "x-hellobooks-handler": "restoreReceipts",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "ApprovalStatus": {
                    "type": "string"
                  },
                  "ApprovedAmount": {
                    "type": "number"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "AttachmentUrls": {
                    "type": "object"
                  },
                  "CGSTAmount": {
                    "type": "number"
                  },
                  "CGSTRate": {
                    "type": "number"
                  },
                  "Category": {
                    "type": "string"
                  },
                  "CessAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremAmount": {
                    "type": "number"
                  },
                  "ClaimId": {
                    "type": "string"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "CurrencyRefId": {
                    "type": "string"
                  },
                  "CustomerRefId": {
                    "type": "string"
                  },
                  "CustomerType": {
                    "type": "string"
                  },
                  "Date": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DetailsVersion": {
                    "type": "integer"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpenseDetails": {
                    "type": "object"
                  },
                  "ExpenseNumber": {
                    "type": "string"
                  },
                  "ExpenseType": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "GSTRate": {
                    "type": "number"
                  },
                  "HSNCode": {
                    "type": "string"
                  },
                  "IGSTAmount": {
                    "type": "number"
                  },
                  "IGSTRate": {
                    "type": "number"
                  },
                  "InvoiceRefId": {
                    "type": "string"
                  },
                  "InvoicedOn": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsClaimed": {
                    "type": "boolean"
                  },
                  "IsITCEligible": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "Label": {
                    "type": "string"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PaidAt": {
                    "type": "string"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PaymentAccountRef": {
                    "type": "string"
                  },
                  "PaymentType": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "RejectedAt": {
                    "type": "string"
                  },
                  "RejectionReason": {
                    "type": "string"
                  },
                  "SGSTAmount": {
                    "type": "number"
                  },
                  "SGSTRate": {
                    "type": "number"
                  },
                  "Source": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SubmittedBy": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxClassification": {
                    "type": "string"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "UTGSTAmount": {
                    "type": "number"
                  },
                  "UTGSTRate": {
                    "type": "number"
                  },
                  "UnitAmount": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `expenseReceipt`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/fixedAsset": {
      "get": {
        "operationId": "listFixedAsset",
        "summary": "List fixedAsset records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `fixedAsset` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/fixedAssets.grpc` → `getFixedAssets`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:read\")`.",
        "tags": [
          "fixedAsset"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/FixedAsset"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `FixedAsset` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/FixedAsset"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/fixedAssets.grpc",
        "x-hellobooks-handler": "getFixedAssets",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:read"
        ],
        "x-hellobooks-scope-domain": "fixedassets"
      },
      "post": {
        "operationId": "createFixedAsset",
        "summary": "Create fixedAsset record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `fixedAsset` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/fixedAssets.grpc` → `createFixedAssets`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:write\")`.",
        "tags": [
          "fixedAsset"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/FixedAsset"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `FixedAsset` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/FixedAsset"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/fixedAssets.grpc",
        "x-hellobooks-handler": "createFixedAssets",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:write"
        ],
        "x-hellobooks-scope-domain": "fixedassets",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AssetAccountId": {
                    "type": "string"
                  },
                  "AssetCode": {
                    "type": "string"
                  },
                  "AssetGroupId": {
                    "type": "string"
                  },
                  "BarcodeId": {
                    "type": "string"
                  },
                  "BookAccumulatedDepreciation": {
                    "type": "number"
                  },
                  "BookDepreciationFrequency": {
                    "type": "string"
                  },
                  "BookDepreciationMethod": {
                    "type": "string"
                  },
                  "BookNetValue": {
                    "type": "number"
                  },
                  "CapitalizationDate": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "DepreciationStartDate": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DisposalDate": {
                    "type": "string"
                  },
                  "InsuranceExpiryDate": {
                    "type": "string"
                  },
                  "InsurancePolicyNumber": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LastDepreciationDate": {
                    "type": "string"
                  },
                  "LastDepreciationPeriod": {
                    "type": "string"
                  },
                  "LastDepreciationStatus": {
                    "type": "string"
                  },
                  "LastPostedPeriod": {
                    "type": "string"
                  },
                  "LastScannedDate": {
                    "type": "string"
                  },
                  "LocationId": {
                    "type": "string"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "NextDepreciationDue": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PurchaseCost": {
                    "type": "number"
                  },
                  "PurchaseDate": {
                    "type": "string"
                  },
                  "QRCodeId": {
                    "type": "string"
                  },
                  "ResidualValue": {
                    "type": "number"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TaxAccumulatedDepreciation": {
                    "type": "number"
                  },
                  "TaxDepreciationFrequency": {
                    "type": "string"
                  },
                  "TaxDepreciationMethod": {
                    "type": "string"
                  },
                  "TaxNetValue": {
                    "type": "number"
                  },
                  "TotalPeriodsCalculated": {
                    "type": "integer"
                  },
                  "TotalPeriodsPosted": {
                    "type": "integer"
                  },
                  "UpdatedBy": {
                    "type": "string"
                  },
                  "UsefulLifeMonths": {
                    "type": "integer"
                  },
                  "VendorId": {
                    "type": "string"
                  },
                  "WarrantyExpiryDate": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `fixedAsset`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateFixedAsset",
        "summary": "Update fixedAsset record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `fixedAsset` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/fixedAssets.grpc` → `updateFixedAssets`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:write\")`.",
        "tags": [
          "fixedAsset"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/FixedAsset"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `FixedAsset` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/FixedAsset"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/fixedAssets.grpc",
        "x-hellobooks-handler": "updateFixedAssets",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:write"
        ],
        "x-hellobooks-scope-domain": "fixedassets",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AssetAccountId": {
                    "type": "string"
                  },
                  "AssetCode": {
                    "type": "string"
                  },
                  "AssetGroupId": {
                    "type": "string"
                  },
                  "BarcodeId": {
                    "type": "string"
                  },
                  "BookAccumulatedDepreciation": {
                    "type": "number"
                  },
                  "BookDepreciationFrequency": {
                    "type": "string"
                  },
                  "BookDepreciationMethod": {
                    "type": "string"
                  },
                  "BookNetValue": {
                    "type": "number"
                  },
                  "CapitalizationDate": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "DepreciationStartDate": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DisposalDate": {
                    "type": "string"
                  },
                  "InsuranceExpiryDate": {
                    "type": "string"
                  },
                  "InsurancePolicyNumber": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LastDepreciationDate": {
                    "type": "string"
                  },
                  "LastDepreciationPeriod": {
                    "type": "string"
                  },
                  "LastDepreciationStatus": {
                    "type": "string"
                  },
                  "LastPostedPeriod": {
                    "type": "string"
                  },
                  "LastScannedDate": {
                    "type": "string"
                  },
                  "LocationId": {
                    "type": "string"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "NextDepreciationDue": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PurchaseCost": {
                    "type": "number"
                  },
                  "PurchaseDate": {
                    "type": "string"
                  },
                  "QRCodeId": {
                    "type": "string"
                  },
                  "ResidualValue": {
                    "type": "number"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TaxAccumulatedDepreciation": {
                    "type": "number"
                  },
                  "TaxDepreciationFrequency": {
                    "type": "string"
                  },
                  "TaxDepreciationMethod": {
                    "type": "string"
                  },
                  "TaxNetValue": {
                    "type": "number"
                  },
                  "TotalPeriodsCalculated": {
                    "type": "integer"
                  },
                  "TotalPeriodsPosted": {
                    "type": "integer"
                  },
                  "UpdatedBy": {
                    "type": "string"
                  },
                  "UsefulLifeMonths": {
                    "type": "integer"
                  },
                  "VendorId": {
                    "type": "string"
                  },
                  "WarrantyExpiryDate": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `fixedAsset`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteFixedAsset",
        "summary": "Delete fixedAsset record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `fixedAsset` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/fixedAssets.grpc` → `deleteFixedAssets`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:write\")`.",
        "tags": [
          "fixedAsset"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/FixedAsset"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `FixedAsset` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/FixedAsset"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/fixedAssets.grpc",
        "x-hellobooks-handler": "deleteFixedAssets",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:write"
        ],
        "x-hellobooks-scope-domain": "fixedassets",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AssetAccountId": {
                    "type": "string"
                  },
                  "AssetCode": {
                    "type": "string"
                  },
                  "AssetGroupId": {
                    "type": "string"
                  },
                  "BarcodeId": {
                    "type": "string"
                  },
                  "BookAccumulatedDepreciation": {
                    "type": "number"
                  },
                  "BookDepreciationFrequency": {
                    "type": "string"
                  },
                  "BookDepreciationMethod": {
                    "type": "string"
                  },
                  "BookNetValue": {
                    "type": "number"
                  },
                  "CapitalizationDate": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "DepreciationStartDate": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DisposalDate": {
                    "type": "string"
                  },
                  "InsuranceExpiryDate": {
                    "type": "string"
                  },
                  "InsurancePolicyNumber": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LastDepreciationDate": {
                    "type": "string"
                  },
                  "LastDepreciationPeriod": {
                    "type": "string"
                  },
                  "LastDepreciationStatus": {
                    "type": "string"
                  },
                  "LastPostedPeriod": {
                    "type": "string"
                  },
                  "LastScannedDate": {
                    "type": "string"
                  },
                  "LocationId": {
                    "type": "string"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "NextDepreciationDue": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PurchaseCost": {
                    "type": "number"
                  },
                  "PurchaseDate": {
                    "type": "string"
                  },
                  "QRCodeId": {
                    "type": "string"
                  },
                  "ResidualValue": {
                    "type": "number"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TaxAccumulatedDepreciation": {
                    "type": "number"
                  },
                  "TaxDepreciationFrequency": {
                    "type": "string"
                  },
                  "TaxDepreciationMethod": {
                    "type": "string"
                  },
                  "TaxNetValue": {
                    "type": "number"
                  },
                  "TotalPeriodsCalculated": {
                    "type": "integer"
                  },
                  "TotalPeriodsPosted": {
                    "type": "integer"
                  },
                  "UpdatedBy": {
                    "type": "string"
                  },
                  "UsefulLifeMonths": {
                    "type": "integer"
                  },
                  "VendorId": {
                    "type": "string"
                  },
                  "WarrantyExpiryDate": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `fixedAsset`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/fixedAsset/restore": {
      "put": {
        "operationId": "restoreFixedAsset",
        "summary": "Restore archived fixedAsset record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `fixedAsset` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/fixedAssets.grpc` → `restoreFixedAssets`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:write\")`.",
        "tags": [
          "fixedAsset"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/FixedAsset"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `FixedAsset` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/FixedAsset"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/fixedAssets.grpc",
        "x-hellobooks-handler": "restoreFixedAssets",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:write"
        ],
        "x-hellobooks-scope-domain": "fixedassets",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AssetAccountId": {
                    "type": "string"
                  },
                  "AssetCode": {
                    "type": "string"
                  },
                  "AssetGroupId": {
                    "type": "string"
                  },
                  "BarcodeId": {
                    "type": "string"
                  },
                  "BookAccumulatedDepreciation": {
                    "type": "number"
                  },
                  "BookDepreciationFrequency": {
                    "type": "string"
                  },
                  "BookDepreciationMethod": {
                    "type": "string"
                  },
                  "BookNetValue": {
                    "type": "number"
                  },
                  "CapitalizationDate": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "DepreciationStartDate": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DisposalDate": {
                    "type": "string"
                  },
                  "InsuranceExpiryDate": {
                    "type": "string"
                  },
                  "InsurancePolicyNumber": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LastDepreciationDate": {
                    "type": "string"
                  },
                  "LastDepreciationPeriod": {
                    "type": "string"
                  },
                  "LastDepreciationStatus": {
                    "type": "string"
                  },
                  "LastPostedPeriod": {
                    "type": "string"
                  },
                  "LastScannedDate": {
                    "type": "string"
                  },
                  "LocationId": {
                    "type": "string"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "NextDepreciationDue": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PurchaseCost": {
                    "type": "number"
                  },
                  "PurchaseDate": {
                    "type": "string"
                  },
                  "QRCodeId": {
                    "type": "string"
                  },
                  "ResidualValue": {
                    "type": "number"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TaxAccumulatedDepreciation": {
                    "type": "number"
                  },
                  "TaxDepreciationFrequency": {
                    "type": "string"
                  },
                  "TaxDepreciationMethod": {
                    "type": "string"
                  },
                  "TaxNetValue": {
                    "type": "number"
                  },
                  "TotalPeriodsCalculated": {
                    "type": "integer"
                  },
                  "TotalPeriodsPosted": {
                    "type": "integer"
                  },
                  "UpdatedBy": {
                    "type": "string"
                  },
                  "UsefulLifeMonths": {
                    "type": "integer"
                  },
                  "VendorId": {
                    "type": "string"
                  },
                  "WarrantyExpiryDate": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `fixedAsset`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/fixedAsset/{id}": {
      "get": {
        "operationId": "getFixedAsset",
        "summary": "Fetch one fixedAsset record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `fixedAsset` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/fixedAssets.grpc` → `getFixedAssetById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"fixedassets:read\")`.",
        "tags": [
          "fixedAsset"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "fixedassets:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/FixedAsset"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `FixedAsset` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/FixedAsset"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/fixedAssets.grpc",
        "x-hellobooks-handler": "getFixedAssetById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "fixedassets:read"
        ],
        "x-hellobooks-scope-domain": "fixedassets"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/generalLedger": {
      "get": {
        "operationId": "listGeneralLedger",
        "summary": "List generalLedger records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `generalLedger` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/generalLedger.grpc` → `getGeneralLedgerEntries`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:read\")`.",
        "tags": [
          "generalLedger"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/GeneralLedger"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `GeneralLedger` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/GeneralLedger"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/generalLedger.grpc",
        "x-hellobooks-handler": "getGeneralLedgerEntries",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:read"
        ],
        "x-hellobooks-scope-domain": "accounting"
      },
      "post": {
        "operationId": "createGeneralLedger",
        "summary": "Create generalLedger record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `generalLedger` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/generalLedger.grpc` → `createGeneralLedger`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "generalLedger"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/GeneralLedger"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `GeneralLedger` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/GeneralLedger"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/generalLedger.grpc",
        "x-hellobooks-handler": "createGeneralLedger",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountName": {
                    "type": "string"
                  },
                  "AccountRef": {
                    "type": "string"
                  },
                  "Count": {
                    "type": "integer"
                  },
                  "ImportedFrom": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `generalLedger`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/generalLedger/{id}": {
      "get": {
        "operationId": "getGeneralLedger",
        "summary": "Fetch one generalLedger record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `generalLedger` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/generalLedger.grpc` → `getGeneralLedgerById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:read\")`.",
        "tags": [
          "generalLedger"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/GeneralLedger"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `GeneralLedger` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/GeneralLedger"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/generalLedger.grpc",
        "x-hellobooks-handler": "getGeneralLedgerById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:read"
        ],
        "x-hellobooks-scope-domain": "accounting"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/goodReceiptNoteLine": {
      "post": {
        "operationId": "createGoodReceiptNoteLine",
        "summary": "Create goodReceiptNoteLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `goodReceiptNoteLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/goodReceiptNoteLine.grpc` → `createGoodReceiptNoteLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "goodReceiptNoteLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/GoodReceiptNoteLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `GoodReceiptNoteLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/GoodReceiptNoteLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/goodReceiptNoteLine.grpc",
        "x-hellobooks-handler": "createGoodReceiptNoteLines",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `create` on `goodReceiptNoteLine`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. In addition, this gateway delegates straight to the internal controller, which in several cases expects the records under a resource-named wrapper key. This resource does not declare one — its create and update handlers disagree about the key, or it takes no records array at all — so the accepted envelope is not described here rather than guessed at.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateGoodReceiptNoteLine",
        "summary": "Update goodReceiptNoteLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `goodReceiptNoteLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/goodReceiptNoteLine.grpc` → `updateGoodReceiptNoteLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "goodReceiptNoteLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/GoodReceiptNoteLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `GoodReceiptNoteLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/GoodReceiptNoteLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/goodReceiptNoteLine.grpc",
        "x-hellobooks-handler": "updateGoodReceiptNoteLines",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `update` on `goodReceiptNoteLine`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. In addition, this gateway delegates straight to the internal controller, which in several cases expects the records under a resource-named wrapper key. This resource does not declare one — its create and update handlers disagree about the key, or it takes no records array at all — so the accepted envelope is not described here rather than guessed at.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteGoodReceiptNoteLine",
        "summary": "Delete goodReceiptNoteLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `goodReceiptNoteLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/goodReceiptNoteLine.grpc` → `deleteGoodReceiptNoteLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "goodReceiptNoteLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/GoodReceiptNoteLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `GoodReceiptNoteLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/GoodReceiptNoteLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/goodReceiptNoteLine.grpc",
        "x-hellobooks-handler": "deleteGoodReceiptNoteLines",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `del` on `goodReceiptNoteLine`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. In addition, this gateway delegates straight to the internal controller, which in several cases expects the records under a resource-named wrapper key. This resource does not declare one — its create and update handlers disagree about the key, or it takes no records array at all — so the accepted envelope is not described here rather than guessed at.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/goodReceiptNoteLine/restore": {
      "put": {
        "operationId": "restoreGoodReceiptNoteLine",
        "summary": "Restore archived goodReceiptNoteLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `goodReceiptNoteLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/goodReceiptNoteLine.grpc` → `restoreGoodReceiptNoteLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "goodReceiptNoteLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/GoodReceiptNoteLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `GoodReceiptNoteLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/GoodReceiptNoteLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/goodReceiptNoteLine.grpc",
        "x-hellobooks-handler": "restoreGoodReceiptNoteLines",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `restore` on `goodReceiptNoteLine`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. In addition, this gateway delegates straight to the internal controller, which in several cases expects the records under a resource-named wrapper key. This resource does not declare one — its create and update handlers disagree about the key, or it takes no records array at all — so the accepted envelope is not described here rather than guessed at.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/goodReceiptNoteLine/{id}": {
      "get": {
        "operationId": "getGoodReceiptNoteLine",
        "summary": "Fetch one goodReceiptNoteLine record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `goodReceiptNoteLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/goodReceiptNoteLine.grpc` → `getGoodReceiptNoteLineById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "goodReceiptNoteLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/GoodReceiptNoteLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `GoodReceiptNoteLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/GoodReceiptNoteLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/goodReceiptNoteLine.grpc",
        "x-hellobooks-handler": "getGoodReceiptNoteLineById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/goodReceiptNotes": {
      "get": {
        "operationId": "listGoodReceiptNotes",
        "summary": "List goodReceiptNotes records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `goodReceiptNotes` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/goodReceiptNote.grpc` → `getGoodReceiptNotes`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "goodReceiptNotes"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/GoodReceiptNotes"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `GoodReceiptNotes` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/GoodReceiptNotes"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/goodReceiptNote.grpc",
        "x-hellobooks-handler": "getGoodReceiptNotes",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      },
      "post": {
        "operationId": "createGoodReceiptNotes",
        "summary": "Create goodReceiptNotes record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `goodReceiptNotes` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/goodReceiptNote.grpc` → `createGoodReceiptNotes`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "goodReceiptNotes"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/GoodReceiptNotes"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `GoodReceiptNotes` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/GoodReceiptNotes"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/goodReceiptNote.grpc",
        "x-hellobooks-handler": "createGoodReceiptNotes",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `create` on `goodReceiptNotes`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. In addition, this gateway delegates straight to the internal controller, which in several cases expects the records under a resource-named wrapper key. This resource does not declare one — its create and update handlers disagree about the key, or it takes no records array at all — so the accepted envelope is not described here rather than guessed at.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateGoodReceiptNotes",
        "summary": "Update goodReceiptNotes record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `goodReceiptNotes` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/goodReceiptNote.grpc` → `updateGoodReceiptNotes`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "goodReceiptNotes"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/GoodReceiptNotes"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `GoodReceiptNotes` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/GoodReceiptNotes"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/goodReceiptNote.grpc",
        "x-hellobooks-handler": "updateGoodReceiptNotes",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `update` on `goodReceiptNotes`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. In addition, this gateway delegates straight to the internal controller, which in several cases expects the records under a resource-named wrapper key. This resource does not declare one — its create and update handlers disagree about the key, or it takes no records array at all — so the accepted envelope is not described here rather than guessed at.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteGoodReceiptNotes",
        "summary": "Delete goodReceiptNotes record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `goodReceiptNotes` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/goodReceiptNote.grpc` → `deleteGoodReceiptNotes`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "goodReceiptNotes"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/GoodReceiptNotes"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `GoodReceiptNotes` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/GoodReceiptNotes"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/goodReceiptNote.grpc",
        "x-hellobooks-handler": "deleteGoodReceiptNotes",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `del` on `goodReceiptNotes`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. In addition, this gateway delegates straight to the internal controller, which in several cases expects the records under a resource-named wrapper key. This resource does not declare one — its create and update handlers disagree about the key, or it takes no records array at all — so the accepted envelope is not described here rather than guessed at.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/goodReceiptNotes/restore": {
      "put": {
        "operationId": "restoreGoodReceiptNotes",
        "summary": "Restore archived goodReceiptNotes record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `goodReceiptNotes` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/goodReceiptNote.grpc` → `restoreGoodReceiptNotes`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "goodReceiptNotes"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/GoodReceiptNotes"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `GoodReceiptNotes` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/GoodReceiptNotes"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/goodReceiptNote.grpc",
        "x-hellobooks-handler": "restoreGoodReceiptNotes",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `restore` on `goodReceiptNotes`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. In addition, this gateway delegates straight to the internal controller, which in several cases expects the records under a resource-named wrapper key. This resource does not declare one — its create and update handlers disagree about the key, or it takes no records array at all — so the accepted envelope is not described here rather than guessed at.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/goodReceiptNotes/{id}": {
      "get": {
        "operationId": "getGoodReceiptNotes",
        "summary": "Fetch one goodReceiptNotes record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `goodReceiptNotes` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/goodReceiptNote.grpc` → `getGoodReceiptNoteById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "goodReceiptNotes"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/GoodReceiptNotes"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `GoodReceiptNotes` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/GoodReceiptNotes"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/goodReceiptNote.grpc",
        "x-hellobooks-handler": "getGoodReceiptNoteById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/grossProfit": {
      "get": {
        "operationId": "listGrossProfit",
        "summary": "List grossProfit records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `grossProfit` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/reports/grossProfit.grpc` → `getGrossProfitReport`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"reports:read\")`.",
        "tags": [
          "grossProfit"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "reports:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/GrossProfit"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `GrossProfit` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/GrossProfit"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/reports/grossProfit.grpc",
        "x-hellobooks-handler": "getGrossProfitReport",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "reports:read"
        ],
        "x-hellobooks-scope-domain": "reports"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/invoice": {
      "get": {
        "operationId": "listInvoice",
        "summary": "List invoice records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `invoice` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/invoice.grpc` → `getInvoices`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "invoice"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Invoice"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `Invoice` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/Invoice"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/invoice.grpc",
        "x-hellobooks-handler": "getInvoices",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      },
      "post": {
        "operationId": "createInvoice",
        "summary": "Create invoice record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `invoice` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/invoice.grpc` → `createInvoices`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "invoice"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Invoice"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Invoice` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Invoice"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/invoice.grpc",
        "x-hellobooks-handler": "createInvoices",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "ArchivedAt": {
                    "type": "string"
                  },
                  "ArchivedBy": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BrandingThemeId": {
                    "type": "string"
                  },
                  "ClassRefId": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "CounterpartyEntityRefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "DeliveryChallanRefId": {
                    "type": "string"
                  },
                  "DifferentialPercent": {
                    "type": "number"
                  },
                  "DueDate": {
                    "type": "string"
                  },
                  "EInvoiceCancelledAt": {
                    "type": "string"
                  },
                  "EInvoiceGeneratedAt": {
                    "type": "string"
                  },
                  "EInvoiceIRN": {
                    "type": "string"
                  },
                  "EInvoiceId": {
                    "type": "string"
                  },
                  "EInvoiceStatus": {
                    "type": "string"
                  },
                  "EcommerceGSTIN": {
                    "type": "string"
                  },
                  "EfakturEmittedAt": {
                    "type": "string"
                  },
                  "EfakturFgPengganti": {
                    "type": "string"
                  },
                  "EfakturKdJenisTransaksi": {
                    "type": "string"
                  },
                  "EfakturNsfp": {
                    "type": "string"
                  },
                  "EfakturReplacedNsfp": {
                    "type": "string"
                  },
                  "EfakturSubmissionStatus": {
                    "type": "string"
                  },
                  "EwayBillRequired": {
                    "type": "boolean"
                  },
                  "EwbGeneratedAt": {
                    "type": "string"
                  },
                  "EwbNo": {
                    "type": "string"
                  },
                  "EwbRefId": {
                    "type": "string"
                  },
                  "EwbStatus": {
                    "type": "string"
                  },
                  "EwbValidUpto": {
                    "type": "string"
                  },
                  "ExchangeGainLoss": {
                    "type": "number"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExcludeFromEwb": {
                    "type": "boolean"
                  },
                  "ExpectedPaymentDate": {
                    "type": "string"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FirstViewedAt": {
                    "type": "string"
                  },
                  "FunctionalTotalPayableAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "InvoiceClass": {
                    "type": "string"
                  },
                  "InvoiceNumber": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsConversion": {
                    "type": "boolean"
                  },
                  "IsEcGoodsMovement": {
                    "type": "boolean"
                  },
                  "IsInterCompany": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "IsShippingSameAsBilling": {
                    "type": "boolean"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "LastViewedAt": {
                    "type": "string"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "MarketplaceFacilitator": {
                    "type": "boolean"
                  },
                  "MasterDiscountRef": {
                    "type": "string"
                  },
                  "MerchantOfRecord": {
                    "type": "boolean"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "OriginalTotals": {
                    "type": "object"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "PortCode": {
                    "type": "string"
                  },
                  "ProjectRefId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "QuoteRefId": {
                    "type": "string"
                  },
                  "RecognitionMethod": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "RestoredAt": {
                    "type": "string"
                  },
                  "RestoredBy": {
                    "type": "string"
                  },
                  "RoundOff": {
                    "type": "number"
                  },
                  "SalesOrderRefId": {
                    "type": "string"
                  },
                  "SalesRepName": {
                    "type": "string"
                  },
                  "SalesRepRefId": {
                    "type": "string"
                  },
                  "SelectedBillingAddressId": {
                    "type": "string"
                  },
                  "SelectedShippingAddressId": {
                    "type": "string"
                  },
                  "SellerGSTIN": {
                    "type": "string"
                  },
                  "Sent": {
                    "type": "boolean"
                  },
                  "ServiceEndDate": {
                    "type": "string"
                  },
                  "ServiceStartDate": {
                    "type": "string"
                  },
                  "ShipToRedacted": {
                    "type": "boolean"
                  },
                  "ShipToRedactedAt": {
                    "type": "string"
                  },
                  "ShippingBillDate": {
                    "type": "string"
                  },
                  "ShippingBillNo": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyOrderId": {
                    "type": "string"
                  },
                  "ShopifyOrderName": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "SyncedTo": {
                    "type": "string"
                  },
                  "SyncedToTally": {
                    "type": "boolean"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyNumber": {
                    "type": "string"
                  },
                  "TallyVoucherSeries": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TaxRef": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TcsAmount": {
                    "type": "number"
                  },
                  "TcsBaseAmount": {
                    "type": "number"
                  },
                  "TcsRate": {
                    "type": "number"
                  },
                  "TcsRefId": {
                    "type": "string"
                  },
                  "TdsAmount": {
                    "type": "number"
                  },
                  "TdsBaseAmount": {
                    "type": "number"
                  },
                  "TdsRate": {
                    "type": "number"
                  },
                  "TdsRefId": {
                    "type": "string"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalCGST": {
                    "type": "number"
                  },
                  "TotalCess": {
                    "type": "number"
                  },
                  "TotalCessNonAdvalorem": {
                    "type": "number"
                  },
                  "TotalDiscountAmount": {
                    "type": "number"
                  },
                  "TotalIGST": {
                    "type": "number"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalSGST": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "TotalUTGST": {
                    "type": "number"
                  },
                  "ViewCount": {
                    "type": "integer"
                  },
                  "VoidReason": {
                    "type": "string"
                  },
                  "VoidedAt": {
                    "type": "string"
                  },
                  "VoidedBy": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `invoice`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateInvoice",
        "summary": "Update invoice record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `invoice` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/invoice.grpc` → `updateInvoices`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "invoice"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Invoice"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Invoice` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Invoice"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/invoice.grpc",
        "x-hellobooks-handler": "updateInvoices",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "ArchivedAt": {
                    "type": "string"
                  },
                  "ArchivedBy": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BrandingThemeId": {
                    "type": "string"
                  },
                  "ClassRefId": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "CounterpartyEntityRefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "DeliveryChallanRefId": {
                    "type": "string"
                  },
                  "DifferentialPercent": {
                    "type": "number"
                  },
                  "DueDate": {
                    "type": "string"
                  },
                  "EInvoiceCancelledAt": {
                    "type": "string"
                  },
                  "EInvoiceGeneratedAt": {
                    "type": "string"
                  },
                  "EInvoiceIRN": {
                    "type": "string"
                  },
                  "EInvoiceId": {
                    "type": "string"
                  },
                  "EInvoiceStatus": {
                    "type": "string"
                  },
                  "EcommerceGSTIN": {
                    "type": "string"
                  },
                  "EfakturEmittedAt": {
                    "type": "string"
                  },
                  "EfakturFgPengganti": {
                    "type": "string"
                  },
                  "EfakturKdJenisTransaksi": {
                    "type": "string"
                  },
                  "EfakturNsfp": {
                    "type": "string"
                  },
                  "EfakturReplacedNsfp": {
                    "type": "string"
                  },
                  "EfakturSubmissionStatus": {
                    "type": "string"
                  },
                  "EwayBillRequired": {
                    "type": "boolean"
                  },
                  "EwbGeneratedAt": {
                    "type": "string"
                  },
                  "EwbNo": {
                    "type": "string"
                  },
                  "EwbRefId": {
                    "type": "string"
                  },
                  "EwbStatus": {
                    "type": "string"
                  },
                  "EwbValidUpto": {
                    "type": "string"
                  },
                  "ExchangeGainLoss": {
                    "type": "number"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExcludeFromEwb": {
                    "type": "boolean"
                  },
                  "ExpectedPaymentDate": {
                    "type": "string"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FirstViewedAt": {
                    "type": "string"
                  },
                  "FunctionalTotalPayableAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "InvoiceClass": {
                    "type": "string"
                  },
                  "InvoiceNumber": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsConversion": {
                    "type": "boolean"
                  },
                  "IsEcGoodsMovement": {
                    "type": "boolean"
                  },
                  "IsInterCompany": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "IsShippingSameAsBilling": {
                    "type": "boolean"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "LastViewedAt": {
                    "type": "string"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "MarketplaceFacilitator": {
                    "type": "boolean"
                  },
                  "MasterDiscountRef": {
                    "type": "string"
                  },
                  "MerchantOfRecord": {
                    "type": "boolean"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "OriginalTotals": {
                    "type": "object"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "PortCode": {
                    "type": "string"
                  },
                  "ProjectRefId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "QuoteRefId": {
                    "type": "string"
                  },
                  "RecognitionMethod": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "RestoredAt": {
                    "type": "string"
                  },
                  "RestoredBy": {
                    "type": "string"
                  },
                  "RoundOff": {
                    "type": "number"
                  },
                  "SalesOrderRefId": {
                    "type": "string"
                  },
                  "SalesRepName": {
                    "type": "string"
                  },
                  "SalesRepRefId": {
                    "type": "string"
                  },
                  "SelectedBillingAddressId": {
                    "type": "string"
                  },
                  "SelectedShippingAddressId": {
                    "type": "string"
                  },
                  "SellerGSTIN": {
                    "type": "string"
                  },
                  "Sent": {
                    "type": "boolean"
                  },
                  "ServiceEndDate": {
                    "type": "string"
                  },
                  "ServiceStartDate": {
                    "type": "string"
                  },
                  "ShipToRedacted": {
                    "type": "boolean"
                  },
                  "ShipToRedactedAt": {
                    "type": "string"
                  },
                  "ShippingBillDate": {
                    "type": "string"
                  },
                  "ShippingBillNo": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyOrderId": {
                    "type": "string"
                  },
                  "ShopifyOrderName": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "SyncedTo": {
                    "type": "string"
                  },
                  "SyncedToTally": {
                    "type": "boolean"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyNumber": {
                    "type": "string"
                  },
                  "TallyVoucherSeries": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TaxRef": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TcsAmount": {
                    "type": "number"
                  },
                  "TcsBaseAmount": {
                    "type": "number"
                  },
                  "TcsRate": {
                    "type": "number"
                  },
                  "TcsRefId": {
                    "type": "string"
                  },
                  "TdsAmount": {
                    "type": "number"
                  },
                  "TdsBaseAmount": {
                    "type": "number"
                  },
                  "TdsRate": {
                    "type": "number"
                  },
                  "TdsRefId": {
                    "type": "string"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalCGST": {
                    "type": "number"
                  },
                  "TotalCess": {
                    "type": "number"
                  },
                  "TotalCessNonAdvalorem": {
                    "type": "number"
                  },
                  "TotalDiscountAmount": {
                    "type": "number"
                  },
                  "TotalIGST": {
                    "type": "number"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalSGST": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "TotalUTGST": {
                    "type": "number"
                  },
                  "ViewCount": {
                    "type": "integer"
                  },
                  "VoidReason": {
                    "type": "string"
                  },
                  "VoidedAt": {
                    "type": "string"
                  },
                  "VoidedBy": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `invoice`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteInvoice",
        "summary": "Delete invoice record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `invoice` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/invoice.grpc` → `deleteInvoices`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "invoice"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Invoice"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Invoice` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Invoice"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/invoice.grpc",
        "x-hellobooks-handler": "deleteInvoices",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "ArchivedAt": {
                    "type": "string"
                  },
                  "ArchivedBy": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BrandingThemeId": {
                    "type": "string"
                  },
                  "ClassRefId": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "CounterpartyEntityRefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "DeliveryChallanRefId": {
                    "type": "string"
                  },
                  "DifferentialPercent": {
                    "type": "number"
                  },
                  "DueDate": {
                    "type": "string"
                  },
                  "EInvoiceCancelledAt": {
                    "type": "string"
                  },
                  "EInvoiceGeneratedAt": {
                    "type": "string"
                  },
                  "EInvoiceIRN": {
                    "type": "string"
                  },
                  "EInvoiceId": {
                    "type": "string"
                  },
                  "EInvoiceStatus": {
                    "type": "string"
                  },
                  "EcommerceGSTIN": {
                    "type": "string"
                  },
                  "EfakturEmittedAt": {
                    "type": "string"
                  },
                  "EfakturFgPengganti": {
                    "type": "string"
                  },
                  "EfakturKdJenisTransaksi": {
                    "type": "string"
                  },
                  "EfakturNsfp": {
                    "type": "string"
                  },
                  "EfakturReplacedNsfp": {
                    "type": "string"
                  },
                  "EfakturSubmissionStatus": {
                    "type": "string"
                  },
                  "EwayBillRequired": {
                    "type": "boolean"
                  },
                  "EwbGeneratedAt": {
                    "type": "string"
                  },
                  "EwbNo": {
                    "type": "string"
                  },
                  "EwbRefId": {
                    "type": "string"
                  },
                  "EwbStatus": {
                    "type": "string"
                  },
                  "EwbValidUpto": {
                    "type": "string"
                  },
                  "ExchangeGainLoss": {
                    "type": "number"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExcludeFromEwb": {
                    "type": "boolean"
                  },
                  "ExpectedPaymentDate": {
                    "type": "string"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FirstViewedAt": {
                    "type": "string"
                  },
                  "FunctionalTotalPayableAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "InvoiceClass": {
                    "type": "string"
                  },
                  "InvoiceNumber": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsConversion": {
                    "type": "boolean"
                  },
                  "IsEcGoodsMovement": {
                    "type": "boolean"
                  },
                  "IsInterCompany": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "IsShippingSameAsBilling": {
                    "type": "boolean"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "LastViewedAt": {
                    "type": "string"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "MarketplaceFacilitator": {
                    "type": "boolean"
                  },
                  "MasterDiscountRef": {
                    "type": "string"
                  },
                  "MerchantOfRecord": {
                    "type": "boolean"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "OriginalTotals": {
                    "type": "object"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "PortCode": {
                    "type": "string"
                  },
                  "ProjectRefId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "QuoteRefId": {
                    "type": "string"
                  },
                  "RecognitionMethod": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "RestoredAt": {
                    "type": "string"
                  },
                  "RestoredBy": {
                    "type": "string"
                  },
                  "RoundOff": {
                    "type": "number"
                  },
                  "SalesOrderRefId": {
                    "type": "string"
                  },
                  "SalesRepName": {
                    "type": "string"
                  },
                  "SalesRepRefId": {
                    "type": "string"
                  },
                  "SelectedBillingAddressId": {
                    "type": "string"
                  },
                  "SelectedShippingAddressId": {
                    "type": "string"
                  },
                  "SellerGSTIN": {
                    "type": "string"
                  },
                  "Sent": {
                    "type": "boolean"
                  },
                  "ServiceEndDate": {
                    "type": "string"
                  },
                  "ServiceStartDate": {
                    "type": "string"
                  },
                  "ShipToRedacted": {
                    "type": "boolean"
                  },
                  "ShipToRedactedAt": {
                    "type": "string"
                  },
                  "ShippingBillDate": {
                    "type": "string"
                  },
                  "ShippingBillNo": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyOrderId": {
                    "type": "string"
                  },
                  "ShopifyOrderName": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "SyncedTo": {
                    "type": "string"
                  },
                  "SyncedToTally": {
                    "type": "boolean"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyNumber": {
                    "type": "string"
                  },
                  "TallyVoucherSeries": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TaxRef": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TcsAmount": {
                    "type": "number"
                  },
                  "TcsBaseAmount": {
                    "type": "number"
                  },
                  "TcsRate": {
                    "type": "number"
                  },
                  "TcsRefId": {
                    "type": "string"
                  },
                  "TdsAmount": {
                    "type": "number"
                  },
                  "TdsBaseAmount": {
                    "type": "number"
                  },
                  "TdsRate": {
                    "type": "number"
                  },
                  "TdsRefId": {
                    "type": "string"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalCGST": {
                    "type": "number"
                  },
                  "TotalCess": {
                    "type": "number"
                  },
                  "TotalCessNonAdvalorem": {
                    "type": "number"
                  },
                  "TotalDiscountAmount": {
                    "type": "number"
                  },
                  "TotalIGST": {
                    "type": "number"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalSGST": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "TotalUTGST": {
                    "type": "number"
                  },
                  "ViewCount": {
                    "type": "integer"
                  },
                  "VoidReason": {
                    "type": "string"
                  },
                  "VoidedAt": {
                    "type": "string"
                  },
                  "VoidedBy": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `invoice`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/invoice/restore": {
      "put": {
        "operationId": "restoreInvoice",
        "summary": "Restore archived invoice record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `invoice` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/invoice.grpc` → `restoreInvoices`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "invoice"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Invoice"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Invoice` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Invoice"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/invoice.grpc",
        "x-hellobooks-handler": "restoreInvoices",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "ArchivedAt": {
                    "type": "string"
                  },
                  "ArchivedBy": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BrandingThemeId": {
                    "type": "string"
                  },
                  "ClassRefId": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "CounterpartyEntityRefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "DeliveryChallanRefId": {
                    "type": "string"
                  },
                  "DifferentialPercent": {
                    "type": "number"
                  },
                  "DueDate": {
                    "type": "string"
                  },
                  "EInvoiceCancelledAt": {
                    "type": "string"
                  },
                  "EInvoiceGeneratedAt": {
                    "type": "string"
                  },
                  "EInvoiceIRN": {
                    "type": "string"
                  },
                  "EInvoiceId": {
                    "type": "string"
                  },
                  "EInvoiceStatus": {
                    "type": "string"
                  },
                  "EcommerceGSTIN": {
                    "type": "string"
                  },
                  "EfakturEmittedAt": {
                    "type": "string"
                  },
                  "EfakturFgPengganti": {
                    "type": "string"
                  },
                  "EfakturKdJenisTransaksi": {
                    "type": "string"
                  },
                  "EfakturNsfp": {
                    "type": "string"
                  },
                  "EfakturReplacedNsfp": {
                    "type": "string"
                  },
                  "EfakturSubmissionStatus": {
                    "type": "string"
                  },
                  "EwayBillRequired": {
                    "type": "boolean"
                  },
                  "EwbGeneratedAt": {
                    "type": "string"
                  },
                  "EwbNo": {
                    "type": "string"
                  },
                  "EwbRefId": {
                    "type": "string"
                  },
                  "EwbStatus": {
                    "type": "string"
                  },
                  "EwbValidUpto": {
                    "type": "string"
                  },
                  "ExchangeGainLoss": {
                    "type": "number"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExcludeFromEwb": {
                    "type": "boolean"
                  },
                  "ExpectedPaymentDate": {
                    "type": "string"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FirstViewedAt": {
                    "type": "string"
                  },
                  "FunctionalTotalPayableAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "InvoiceClass": {
                    "type": "string"
                  },
                  "InvoiceNumber": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsConversion": {
                    "type": "boolean"
                  },
                  "IsEcGoodsMovement": {
                    "type": "boolean"
                  },
                  "IsInterCompany": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "IsShippingSameAsBilling": {
                    "type": "boolean"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "LastViewedAt": {
                    "type": "string"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "MarketplaceFacilitator": {
                    "type": "boolean"
                  },
                  "MasterDiscountRef": {
                    "type": "string"
                  },
                  "MerchantOfRecord": {
                    "type": "boolean"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "OriginalTotals": {
                    "type": "object"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "PortCode": {
                    "type": "string"
                  },
                  "ProjectRefId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "QuoteRefId": {
                    "type": "string"
                  },
                  "RecognitionMethod": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "RestoredAt": {
                    "type": "string"
                  },
                  "RestoredBy": {
                    "type": "string"
                  },
                  "RoundOff": {
                    "type": "number"
                  },
                  "SalesOrderRefId": {
                    "type": "string"
                  },
                  "SalesRepName": {
                    "type": "string"
                  },
                  "SalesRepRefId": {
                    "type": "string"
                  },
                  "SelectedBillingAddressId": {
                    "type": "string"
                  },
                  "SelectedShippingAddressId": {
                    "type": "string"
                  },
                  "SellerGSTIN": {
                    "type": "string"
                  },
                  "Sent": {
                    "type": "boolean"
                  },
                  "ServiceEndDate": {
                    "type": "string"
                  },
                  "ServiceStartDate": {
                    "type": "string"
                  },
                  "ShipToRedacted": {
                    "type": "boolean"
                  },
                  "ShipToRedactedAt": {
                    "type": "string"
                  },
                  "ShippingBillDate": {
                    "type": "string"
                  },
                  "ShippingBillNo": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyOrderId": {
                    "type": "string"
                  },
                  "ShopifyOrderName": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "SyncedTo": {
                    "type": "string"
                  },
                  "SyncedToTally": {
                    "type": "boolean"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyNumber": {
                    "type": "string"
                  },
                  "TallyVoucherSeries": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TaxRef": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TcsAmount": {
                    "type": "number"
                  },
                  "TcsBaseAmount": {
                    "type": "number"
                  },
                  "TcsRate": {
                    "type": "number"
                  },
                  "TcsRefId": {
                    "type": "string"
                  },
                  "TdsAmount": {
                    "type": "number"
                  },
                  "TdsBaseAmount": {
                    "type": "number"
                  },
                  "TdsRate": {
                    "type": "number"
                  },
                  "TdsRefId": {
                    "type": "string"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalCGST": {
                    "type": "number"
                  },
                  "TotalCess": {
                    "type": "number"
                  },
                  "TotalCessNonAdvalorem": {
                    "type": "number"
                  },
                  "TotalDiscountAmount": {
                    "type": "number"
                  },
                  "TotalIGST": {
                    "type": "number"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalSGST": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "TotalUTGST": {
                    "type": "number"
                  },
                  "ViewCount": {
                    "type": "integer"
                  },
                  "VoidReason": {
                    "type": "string"
                  },
                  "VoidedAt": {
                    "type": "string"
                  },
                  "VoidedBy": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `invoice`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/invoice/{id}": {
      "get": {
        "operationId": "getInvoice",
        "summary": "Fetch one invoice record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `invoice` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/invoice.grpc` → `getInvoiceById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "invoice"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Invoice"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Invoice` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Invoice"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/invoice.grpc",
        "x-hellobooks-handler": "getInvoiceById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/invoiceAddress": {
      "post": {
        "operationId": "createInvoiceAddress",
        "summary": "Create invoiceAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `invoiceAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/invoiceAddress.grpc` → `createInvoiceAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "invoiceAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/InvoiceAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `InvoiceAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/InvoiceAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/invoiceAddress.grpc",
        "x-hellobooks-handler": "createInvoiceAddresses",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "City": {
                    "type": "string"
                  },
                  "InvoiceId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LineOne": {
                    "type": "string"
                  },
                  "LineTwo": {
                    "type": "string"
                  },
                  "Province": {
                    "type": "string"
                  },
                  "Type": {
                    "type": "string"
                  },
                  "ZipCode": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `invoiceAddress`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateInvoiceAddress",
        "summary": "Update invoiceAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `invoiceAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/invoiceAddress.grpc` → `updateInvoiceAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "invoiceAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/InvoiceAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `InvoiceAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/InvoiceAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/invoiceAddress.grpc",
        "x-hellobooks-handler": "updateInvoiceAddresses",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "City": {
                    "type": "string"
                  },
                  "InvoiceId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LineOne": {
                    "type": "string"
                  },
                  "LineTwo": {
                    "type": "string"
                  },
                  "Province": {
                    "type": "string"
                  },
                  "Type": {
                    "type": "string"
                  },
                  "ZipCode": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `invoiceAddress`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteInvoiceAddress",
        "summary": "Delete invoiceAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `invoiceAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/invoiceAddress.grpc` → `deleteInvoiceAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "invoiceAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/InvoiceAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `InvoiceAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/InvoiceAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/invoiceAddress.grpc",
        "x-hellobooks-handler": "deleteInvoiceAddresses",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "City": {
                    "type": "string"
                  },
                  "InvoiceId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LineOne": {
                    "type": "string"
                  },
                  "LineTwo": {
                    "type": "string"
                  },
                  "Province": {
                    "type": "string"
                  },
                  "Type": {
                    "type": "string"
                  },
                  "ZipCode": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `invoiceAddress`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/invoiceAddress/restore": {
      "put": {
        "operationId": "restoreInvoiceAddress",
        "summary": "Restore archived invoiceAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `invoiceAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/invoiceAddress.grpc` → `restoreInvoiceAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "invoiceAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/InvoiceAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `InvoiceAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/InvoiceAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/invoiceAddress.grpc",
        "x-hellobooks-handler": "restoreInvoiceAddresses",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "City": {
                    "type": "string"
                  },
                  "InvoiceId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LineOne": {
                    "type": "string"
                  },
                  "LineTwo": {
                    "type": "string"
                  },
                  "Province": {
                    "type": "string"
                  },
                  "Type": {
                    "type": "string"
                  },
                  "ZipCode": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `invoiceAddress`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/invoiceAddress/{id}": {
      "get": {
        "operationId": "getInvoiceAddress",
        "summary": "Fetch one invoiceAddress record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `invoiceAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/invoiceAddress.grpc` → `getInvoiceAddressById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "invoiceAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/InvoiceAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `InvoiceAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/InvoiceAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/invoiceAddress.grpc",
        "x-hellobooks-handler": "getInvoiceAddressById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/invoiceLine": {
      "get": {
        "operationId": "listInvoiceLine",
        "summary": "List invoiceLine records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `invoiceLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/invoiceLine.grpc` → `getInvoiceLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "invoiceLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/InvoiceLine"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `InvoiceLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/InvoiceLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/invoiceLine.grpc",
        "x-hellobooks-handler": "getInvoiceLines",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      },
      "post": {
        "operationId": "createInvoiceLine",
        "summary": "Create invoiceLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `invoiceLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/invoiceLine.grpc` → `createInvoiceLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "invoiceLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/InvoiceLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `InvoiceLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/InvoiceLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/invoiceLine.grpc",
        "x-hellobooks-handler": "createInvoiceLines",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "BatchNumber": {
                    "type": "string"
                  },
                  "BrandRefId": {
                    "type": "string"
                  },
                  "CGSTAmount": {
                    "type": "number"
                  },
                  "CGSTRate": {
                    "type": "number"
                  },
                  "CessAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremRate": {
                    "type": "number"
                  },
                  "CessRate": {
                    "type": "number"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "CostCodeRefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DepartmentRefId": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DiscountAmount": {
                    "type": "number"
                  },
                  "DiscountD2Amount": {
                    "type": "number"
                  },
                  "DiscountD2Percentage": {
                    "type": "number"
                  },
                  "DiscountD3Amount": {
                    "type": "number"
                  },
                  "DiscountD3Percentage": {
                    "type": "number"
                  },
                  "DiscountPercentage": {
                    "type": "number"
                  },
                  "ExpiryDate": {
                    "type": "string"
                  },
                  "FreeQuantity": {
                    "type": "number"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "GSTRate": {
                    "type": "number"
                  },
                  "HSNCode": {
                    "type": "string"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IGSTAmount": {
                    "type": "number"
                  },
                  "IGSTRate": {
                    "type": "number"
                  },
                  "InvoiceId": {
                    "type": "string"
                  },
                  "IsDiscountBeforeTax": {
                    "type": "boolean"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LabourAccountHeadRef": {
                    "type": "string"
                  },
                  "LabourAmount": {
                    "type": "number"
                  },
                  "LabourHSN_SAC": {
                    "type": "string"
                  },
                  "LabourRate": {
                    "type": "number"
                  },
                  "LabourTaxAmount": {
                    "type": "number"
                  },
                  "LabourTaxRate": {
                    "type": "number"
                  },
                  "LabourTaxRefId": {
                    "type": "string"
                  },
                  "LineExchangeRate": {
                    "type": "number"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "LotNumber": {
                    "type": "string"
                  },
                  "ManufacturingDate": {
                    "type": "string"
                  },
                  "MappedAccountSource": {
                    "type": "string"
                  },
                  "MappedItemId": {
                    "type": "string"
                  },
                  "MappedItemName": {
                    "type": "string"
                  },
                  "MappedItemSource": {
                    "type": "string"
                  },
                  "MarginValue": {
                    "type": "number"
                  },
                  "NCCDAmount": {
                    "type": "number"
                  },
                  "NCCDRate": {
                    "type": "number"
                  },
                  "OcrCreateVendorDescriptionMapping": {
                    "type": "boolean"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "ProjectRefId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "ReverseCharge": {
                    "type": "boolean"
                  },
                  "SGSTAmount": {
                    "type": "number"
                  },
                  "SGSTRate": {
                    "type": "number"
                  },
                  "SerialNumbers": {
                    "type": "array"
                  },
                  "ShopifyLineId": {
                    "type": "string"
                  },
                  "ShopifyVariantId": {
                    "type": "string"
                  },
                  "SourceDeliveryChallanId": {
                    "type": "string"
                  },
                  "SourceDeliveryChallanLineId": {
                    "type": "string"
                  },
                  "SourceDeliveryChallanNumber": {
                    "type": "string"
                  },
                  "SourceSalesOrderLineId": {
                    "type": "string"
                  },
                  "StateCessAmount": {
                    "type": "number"
                  },
                  "StateCessNonAdvaloremAmount": {
                    "type": "number"
                  },
                  "StateCessNonAdvaloremRate": {
                    "type": "number"
                  },
                  "StateCessRate": {
                    "type": "number"
                  },
                  "SupplyAmount": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxClassification": {
                    "type": "string"
                  },
                  "TaxRate": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxUnconfirmed": {
                    "type": "boolean"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "UTGSTAmount": {
                    "type": "number"
                  },
                  "UTGSTRate": {
                    "type": "number"
                  },
                  "UnitRefId": {
                    "type": "string"
                  },
                  "VendorDescriptionMappingRef": {
                    "type": "string"
                  },
                  "XeroLineItemId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `invoiceLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateInvoiceLine",
        "summary": "Update invoiceLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `invoiceLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/invoiceLine.grpc` → `updateInvoiceLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "invoiceLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/InvoiceLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `InvoiceLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/InvoiceLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/invoiceLine.grpc",
        "x-hellobooks-handler": "updateInvoiceLines",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "BatchNumber": {
                    "type": "string"
                  },
                  "BrandRefId": {
                    "type": "string"
                  },
                  "CGSTAmount": {
                    "type": "number"
                  },
                  "CGSTRate": {
                    "type": "number"
                  },
                  "CessAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremRate": {
                    "type": "number"
                  },
                  "CessRate": {
                    "type": "number"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "CostCodeRefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DepartmentRefId": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DiscountAmount": {
                    "type": "number"
                  },
                  "DiscountD2Amount": {
                    "type": "number"
                  },
                  "DiscountD2Percentage": {
                    "type": "number"
                  },
                  "DiscountD3Amount": {
                    "type": "number"
                  },
                  "DiscountD3Percentage": {
                    "type": "number"
                  },
                  "DiscountPercentage": {
                    "type": "number"
                  },
                  "ExpiryDate": {
                    "type": "string"
                  },
                  "FreeQuantity": {
                    "type": "number"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "GSTRate": {
                    "type": "number"
                  },
                  "HSNCode": {
                    "type": "string"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IGSTAmount": {
                    "type": "number"
                  },
                  "IGSTRate": {
                    "type": "number"
                  },
                  "InvoiceId": {
                    "type": "string"
                  },
                  "IsDiscountBeforeTax": {
                    "type": "boolean"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LabourAccountHeadRef": {
                    "type": "string"
                  },
                  "LabourAmount": {
                    "type": "number"
                  },
                  "LabourHSN_SAC": {
                    "type": "string"
                  },
                  "LabourRate": {
                    "type": "number"
                  },
                  "LabourTaxAmount": {
                    "type": "number"
                  },
                  "LabourTaxRate": {
                    "type": "number"
                  },
                  "LabourTaxRefId": {
                    "type": "string"
                  },
                  "LineExchangeRate": {
                    "type": "number"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "LotNumber": {
                    "type": "string"
                  },
                  "ManufacturingDate": {
                    "type": "string"
                  },
                  "MappedAccountSource": {
                    "type": "string"
                  },
                  "MappedItemId": {
                    "type": "string"
                  },
                  "MappedItemName": {
                    "type": "string"
                  },
                  "MappedItemSource": {
                    "type": "string"
                  },
                  "MarginValue": {
                    "type": "number"
                  },
                  "NCCDAmount": {
                    "type": "number"
                  },
                  "NCCDRate": {
                    "type": "number"
                  },
                  "OcrCreateVendorDescriptionMapping": {
                    "type": "boolean"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "ProjectRefId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "ReverseCharge": {
                    "type": "boolean"
                  },
                  "SGSTAmount": {
                    "type": "number"
                  },
                  "SGSTRate": {
                    "type": "number"
                  },
                  "SerialNumbers": {
                    "type": "array"
                  },
                  "ShopifyLineId": {
                    "type": "string"
                  },
                  "ShopifyVariantId": {
                    "type": "string"
                  },
                  "SourceDeliveryChallanId": {
                    "type": "string"
                  },
                  "SourceDeliveryChallanLineId": {
                    "type": "string"
                  },
                  "SourceDeliveryChallanNumber": {
                    "type": "string"
                  },
                  "SourceSalesOrderLineId": {
                    "type": "string"
                  },
                  "StateCessAmount": {
                    "type": "number"
                  },
                  "StateCessNonAdvaloremAmount": {
                    "type": "number"
                  },
                  "StateCessNonAdvaloremRate": {
                    "type": "number"
                  },
                  "StateCessRate": {
                    "type": "number"
                  },
                  "SupplyAmount": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxClassification": {
                    "type": "string"
                  },
                  "TaxRate": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxUnconfirmed": {
                    "type": "boolean"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "UTGSTAmount": {
                    "type": "number"
                  },
                  "UTGSTRate": {
                    "type": "number"
                  },
                  "UnitRefId": {
                    "type": "string"
                  },
                  "VendorDescriptionMappingRef": {
                    "type": "string"
                  },
                  "XeroLineItemId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `invoiceLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteInvoiceLine",
        "summary": "Delete invoiceLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `invoiceLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/invoiceLine.grpc` → `deleteInvoiceLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "invoiceLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/InvoiceLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `InvoiceLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/InvoiceLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/invoiceLine.grpc",
        "x-hellobooks-handler": "deleteInvoiceLines",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "BatchNumber": {
                    "type": "string"
                  },
                  "BrandRefId": {
                    "type": "string"
                  },
                  "CGSTAmount": {
                    "type": "number"
                  },
                  "CGSTRate": {
                    "type": "number"
                  },
                  "CessAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremRate": {
                    "type": "number"
                  },
                  "CessRate": {
                    "type": "number"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "CostCodeRefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DepartmentRefId": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DiscountAmount": {
                    "type": "number"
                  },
                  "DiscountD2Amount": {
                    "type": "number"
                  },
                  "DiscountD2Percentage": {
                    "type": "number"
                  },
                  "DiscountD3Amount": {
                    "type": "number"
                  },
                  "DiscountD3Percentage": {
                    "type": "number"
                  },
                  "DiscountPercentage": {
                    "type": "number"
                  },
                  "ExpiryDate": {
                    "type": "string"
                  },
                  "FreeQuantity": {
                    "type": "number"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "GSTRate": {
                    "type": "number"
                  },
                  "HSNCode": {
                    "type": "string"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IGSTAmount": {
                    "type": "number"
                  },
                  "IGSTRate": {
                    "type": "number"
                  },
                  "InvoiceId": {
                    "type": "string"
                  },
                  "IsDiscountBeforeTax": {
                    "type": "boolean"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LabourAccountHeadRef": {
                    "type": "string"
                  },
                  "LabourAmount": {
                    "type": "number"
                  },
                  "LabourHSN_SAC": {
                    "type": "string"
                  },
                  "LabourRate": {
                    "type": "number"
                  },
                  "LabourTaxAmount": {
                    "type": "number"
                  },
                  "LabourTaxRate": {
                    "type": "number"
                  },
                  "LabourTaxRefId": {
                    "type": "string"
                  },
                  "LineExchangeRate": {
                    "type": "number"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "LotNumber": {
                    "type": "string"
                  },
                  "ManufacturingDate": {
                    "type": "string"
                  },
                  "MappedAccountSource": {
                    "type": "string"
                  },
                  "MappedItemId": {
                    "type": "string"
                  },
                  "MappedItemName": {
                    "type": "string"
                  },
                  "MappedItemSource": {
                    "type": "string"
                  },
                  "MarginValue": {
                    "type": "number"
                  },
                  "NCCDAmount": {
                    "type": "number"
                  },
                  "NCCDRate": {
                    "type": "number"
                  },
                  "OcrCreateVendorDescriptionMapping": {
                    "type": "boolean"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "ProjectRefId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "ReverseCharge": {
                    "type": "boolean"
                  },
                  "SGSTAmount": {
                    "type": "number"
                  },
                  "SGSTRate": {
                    "type": "number"
                  },
                  "SerialNumbers": {
                    "type": "array"
                  },
                  "ShopifyLineId": {
                    "type": "string"
                  },
                  "ShopifyVariantId": {
                    "type": "string"
                  },
                  "SourceDeliveryChallanId": {
                    "type": "string"
                  },
                  "SourceDeliveryChallanLineId": {
                    "type": "string"
                  },
                  "SourceDeliveryChallanNumber": {
                    "type": "string"
                  },
                  "SourceSalesOrderLineId": {
                    "type": "string"
                  },
                  "StateCessAmount": {
                    "type": "number"
                  },
                  "StateCessNonAdvaloremAmount": {
                    "type": "number"
                  },
                  "StateCessNonAdvaloremRate": {
                    "type": "number"
                  },
                  "StateCessRate": {
                    "type": "number"
                  },
                  "SupplyAmount": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxClassification": {
                    "type": "string"
                  },
                  "TaxRate": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxUnconfirmed": {
                    "type": "boolean"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "UTGSTAmount": {
                    "type": "number"
                  },
                  "UTGSTRate": {
                    "type": "number"
                  },
                  "UnitRefId": {
                    "type": "string"
                  },
                  "VendorDescriptionMappingRef": {
                    "type": "string"
                  },
                  "XeroLineItemId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `invoiceLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/invoiceLine/{id}": {
      "get": {
        "operationId": "getInvoiceLine",
        "summary": "Fetch one invoiceLine record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `invoiceLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/invoiceLine.grpc` → `getInvoiceLineById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "invoiceLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/InvoiceLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `InvoiceLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/InvoiceLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/invoiceLine.grpc",
        "x-hellobooks-handler": "getInvoiceLineById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/invoiceLinkedBill": {
      "post": {
        "operationId": "createInvoiceLinkedBill",
        "summary": "Create invoiceLinkedBill record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `invoiceLinkedBill` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/invoiceLinkedBill.grpc` → `createInvoiceLinkedBills`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "invoiceLinkedBill"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/InvoiceLinkedBill"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `InvoiceLinkedBill` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/InvoiceLinkedBill"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/invoiceLinkedBill.grpc",
        "x-hellobooks-handler": "createInvoiceLinkedBills",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `create` on `invoiceLinkedBill`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. In addition, this gateway delegates straight to the internal controller, which in several cases expects the records under a resource-named wrapper key. This resource does not declare one — its create and update handlers disagree about the key, or it takes no records array at all — so the accepted envelope is not described here rather than guessed at.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateInvoiceLinkedBill",
        "summary": "Update invoiceLinkedBill record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `invoiceLinkedBill` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/invoiceLinkedBill.grpc` → `updateInvoiceLinkedBills`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "invoiceLinkedBill"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/InvoiceLinkedBill"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `InvoiceLinkedBill` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/InvoiceLinkedBill"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/invoiceLinkedBill.grpc",
        "x-hellobooks-handler": "updateInvoiceLinkedBills",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `update` on `invoiceLinkedBill`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. In addition, this gateway delegates straight to the internal controller, which in several cases expects the records under a resource-named wrapper key. This resource does not declare one — its create and update handlers disagree about the key, or it takes no records array at all — so the accepted envelope is not described here rather than guessed at.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteInvoiceLinkedBill",
        "summary": "Delete invoiceLinkedBill record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `invoiceLinkedBill` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/invoiceLinkedBill.grpc` → `deleteInvoiceLinkedBills`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "invoiceLinkedBill"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/InvoiceLinkedBill"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `InvoiceLinkedBill` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/InvoiceLinkedBill"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/invoiceLinkedBill.grpc",
        "x-hellobooks-handler": "deleteInvoiceLinkedBills",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `del` on `invoiceLinkedBill`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. In addition, this gateway delegates straight to the internal controller, which in several cases expects the records under a resource-named wrapper key. This resource does not declare one — its create and update handlers disagree about the key, or it takes no records array at all — so the accepted envelope is not described here rather than guessed at.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/invoiceLinkedBill/restore": {
      "put": {
        "operationId": "restoreInvoiceLinkedBill",
        "summary": "Restore archived invoiceLinkedBill record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `invoiceLinkedBill` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/invoiceLinkedBill.grpc` → `restoreInvoiceLinkedBills`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "invoiceLinkedBill"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/InvoiceLinkedBill"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `InvoiceLinkedBill` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/InvoiceLinkedBill"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/invoiceLinkedBill.grpc",
        "x-hellobooks-handler": "restoreInvoiceLinkedBills",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `restore` on `invoiceLinkedBill`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. In addition, this gateway delegates straight to the internal controller, which in several cases expects the records under a resource-named wrapper key. This resource does not declare one — its create and update handlers disagree about the key, or it takes no records array at all — so the accepted envelope is not described here rather than guessed at.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/invoiceLinkedBill/{id}": {
      "get": {
        "operationId": "getInvoiceLinkedBill",
        "summary": "Fetch one invoiceLinkedBill record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `invoiceLinkedBill` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/invoiceLinkedBill.grpc` → `getInvoiceLinkedBillById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "invoiceLinkedBill"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/InvoiceLinkedBill"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `InvoiceLinkedBill` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/InvoiceLinkedBill"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/invoiceLinkedBill.grpc",
        "x-hellobooks-handler": "getInvoiceLinkedBillById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/item": {
      "get": {
        "operationId": "listItem",
        "summary": "List item records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `item` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/item.grpc` → `getItems`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"inventory:read\")`.",
        "tags": [
          "item"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "inventory:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Item"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `Item` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/Item"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/item.grpc",
        "x-hellobooks-handler": "getItems",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "inventory:read"
        ],
        "x-hellobooks-scope-domain": "inventory"
      },
      "post": {
        "operationId": "createItem",
        "summary": "Create item record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `item` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/item.grpc` → `createItems`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"inventory:write\")`.",
        "tags": [
          "item"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "inventory:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Item"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Item` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Item"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/item.grpc",
        "x-hellobooks-handler": "createItems",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "inventory:write"
        ],
        "x-hellobooks-scope-domain": "inventory",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AllergenFlags": {
                    "type": "array"
                  },
                  "AssetAccountRefId": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "AverageUnitCost": {
                    "type": "number"
                  },
                  "Barcode": {
                    "type": "string"
                  },
                  "BaseUnitRefId": {
                    "type": "string"
                  },
                  "BrandRefId": {
                    "type": "string"
                  },
                  "Category": {
                    "type": "string"
                  },
                  "ContainsAllergens": {
                    "type": "boolean"
                  },
                  "ConversionFactor": {
                    "type": "number"
                  },
                  "CountryOfOrigin": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "CurrentStock": {
                    "type": "number"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "DefaultDropShipVendorId": {
                    "type": "string"
                  },
                  "DefaultPurchaseTaxRefId": {
                    "type": "string"
                  },
                  "DefaultSalesTaxRefId": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpenseAccountRefId": {
                    "type": "string"
                  },
                  "FoodType": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "Group": {
                    "type": "string"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "HasExpiry": {
                    "type": "boolean"
                  },
                  "HazardClass": {
                    "type": "array"
                  },
                  "HazardPictograms": {
                    "type": "array"
                  },
                  "ImageUrl": {
                    "type": "string"
                  },
                  "IncomeAccountRefId": {
                    "type": "string"
                  },
                  "InvStartDate": {
                    "type": "string"
                  },
                  "IsActive": {
                    "type": "boolean"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsDropShipAllowed": {
                    "type": "boolean"
                  },
                  "IsFavorite": {
                    "type": "boolean"
                  },
                  "ItemCode": {
                    "type": "string"
                  },
                  "ItemSubType": {
                    "type": "string"
                  },
                  "KotStation": {
                    "type": "string"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "LeadTimeDays": {
                    "type": "integer"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "MSDSAttachmentRefId": {
                    "type": "string"
                  },
                  "MSDSValidUntil": {
                    "type": "string"
                  },
                  "MSDSVersion": {
                    "type": "string"
                  },
                  "MarketplaceId": {
                    "type": "string"
                  },
                  "MaxOverridePct": {
                    "type": "number"
                  },
                  "MfgLeadTimeDays": {
                    "type": "integer"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "MinOrderQty": {
                    "type": "number"
                  },
                  "MinSellPrice": {
                    "type": "number"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "POSReferenceId": {
                    "type": "string"
                  },
                  "PackagingUnit": {
                    "type": "string"
                  },
                  "PreferredVendorRefId": {
                    "type": "string"
                  },
                  "ProcurementType": {
                    "type": "string"
                  },
                  "PurchasePrice": {
                    "type": "number"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "RegulatoryNotes": {
                    "type": "string"
                  },
                  "ReorderLevel": {
                    "type": "integer"
                  },
                  "RequiresColdChain": {
                    "type": "boolean"
                  },
                  "ScrapPercentage": {
                    "type": "number"
                  },
                  "SellingPrice": {
                    "type": "number"
                  },
                  "ShelfLifeMonths": {
                    "type": "integer"
                  },
                  "ShopifyInventoryItemId": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyProductId": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "SignalWord": {
                    "type": "string"
                  },
                  "StandardCost": {
                    "type": "number"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "StorageTempMax": {
                    "type": "number"
                  },
                  "StorageTempMin": {
                    "type": "number"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "Tags": {
                    "type": "array"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TrackBatch": {
                    "type": "boolean"
                  },
                  "TrackInventory": {
                    "type": "boolean"
                  },
                  "TrackLot": {
                    "type": "boolean"
                  },
                  "TrackSerial": {
                    "type": "boolean"
                  },
                  "Type": {
                    "type": "string"
                  },
                  "Uom": {
                    "type": "string"
                  },
                  "UomHierarchy": {
                    "type": "object"
                  },
                  "ValuationMethod": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `item`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateItem",
        "summary": "Update item record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `item` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/item.grpc` → `updateItems`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"inventory:write\")`.",
        "tags": [
          "item"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "inventory:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Item"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Item` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Item"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/item.grpc",
        "x-hellobooks-handler": "updateItems",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "inventory:write"
        ],
        "x-hellobooks-scope-domain": "inventory",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AllergenFlags": {
                    "type": "array"
                  },
                  "AssetAccountRefId": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "AverageUnitCost": {
                    "type": "number"
                  },
                  "Barcode": {
                    "type": "string"
                  },
                  "BaseUnitRefId": {
                    "type": "string"
                  },
                  "BrandRefId": {
                    "type": "string"
                  },
                  "Category": {
                    "type": "string"
                  },
                  "ContainsAllergens": {
                    "type": "boolean"
                  },
                  "ConversionFactor": {
                    "type": "number"
                  },
                  "CountryOfOrigin": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "CurrentStock": {
                    "type": "number"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "DefaultDropShipVendorId": {
                    "type": "string"
                  },
                  "DefaultPurchaseTaxRefId": {
                    "type": "string"
                  },
                  "DefaultSalesTaxRefId": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpenseAccountRefId": {
                    "type": "string"
                  },
                  "FoodType": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "Group": {
                    "type": "string"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "HasExpiry": {
                    "type": "boolean"
                  },
                  "HazardClass": {
                    "type": "array"
                  },
                  "HazardPictograms": {
                    "type": "array"
                  },
                  "ImageUrl": {
                    "type": "string"
                  },
                  "IncomeAccountRefId": {
                    "type": "string"
                  },
                  "InvStartDate": {
                    "type": "string"
                  },
                  "IsActive": {
                    "type": "boolean"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsDropShipAllowed": {
                    "type": "boolean"
                  },
                  "IsFavorite": {
                    "type": "boolean"
                  },
                  "ItemCode": {
                    "type": "string"
                  },
                  "ItemSubType": {
                    "type": "string"
                  },
                  "KotStation": {
                    "type": "string"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "LeadTimeDays": {
                    "type": "integer"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "MSDSAttachmentRefId": {
                    "type": "string"
                  },
                  "MSDSValidUntil": {
                    "type": "string"
                  },
                  "MSDSVersion": {
                    "type": "string"
                  },
                  "MarketplaceId": {
                    "type": "string"
                  },
                  "MaxOverridePct": {
                    "type": "number"
                  },
                  "MfgLeadTimeDays": {
                    "type": "integer"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "MinOrderQty": {
                    "type": "number"
                  },
                  "MinSellPrice": {
                    "type": "number"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "POSReferenceId": {
                    "type": "string"
                  },
                  "PackagingUnit": {
                    "type": "string"
                  },
                  "PreferredVendorRefId": {
                    "type": "string"
                  },
                  "ProcurementType": {
                    "type": "string"
                  },
                  "PurchasePrice": {
                    "type": "number"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "RegulatoryNotes": {
                    "type": "string"
                  },
                  "ReorderLevel": {
                    "type": "integer"
                  },
                  "RequiresColdChain": {
                    "type": "boolean"
                  },
                  "ScrapPercentage": {
                    "type": "number"
                  },
                  "SellingPrice": {
                    "type": "number"
                  },
                  "ShelfLifeMonths": {
                    "type": "integer"
                  },
                  "ShopifyInventoryItemId": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyProductId": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "SignalWord": {
                    "type": "string"
                  },
                  "StandardCost": {
                    "type": "number"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "StorageTempMax": {
                    "type": "number"
                  },
                  "StorageTempMin": {
                    "type": "number"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "Tags": {
                    "type": "array"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TrackBatch": {
                    "type": "boolean"
                  },
                  "TrackInventory": {
                    "type": "boolean"
                  },
                  "TrackLot": {
                    "type": "boolean"
                  },
                  "TrackSerial": {
                    "type": "boolean"
                  },
                  "Type": {
                    "type": "string"
                  },
                  "Uom": {
                    "type": "string"
                  },
                  "UomHierarchy": {
                    "type": "object"
                  },
                  "ValuationMethod": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `item`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteItem",
        "summary": "Delete item record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `item` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/item.grpc` → `deleteItems`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"inventory:write\")`.",
        "tags": [
          "item"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "inventory:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Item"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Item` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Item"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/item.grpc",
        "x-hellobooks-handler": "deleteItems",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "inventory:write"
        ],
        "x-hellobooks-scope-domain": "inventory",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AllergenFlags": {
                    "type": "array"
                  },
                  "AssetAccountRefId": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "AverageUnitCost": {
                    "type": "number"
                  },
                  "Barcode": {
                    "type": "string"
                  },
                  "BaseUnitRefId": {
                    "type": "string"
                  },
                  "BrandRefId": {
                    "type": "string"
                  },
                  "Category": {
                    "type": "string"
                  },
                  "ContainsAllergens": {
                    "type": "boolean"
                  },
                  "ConversionFactor": {
                    "type": "number"
                  },
                  "CountryOfOrigin": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "CurrentStock": {
                    "type": "number"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "DefaultDropShipVendorId": {
                    "type": "string"
                  },
                  "DefaultPurchaseTaxRefId": {
                    "type": "string"
                  },
                  "DefaultSalesTaxRefId": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpenseAccountRefId": {
                    "type": "string"
                  },
                  "FoodType": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "Group": {
                    "type": "string"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "HasExpiry": {
                    "type": "boolean"
                  },
                  "HazardClass": {
                    "type": "array"
                  },
                  "HazardPictograms": {
                    "type": "array"
                  },
                  "ImageUrl": {
                    "type": "string"
                  },
                  "IncomeAccountRefId": {
                    "type": "string"
                  },
                  "InvStartDate": {
                    "type": "string"
                  },
                  "IsActive": {
                    "type": "boolean"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsDropShipAllowed": {
                    "type": "boolean"
                  },
                  "IsFavorite": {
                    "type": "boolean"
                  },
                  "ItemCode": {
                    "type": "string"
                  },
                  "ItemSubType": {
                    "type": "string"
                  },
                  "KotStation": {
                    "type": "string"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "LeadTimeDays": {
                    "type": "integer"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "MSDSAttachmentRefId": {
                    "type": "string"
                  },
                  "MSDSValidUntil": {
                    "type": "string"
                  },
                  "MSDSVersion": {
                    "type": "string"
                  },
                  "MarketplaceId": {
                    "type": "string"
                  },
                  "MaxOverridePct": {
                    "type": "number"
                  },
                  "MfgLeadTimeDays": {
                    "type": "integer"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "MinOrderQty": {
                    "type": "number"
                  },
                  "MinSellPrice": {
                    "type": "number"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "POSReferenceId": {
                    "type": "string"
                  },
                  "PackagingUnit": {
                    "type": "string"
                  },
                  "PreferredVendorRefId": {
                    "type": "string"
                  },
                  "ProcurementType": {
                    "type": "string"
                  },
                  "PurchasePrice": {
                    "type": "number"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "RegulatoryNotes": {
                    "type": "string"
                  },
                  "ReorderLevel": {
                    "type": "integer"
                  },
                  "RequiresColdChain": {
                    "type": "boolean"
                  },
                  "ScrapPercentage": {
                    "type": "number"
                  },
                  "SellingPrice": {
                    "type": "number"
                  },
                  "ShelfLifeMonths": {
                    "type": "integer"
                  },
                  "ShopifyInventoryItemId": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyProductId": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "SignalWord": {
                    "type": "string"
                  },
                  "StandardCost": {
                    "type": "number"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "StorageTempMax": {
                    "type": "number"
                  },
                  "StorageTempMin": {
                    "type": "number"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "Tags": {
                    "type": "array"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TrackBatch": {
                    "type": "boolean"
                  },
                  "TrackInventory": {
                    "type": "boolean"
                  },
                  "TrackLot": {
                    "type": "boolean"
                  },
                  "TrackSerial": {
                    "type": "boolean"
                  },
                  "Type": {
                    "type": "string"
                  },
                  "Uom": {
                    "type": "string"
                  },
                  "UomHierarchy": {
                    "type": "object"
                  },
                  "ValuationMethod": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `item`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/item/restore": {
      "put": {
        "operationId": "restoreItem",
        "summary": "Restore archived item record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `item` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/item.grpc` → `restoreItems`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"inventory:write\")`.",
        "tags": [
          "item"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "inventory:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Item"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Item` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Item"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/item.grpc",
        "x-hellobooks-handler": "restoreItems",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "inventory:write"
        ],
        "x-hellobooks-scope-domain": "inventory",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AllergenFlags": {
                    "type": "array"
                  },
                  "AssetAccountRefId": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "AverageUnitCost": {
                    "type": "number"
                  },
                  "Barcode": {
                    "type": "string"
                  },
                  "BaseUnitRefId": {
                    "type": "string"
                  },
                  "BrandRefId": {
                    "type": "string"
                  },
                  "Category": {
                    "type": "string"
                  },
                  "ContainsAllergens": {
                    "type": "boolean"
                  },
                  "ConversionFactor": {
                    "type": "number"
                  },
                  "CountryOfOrigin": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "CurrentStock": {
                    "type": "number"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "DefaultDropShipVendorId": {
                    "type": "string"
                  },
                  "DefaultPurchaseTaxRefId": {
                    "type": "string"
                  },
                  "DefaultSalesTaxRefId": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpenseAccountRefId": {
                    "type": "string"
                  },
                  "FoodType": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "Group": {
                    "type": "string"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "HasExpiry": {
                    "type": "boolean"
                  },
                  "HazardClass": {
                    "type": "array"
                  },
                  "HazardPictograms": {
                    "type": "array"
                  },
                  "ImageUrl": {
                    "type": "string"
                  },
                  "IncomeAccountRefId": {
                    "type": "string"
                  },
                  "InvStartDate": {
                    "type": "string"
                  },
                  "IsActive": {
                    "type": "boolean"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsDropShipAllowed": {
                    "type": "boolean"
                  },
                  "IsFavorite": {
                    "type": "boolean"
                  },
                  "ItemCode": {
                    "type": "string"
                  },
                  "ItemSubType": {
                    "type": "string"
                  },
                  "KotStation": {
                    "type": "string"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "LeadTimeDays": {
                    "type": "integer"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "MSDSAttachmentRefId": {
                    "type": "string"
                  },
                  "MSDSValidUntil": {
                    "type": "string"
                  },
                  "MSDSVersion": {
                    "type": "string"
                  },
                  "MarketplaceId": {
                    "type": "string"
                  },
                  "MaxOverridePct": {
                    "type": "number"
                  },
                  "MfgLeadTimeDays": {
                    "type": "integer"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "MinOrderQty": {
                    "type": "number"
                  },
                  "MinSellPrice": {
                    "type": "number"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "POSReferenceId": {
                    "type": "string"
                  },
                  "PackagingUnit": {
                    "type": "string"
                  },
                  "PreferredVendorRefId": {
                    "type": "string"
                  },
                  "ProcurementType": {
                    "type": "string"
                  },
                  "PurchasePrice": {
                    "type": "number"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "RegulatoryNotes": {
                    "type": "string"
                  },
                  "ReorderLevel": {
                    "type": "integer"
                  },
                  "RequiresColdChain": {
                    "type": "boolean"
                  },
                  "ScrapPercentage": {
                    "type": "number"
                  },
                  "SellingPrice": {
                    "type": "number"
                  },
                  "ShelfLifeMonths": {
                    "type": "integer"
                  },
                  "ShopifyInventoryItemId": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyProductId": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "SignalWord": {
                    "type": "string"
                  },
                  "StandardCost": {
                    "type": "number"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "StorageTempMax": {
                    "type": "number"
                  },
                  "StorageTempMin": {
                    "type": "number"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "Tags": {
                    "type": "array"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TrackBatch": {
                    "type": "boolean"
                  },
                  "TrackInventory": {
                    "type": "boolean"
                  },
                  "TrackLot": {
                    "type": "boolean"
                  },
                  "TrackSerial": {
                    "type": "boolean"
                  },
                  "Type": {
                    "type": "string"
                  },
                  "Uom": {
                    "type": "string"
                  },
                  "UomHierarchy": {
                    "type": "object"
                  },
                  "ValuationMethod": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `item`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/item/{id}": {
      "get": {
        "operationId": "getItem",
        "summary": "Fetch one item record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `item` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/item.grpc` → `getItemById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"inventory:read\")`.",
        "tags": [
          "item"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "inventory:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Item"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Item` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Item"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/item.grpc",
        "x-hellobooks-handler": "getItemById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "inventory:read"
        ],
        "x-hellobooks-scope-domain": "inventory"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/journal": {
      "get": {
        "operationId": "listJournal",
        "summary": "List journal records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `journal` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/reports/journal.grpc` → `getJournals`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:read\")`.",
        "tags": [
          "journal"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Journal"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `Journal` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/Journal"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/reports/journal.grpc",
        "x-hellobooks-handler": "getJournals",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:read"
        ],
        "x-hellobooks-scope-domain": "accounting"
      },
      "post": {
        "operationId": "createJournal",
        "summary": "Create journal record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `journal` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/reports/journal.grpc` → `createJournal`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "journal"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Journal"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Journal` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Journal"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/reports/journal.grpc",
        "x-hellobooks-handler": "createJournal",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Attachments": {
                    "type": "object"
                  },
                  "AutoReverseOn": {
                    "type": "string"
                  },
                  "Category": {
                    "type": "string"
                  },
                  "CounterpartyEntityRefId": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "HideFromReports": {
                    "type": "boolean"
                  },
                  "IsAccrual": {
                    "type": "boolean"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsInterCompany": {
                    "type": "boolean"
                  },
                  "JournalNumber": {
                    "type": "string"
                  },
                  "JournalType": {
                    "type": "string"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "LinkedTxnId": {
                    "type": "string"
                  },
                  "LinkedTxnType": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "Narration": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "PostedAt": {
                    "type": "string"
                  },
                  "PostedBy": {
                    "type": "string"
                  },
                  "PostedByUserName": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "ReversalMode": {
                    "type": "string"
                  },
                  "ReversalNote": {
                    "type": "string"
                  },
                  "ReversalOf": {
                    "type": "string"
                  },
                  "ReversalReason": {
                    "type": "string"
                  },
                  "ReversedAt": {
                    "type": "string"
                  },
                  "ReversedBy": {
                    "type": "string"
                  },
                  "ReversedByUserId": {
                    "type": "string"
                  },
                  "ReversedByUserName": {
                    "type": "string"
                  },
                  "ShowOnCashBasis": {
                    "type": "boolean"
                  },
                  "SourceApp": {
                    "type": "string"
                  },
                  "SourceRefId": {
                    "type": "string"
                  },
                  "SourceUrl": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TotalCredit": {
                    "type": "number"
                  },
                  "TotalDebit": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `journal`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateJournal",
        "summary": "Update journal record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `journal` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/reports/journal.grpc` → `updateJournal`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "journal"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Journal"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Journal` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Journal"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/reports/journal.grpc",
        "x-hellobooks-handler": "updateJournal",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Attachments": {
                    "type": "object"
                  },
                  "AutoReverseOn": {
                    "type": "string"
                  },
                  "Category": {
                    "type": "string"
                  },
                  "CounterpartyEntityRefId": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "HideFromReports": {
                    "type": "boolean"
                  },
                  "IsAccrual": {
                    "type": "boolean"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsInterCompany": {
                    "type": "boolean"
                  },
                  "JournalNumber": {
                    "type": "string"
                  },
                  "JournalType": {
                    "type": "string"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "LinkedTxnId": {
                    "type": "string"
                  },
                  "LinkedTxnType": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "Narration": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "PostedAt": {
                    "type": "string"
                  },
                  "PostedBy": {
                    "type": "string"
                  },
                  "PostedByUserName": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "ReversalMode": {
                    "type": "string"
                  },
                  "ReversalNote": {
                    "type": "string"
                  },
                  "ReversalOf": {
                    "type": "string"
                  },
                  "ReversalReason": {
                    "type": "string"
                  },
                  "ReversedAt": {
                    "type": "string"
                  },
                  "ReversedBy": {
                    "type": "string"
                  },
                  "ReversedByUserId": {
                    "type": "string"
                  },
                  "ReversedByUserName": {
                    "type": "string"
                  },
                  "ShowOnCashBasis": {
                    "type": "boolean"
                  },
                  "SourceApp": {
                    "type": "string"
                  },
                  "SourceRefId": {
                    "type": "string"
                  },
                  "SourceUrl": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TotalCredit": {
                    "type": "number"
                  },
                  "TotalDebit": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `journal`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteJournal",
        "summary": "Delete journal record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `journal` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/reports/journal.grpc` → `deleteJournal`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "journal"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Journal"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Journal` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Journal"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/reports/journal.grpc",
        "x-hellobooks-handler": "deleteJournal",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Attachments": {
                    "type": "object"
                  },
                  "AutoReverseOn": {
                    "type": "string"
                  },
                  "Category": {
                    "type": "string"
                  },
                  "CounterpartyEntityRefId": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "HideFromReports": {
                    "type": "boolean"
                  },
                  "IsAccrual": {
                    "type": "boolean"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsInterCompany": {
                    "type": "boolean"
                  },
                  "JournalNumber": {
                    "type": "string"
                  },
                  "JournalType": {
                    "type": "string"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "LinkedTxnId": {
                    "type": "string"
                  },
                  "LinkedTxnType": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "Narration": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "PostedAt": {
                    "type": "string"
                  },
                  "PostedBy": {
                    "type": "string"
                  },
                  "PostedByUserName": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "ReversalMode": {
                    "type": "string"
                  },
                  "ReversalNote": {
                    "type": "string"
                  },
                  "ReversalOf": {
                    "type": "string"
                  },
                  "ReversalReason": {
                    "type": "string"
                  },
                  "ReversedAt": {
                    "type": "string"
                  },
                  "ReversedBy": {
                    "type": "string"
                  },
                  "ReversedByUserId": {
                    "type": "string"
                  },
                  "ReversedByUserName": {
                    "type": "string"
                  },
                  "ShowOnCashBasis": {
                    "type": "boolean"
                  },
                  "SourceApp": {
                    "type": "string"
                  },
                  "SourceRefId": {
                    "type": "string"
                  },
                  "SourceUrl": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TotalCredit": {
                    "type": "number"
                  },
                  "TotalDebit": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `journal`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/journal/restore": {
      "put": {
        "operationId": "restoreJournal",
        "summary": "Restore archived journal record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `journal` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/reports/journal.grpc` → `restoreJournal`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "journal"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Journal"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Journal` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Journal"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/reports/journal.grpc",
        "x-hellobooks-handler": "restoreJournal",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Attachments": {
                    "type": "object"
                  },
                  "AutoReverseOn": {
                    "type": "string"
                  },
                  "Category": {
                    "type": "string"
                  },
                  "CounterpartyEntityRefId": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "HideFromReports": {
                    "type": "boolean"
                  },
                  "IsAccrual": {
                    "type": "boolean"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsInterCompany": {
                    "type": "boolean"
                  },
                  "JournalNumber": {
                    "type": "string"
                  },
                  "JournalType": {
                    "type": "string"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "LinkedTxnId": {
                    "type": "string"
                  },
                  "LinkedTxnType": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "Narration": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "PostedAt": {
                    "type": "string"
                  },
                  "PostedBy": {
                    "type": "string"
                  },
                  "PostedByUserName": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "ReversalMode": {
                    "type": "string"
                  },
                  "ReversalNote": {
                    "type": "string"
                  },
                  "ReversalOf": {
                    "type": "string"
                  },
                  "ReversalReason": {
                    "type": "string"
                  },
                  "ReversedAt": {
                    "type": "string"
                  },
                  "ReversedBy": {
                    "type": "string"
                  },
                  "ReversedByUserId": {
                    "type": "string"
                  },
                  "ReversedByUserName": {
                    "type": "string"
                  },
                  "ShowOnCashBasis": {
                    "type": "boolean"
                  },
                  "SourceApp": {
                    "type": "string"
                  },
                  "SourceRefId": {
                    "type": "string"
                  },
                  "SourceUrl": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TotalCredit": {
                    "type": "number"
                  },
                  "TotalDebit": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `journal`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/lead": {
      "get": {
        "operationId": "listLead",
        "summary": "List lead records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `lead` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/lead.grpc` → `getLeads`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "lead"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Lead"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `Lead` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/Lead"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/lead.grpc",
        "x-hellobooks-handler": "getLeads",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      },
      "post": {
        "operationId": "createLead",
        "summary": "Create lead record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `lead` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/lead.grpc` → `createLeads`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "lead"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Lead"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Lead` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Lead"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/lead.grpc",
        "x-hellobooks-handler": "createLeads",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AttributionId": {
                    "type": "string"
                  },
                  "City": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "CompanyName": {
                    "type": "string"
                  },
                  "ContactName": {
                    "type": "string"
                  },
                  "ContactTitle": {
                    "type": "string"
                  },
                  "ConvertedAt": {
                    "type": "string"
                  },
                  "ConvertedBy": {
                    "type": "string"
                  },
                  "ConvertedCustomerId": {
                    "type": "string"
                  },
                  "ConvertedOpportunityId": {
                    "type": "string"
                  },
                  "Country": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DefaultPaymentTerm": {
                    "type": "string"
                  },
                  "DefaultTaxRef": {
                    "type": "string"
                  },
                  "DisplayName": {
                    "type": "string"
                  },
                  "Email": {
                    "type": "string"
                  },
                  "ExpectedCloseDate": {
                    "type": "string"
                  },
                  "ExpectedValue": {
                    "type": "number"
                  },
                  "Industry": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsConvertedToCustomer": {
                    "type": "boolean"
                  },
                  "LastActivityAt": {
                    "type": "string"
                  },
                  "LastMessageAt": {
                    "type": "string"
                  },
                  "LastStageAt": {
                    "type": "string"
                  },
                  "LeadPriority": {
                    "type": "string"
                  },
                  "LeadSource": {
                    "type": "string"
                  },
                  "LeadStatus": {
                    "type": "string"
                  },
                  "LostAt": {
                    "type": "string"
                  },
                  "LostReason": {
                    "type": "string"
                  },
                  "LostReasonId": {
                    "type": "string"
                  },
                  "LostReasonNotes": {
                    "type": "string"
                  },
                  "LostToCompetitor": {
                    "type": "string"
                  },
                  "Mobile": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "OwnerId": {
                    "type": "string"
                  },
                  "Phone": {
                    "type": "string"
                  },
                  "PreferredPaymentMethod": {
                    "type": "string"
                  },
                  "RequirementNotes": {
                    "type": "string"
                  },
                  "Score": {
                    "type": "integer"
                  },
                  "Source": {
                    "type": "string"
                  },
                  "StageId": {
                    "type": "string"
                  },
                  "State": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TeamId": {
                    "type": "string"
                  },
                  "Website": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `lead`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateLead",
        "summary": "Update lead record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `lead` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/lead.grpc` → `updateLeads`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "lead"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Lead"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Lead` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Lead"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/lead.grpc",
        "x-hellobooks-handler": "updateLeads",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AttributionId": {
                    "type": "string"
                  },
                  "City": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "CompanyName": {
                    "type": "string"
                  },
                  "ContactName": {
                    "type": "string"
                  },
                  "ContactTitle": {
                    "type": "string"
                  },
                  "ConvertedAt": {
                    "type": "string"
                  },
                  "ConvertedBy": {
                    "type": "string"
                  },
                  "ConvertedCustomerId": {
                    "type": "string"
                  },
                  "ConvertedOpportunityId": {
                    "type": "string"
                  },
                  "Country": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DefaultPaymentTerm": {
                    "type": "string"
                  },
                  "DefaultTaxRef": {
                    "type": "string"
                  },
                  "DisplayName": {
                    "type": "string"
                  },
                  "Email": {
                    "type": "string"
                  },
                  "ExpectedCloseDate": {
                    "type": "string"
                  },
                  "ExpectedValue": {
                    "type": "number"
                  },
                  "Industry": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsConvertedToCustomer": {
                    "type": "boolean"
                  },
                  "LastActivityAt": {
                    "type": "string"
                  },
                  "LastMessageAt": {
                    "type": "string"
                  },
                  "LastStageAt": {
                    "type": "string"
                  },
                  "LeadPriority": {
                    "type": "string"
                  },
                  "LeadSource": {
                    "type": "string"
                  },
                  "LeadStatus": {
                    "type": "string"
                  },
                  "LostAt": {
                    "type": "string"
                  },
                  "LostReason": {
                    "type": "string"
                  },
                  "LostReasonId": {
                    "type": "string"
                  },
                  "LostReasonNotes": {
                    "type": "string"
                  },
                  "LostToCompetitor": {
                    "type": "string"
                  },
                  "Mobile": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "OwnerId": {
                    "type": "string"
                  },
                  "Phone": {
                    "type": "string"
                  },
                  "PreferredPaymentMethod": {
                    "type": "string"
                  },
                  "RequirementNotes": {
                    "type": "string"
                  },
                  "Score": {
                    "type": "integer"
                  },
                  "Source": {
                    "type": "string"
                  },
                  "StageId": {
                    "type": "string"
                  },
                  "State": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TeamId": {
                    "type": "string"
                  },
                  "Website": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `lead`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteLead",
        "summary": "Delete lead record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `lead` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/lead.grpc` → `deleteLeads`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "lead"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Lead"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Lead` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Lead"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/lead.grpc",
        "x-hellobooks-handler": "deleteLeads",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AttributionId": {
                    "type": "string"
                  },
                  "City": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "CompanyName": {
                    "type": "string"
                  },
                  "ContactName": {
                    "type": "string"
                  },
                  "ContactTitle": {
                    "type": "string"
                  },
                  "ConvertedAt": {
                    "type": "string"
                  },
                  "ConvertedBy": {
                    "type": "string"
                  },
                  "ConvertedCustomerId": {
                    "type": "string"
                  },
                  "ConvertedOpportunityId": {
                    "type": "string"
                  },
                  "Country": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DefaultPaymentTerm": {
                    "type": "string"
                  },
                  "DefaultTaxRef": {
                    "type": "string"
                  },
                  "DisplayName": {
                    "type": "string"
                  },
                  "Email": {
                    "type": "string"
                  },
                  "ExpectedCloseDate": {
                    "type": "string"
                  },
                  "ExpectedValue": {
                    "type": "number"
                  },
                  "Industry": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsConvertedToCustomer": {
                    "type": "boolean"
                  },
                  "LastActivityAt": {
                    "type": "string"
                  },
                  "LastMessageAt": {
                    "type": "string"
                  },
                  "LastStageAt": {
                    "type": "string"
                  },
                  "LeadPriority": {
                    "type": "string"
                  },
                  "LeadSource": {
                    "type": "string"
                  },
                  "LeadStatus": {
                    "type": "string"
                  },
                  "LostAt": {
                    "type": "string"
                  },
                  "LostReason": {
                    "type": "string"
                  },
                  "LostReasonId": {
                    "type": "string"
                  },
                  "LostReasonNotes": {
                    "type": "string"
                  },
                  "LostToCompetitor": {
                    "type": "string"
                  },
                  "Mobile": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "OwnerId": {
                    "type": "string"
                  },
                  "Phone": {
                    "type": "string"
                  },
                  "PreferredPaymentMethod": {
                    "type": "string"
                  },
                  "RequirementNotes": {
                    "type": "string"
                  },
                  "Score": {
                    "type": "integer"
                  },
                  "Source": {
                    "type": "string"
                  },
                  "StageId": {
                    "type": "string"
                  },
                  "State": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TeamId": {
                    "type": "string"
                  },
                  "Website": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `lead`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/lead/restore": {
      "put": {
        "operationId": "restoreLead",
        "summary": "Restore archived lead record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `lead` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/lead.grpc` → `restoreLeads`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "lead"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Lead"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Lead` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Lead"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/lead.grpc",
        "x-hellobooks-handler": "restoreLeads",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AttributionId": {
                    "type": "string"
                  },
                  "City": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "CompanyName": {
                    "type": "string"
                  },
                  "ContactName": {
                    "type": "string"
                  },
                  "ContactTitle": {
                    "type": "string"
                  },
                  "ConvertedAt": {
                    "type": "string"
                  },
                  "ConvertedBy": {
                    "type": "string"
                  },
                  "ConvertedCustomerId": {
                    "type": "string"
                  },
                  "ConvertedOpportunityId": {
                    "type": "string"
                  },
                  "Country": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DefaultPaymentTerm": {
                    "type": "string"
                  },
                  "DefaultTaxRef": {
                    "type": "string"
                  },
                  "DisplayName": {
                    "type": "string"
                  },
                  "Email": {
                    "type": "string"
                  },
                  "ExpectedCloseDate": {
                    "type": "string"
                  },
                  "ExpectedValue": {
                    "type": "number"
                  },
                  "Industry": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsConvertedToCustomer": {
                    "type": "boolean"
                  },
                  "LastActivityAt": {
                    "type": "string"
                  },
                  "LastMessageAt": {
                    "type": "string"
                  },
                  "LastStageAt": {
                    "type": "string"
                  },
                  "LeadPriority": {
                    "type": "string"
                  },
                  "LeadSource": {
                    "type": "string"
                  },
                  "LeadStatus": {
                    "type": "string"
                  },
                  "LostAt": {
                    "type": "string"
                  },
                  "LostReason": {
                    "type": "string"
                  },
                  "LostReasonId": {
                    "type": "string"
                  },
                  "LostReasonNotes": {
                    "type": "string"
                  },
                  "LostToCompetitor": {
                    "type": "string"
                  },
                  "Mobile": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "OwnerId": {
                    "type": "string"
                  },
                  "Phone": {
                    "type": "string"
                  },
                  "PreferredPaymentMethod": {
                    "type": "string"
                  },
                  "RequirementNotes": {
                    "type": "string"
                  },
                  "Score": {
                    "type": "integer"
                  },
                  "Source": {
                    "type": "string"
                  },
                  "StageId": {
                    "type": "string"
                  },
                  "State": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TeamId": {
                    "type": "string"
                  },
                  "Website": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `lead`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/lead/{id}": {
      "get": {
        "operationId": "getLead",
        "summary": "Fetch one lead record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `lead` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/lead.grpc` → `getLeadById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "lead"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Lead"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Lead` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Lead"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/lead.grpc",
        "x-hellobooks-handler": "getLeadById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/linkedSalesCreditNoteInvoice": {
      "post": {
        "operationId": "createLinkedSalesCreditNoteInvoice",
        "summary": "Create linkedSalesCreditNoteInvoice record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `linkedSalesCreditNoteInvoice` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/linkedSalesCreditNoteInvoice.grpc` → `createLinkedSalesCreditNoteInvoices`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "linkedSalesCreditNoteInvoice"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/LinkedSalesCreditNoteInvoice"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `LinkedSalesCreditNoteInvoice` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/LinkedSalesCreditNoteInvoice"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/linkedSalesCreditNoteInvoice.grpc",
        "x-hellobooks-handler": "createLinkedSalesCreditNoteInvoices",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AppliedAmount": {
                    "type": "number"
                  },
                  "InvoiceRefId": {
                    "type": "string"
                  },
                  "SalesCreditNoteId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `linkedSalesCreditNoteInvoice`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateLinkedSalesCreditNoteInvoice",
        "summary": "Update linkedSalesCreditNoteInvoice record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `linkedSalesCreditNoteInvoice` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/linkedSalesCreditNoteInvoice.grpc` → `updateLinkedSalesCreditNoteInvoices`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "linkedSalesCreditNoteInvoice"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/LinkedSalesCreditNoteInvoice"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `LinkedSalesCreditNoteInvoice` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/LinkedSalesCreditNoteInvoice"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/linkedSalesCreditNoteInvoice.grpc",
        "x-hellobooks-handler": "updateLinkedSalesCreditNoteInvoices",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AppliedAmount": {
                    "type": "number"
                  },
                  "InvoiceRefId": {
                    "type": "string"
                  },
                  "SalesCreditNoteId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `linkedSalesCreditNoteInvoice`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteLinkedSalesCreditNoteInvoice",
        "summary": "Delete linkedSalesCreditNoteInvoice record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `linkedSalesCreditNoteInvoice` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/linkedSalesCreditNoteInvoice.grpc` → `deleteLinkedSalesCreditNoteInvoices`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "linkedSalesCreditNoteInvoice"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/LinkedSalesCreditNoteInvoice"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `LinkedSalesCreditNoteInvoice` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/LinkedSalesCreditNoteInvoice"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/linkedSalesCreditNoteInvoice.grpc",
        "x-hellobooks-handler": "deleteLinkedSalesCreditNoteInvoices",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AppliedAmount": {
                    "type": "number"
                  },
                  "InvoiceRefId": {
                    "type": "string"
                  },
                  "SalesCreditNoteId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `linkedSalesCreditNoteInvoice`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/linkedSalesCreditNoteInvoice/restore": {
      "put": {
        "operationId": "restoreLinkedSalesCreditNoteInvoice",
        "summary": "Restore archived linkedSalesCreditNoteInvoice record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `linkedSalesCreditNoteInvoice` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/linkedSalesCreditNoteInvoice.grpc` → `restoreLinkedSalesCreditNoteInvoices`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "linkedSalesCreditNoteInvoice"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/LinkedSalesCreditNoteInvoice"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `LinkedSalesCreditNoteInvoice` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/LinkedSalesCreditNoteInvoice"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/linkedSalesCreditNoteInvoice.grpc",
        "x-hellobooks-handler": "restoreLinkedSalesCreditNoteInvoices",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AppliedAmount": {
                    "type": "number"
                  },
                  "InvoiceRefId": {
                    "type": "string"
                  },
                  "SalesCreditNoteId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `linkedSalesCreditNoteInvoice`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/linkedSalesCreditNoteInvoice/{id}": {
      "get": {
        "operationId": "getLinkedSalesCreditNoteInvoice",
        "summary": "Fetch one linkedSalesCreditNoteInvoice record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `linkedSalesCreditNoteInvoice` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/linkedSalesCreditNoteInvoice.grpc` → `getLinkedSalesCreditNoteInvoiceById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "linkedSalesCreditNoteInvoice"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/LinkedSalesCreditNoteInvoice"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `LinkedSalesCreditNoteInvoice` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/LinkedSalesCreditNoteInvoice"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/linkedSalesCreditNoteInvoice.grpc",
        "x-hellobooks-handler": "getLinkedSalesCreditNoteInvoiceById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/linkedTransaction": {
      "post": {
        "operationId": "createLinkedTransaction",
        "summary": "Create linkedTransaction record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `linkedTransaction` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/linkedTransaction.grpc` → `createLinkedTransactions`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:write\")`.",
        "tags": [
          "linkedTransaction"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/LinkedTransaction"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `LinkedTransaction` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/LinkedTransaction"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/linkedTransaction.grpc",
        "x-hellobooks-handler": "createLinkedTransactions",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:write"
        ],
        "x-hellobooks-scope-domain": "banking",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "IsLinked": {
                    "type": "boolean"
                  },
                  "LinkOrigin": {
                    "type": "string"
                  },
                  "PostsJournal": {
                    "type": "boolean"
                  },
                  "TransactionLineId": {
                    "type": "string"
                  },
                  "TransactionRefId": {
                    "type": "string"
                  },
                  "TxnType": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `linkedTransaction`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateLinkedTransaction",
        "summary": "Update linkedTransaction record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `linkedTransaction` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/linkedTransaction.grpc` → `updateLinkedTransactions`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:write\")`.",
        "tags": [
          "linkedTransaction"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/LinkedTransaction"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `LinkedTransaction` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/LinkedTransaction"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/linkedTransaction.grpc",
        "x-hellobooks-handler": "updateLinkedTransactions",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:write"
        ],
        "x-hellobooks-scope-domain": "banking",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "IsLinked": {
                    "type": "boolean"
                  },
                  "LinkOrigin": {
                    "type": "string"
                  },
                  "PostsJournal": {
                    "type": "boolean"
                  },
                  "TransactionLineId": {
                    "type": "string"
                  },
                  "TransactionRefId": {
                    "type": "string"
                  },
                  "TxnType": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `linkedTransaction`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteLinkedTransaction",
        "summary": "Delete linkedTransaction record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `linkedTransaction` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/linkedTransaction.grpc` → `deleteLinkedTransactions`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:write\")`.",
        "tags": [
          "linkedTransaction"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/LinkedTransaction"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `LinkedTransaction` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/LinkedTransaction"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/linkedTransaction.grpc",
        "x-hellobooks-handler": "deleteLinkedTransactions",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:write"
        ],
        "x-hellobooks-scope-domain": "banking",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "IsLinked": {
                    "type": "boolean"
                  },
                  "LinkOrigin": {
                    "type": "string"
                  },
                  "PostsJournal": {
                    "type": "boolean"
                  },
                  "TransactionLineId": {
                    "type": "string"
                  },
                  "TransactionRefId": {
                    "type": "string"
                  },
                  "TxnType": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `linkedTransaction`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/linkedTransaction/{id}": {
      "get": {
        "operationId": "getLinkedTransaction",
        "summary": "Fetch one linkedTransaction record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `linkedTransaction` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/linkedTransaction.grpc` → `getLinkedTransactionById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:read\")`.",
        "tags": [
          "linkedTransaction"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/LinkedTransaction"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `LinkedTransaction` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/LinkedTransaction"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/linkedTransaction.grpc",
        "x-hellobooks-handler": "getLinkedTransactionById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:read"
        ],
        "x-hellobooks-scope-domain": "banking"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/location": {
      "get": {
        "operationId": "listLocation",
        "summary": "List location records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `location` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/location.grpc` → `getLocations`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:read\")`.",
        "tags": [
          "location"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Location"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `Location` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/Location"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/location.grpc",
        "x-hellobooks-handler": "getLocations",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:read"
        ],
        "x-hellobooks-scope-domain": "accounting"
      },
      "post": {
        "operationId": "createLocation",
        "summary": "Create location record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `location` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/location.grpc` → `createLocations`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "location"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Location"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Location` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Location"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/location.grpc",
        "x-hellobooks-handler": "createLocations",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AttachmentUrl": {
                    "type": "string"
                  },
                  "City": {
                    "type": "string"
                  },
                  "Code": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "Country": {
                    "type": "string"
                  },
                  "IsActive": {
                    "type": "boolean"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Latitude": {
                    "type": "string"
                  },
                  "Longitude": {
                    "type": "string"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "PostalCode": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "State": {
                    "type": "string"
                  },
                  "Street": {
                    "type": "string"
                  },
                  "SubName": {
                    "type": "string"
                  },
                  "TallyGodownName": {
                    "type": "string"
                  },
                  "TallyParentGodown": {
                    "type": "string"
                  },
                  "TallySyncError": {
                    "type": "string"
                  },
                  "TallySyncStatus": {
                    "type": "string"
                  },
                  "TallySyncedAt": {
                    "type": "string"
                  },
                  "TimeZone": {
                    "type": "string"
                  },
                  "TrackingUsage": {
                    "type": "array"
                  },
                  "Type": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `location`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateLocation",
        "summary": "Update location record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `location` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/location.grpc` → `updateLocations`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "location"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Location"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Location` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Location"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/location.grpc",
        "x-hellobooks-handler": "updateLocations",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AttachmentUrl": {
                    "type": "string"
                  },
                  "City": {
                    "type": "string"
                  },
                  "Code": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "Country": {
                    "type": "string"
                  },
                  "IsActive": {
                    "type": "boolean"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Latitude": {
                    "type": "string"
                  },
                  "Longitude": {
                    "type": "string"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "PostalCode": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "State": {
                    "type": "string"
                  },
                  "Street": {
                    "type": "string"
                  },
                  "SubName": {
                    "type": "string"
                  },
                  "TallyGodownName": {
                    "type": "string"
                  },
                  "TallyParentGodown": {
                    "type": "string"
                  },
                  "TallySyncError": {
                    "type": "string"
                  },
                  "TallySyncStatus": {
                    "type": "string"
                  },
                  "TallySyncedAt": {
                    "type": "string"
                  },
                  "TimeZone": {
                    "type": "string"
                  },
                  "TrackingUsage": {
                    "type": "array"
                  },
                  "Type": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `location`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteLocation",
        "summary": "Delete location record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `location` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/location.grpc` → `deleteLocations`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "location"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Location"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Location` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Location"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/location.grpc",
        "x-hellobooks-handler": "deleteLocations",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AttachmentUrl": {
                    "type": "string"
                  },
                  "City": {
                    "type": "string"
                  },
                  "Code": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "Country": {
                    "type": "string"
                  },
                  "IsActive": {
                    "type": "boolean"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Latitude": {
                    "type": "string"
                  },
                  "Longitude": {
                    "type": "string"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "PostalCode": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "State": {
                    "type": "string"
                  },
                  "Street": {
                    "type": "string"
                  },
                  "SubName": {
                    "type": "string"
                  },
                  "TallyGodownName": {
                    "type": "string"
                  },
                  "TallyParentGodown": {
                    "type": "string"
                  },
                  "TallySyncError": {
                    "type": "string"
                  },
                  "TallySyncStatus": {
                    "type": "string"
                  },
                  "TallySyncedAt": {
                    "type": "string"
                  },
                  "TimeZone": {
                    "type": "string"
                  },
                  "TrackingUsage": {
                    "type": "array"
                  },
                  "Type": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `location`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/location/restore": {
      "put": {
        "operationId": "restoreLocation",
        "summary": "Restore archived location record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `location` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/location.grpc` → `restoreLocations`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "location"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Location"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Location` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Location"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/location.grpc",
        "x-hellobooks-handler": "restoreLocations",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AttachmentUrl": {
                    "type": "string"
                  },
                  "City": {
                    "type": "string"
                  },
                  "Code": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "Country": {
                    "type": "string"
                  },
                  "IsActive": {
                    "type": "boolean"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Latitude": {
                    "type": "string"
                  },
                  "Longitude": {
                    "type": "string"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "PostalCode": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "State": {
                    "type": "string"
                  },
                  "Street": {
                    "type": "string"
                  },
                  "SubName": {
                    "type": "string"
                  },
                  "TallyGodownName": {
                    "type": "string"
                  },
                  "TallyParentGodown": {
                    "type": "string"
                  },
                  "TallySyncError": {
                    "type": "string"
                  },
                  "TallySyncStatus": {
                    "type": "string"
                  },
                  "TallySyncedAt": {
                    "type": "string"
                  },
                  "TimeZone": {
                    "type": "string"
                  },
                  "TrackingUsage": {
                    "type": "array"
                  },
                  "Type": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `location`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/location/{id}": {
      "get": {
        "operationId": "getLocation",
        "summary": "Fetch one location record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `location` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/location.grpc` → `getLocationById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:read\")`.",
        "tags": [
          "location"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Location"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Location` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Location"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/location.grpc",
        "x-hellobooks-handler": "getLocationById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:read"
        ],
        "x-hellobooks-scope-domain": "accounting"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/ownerAddress": {
      "post": {
        "operationId": "createOwnerAddress",
        "summary": "Create ownerAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `ownerAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/businessOwnerAddress.grpc` → `createBusinessOwnerAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "ownerAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/OwnerAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `OwnerAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/OwnerAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/businessOwnerAddress.grpc",
        "x-hellobooks-handler": "createBusinessOwnerAddresses",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `create` on `ownerAddress`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"Addresses\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "Addresses"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateOwnerAddress",
        "summary": "Update ownerAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `ownerAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/businessOwnerAddress.grpc` → `updateBusinessOwnerAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "ownerAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/OwnerAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `OwnerAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/OwnerAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/businessOwnerAddress.grpc",
        "x-hellobooks-handler": "updateBusinessOwnerAddresses",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `update` on `ownerAddress`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"Addresses\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "Addresses"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteOwnerAddress",
        "summary": "Delete ownerAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `ownerAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/businessOwnerAddress.grpc` → `deleteBusinessOwnerAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "ownerAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/OwnerAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `OwnerAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/OwnerAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/businessOwnerAddress.grpc",
        "x-hellobooks-handler": "deleteBusinessOwnerAddresses",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `del` on `ownerAddress`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"Addresses\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "Addresses"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/ownerAddress/{id}": {
      "get": {
        "operationId": "getOwnerAddress",
        "summary": "Fetch one ownerAddress record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `ownerAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/businessOwnerAddress.grpc` → `getBusinessOwnerAddressById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:read\")`.",
        "tags": [
          "ownerAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/OwnerAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `OwnerAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/OwnerAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/businessOwnerAddress.grpc",
        "x-hellobooks-handler": "getBusinessOwnerAddressById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:read"
        ],
        "x-hellobooks-scope-domain": "contacts"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/ownerCreditCard": {
      "post": {
        "operationId": "createOwnerCreditCard",
        "summary": "Create ownerCreditCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `ownerCreditCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/businessOwnerCreditCard.grpc` → `createBusinessOwnerCreditCards`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "ownerCreditCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/OwnerCreditCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `OwnerCreditCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/OwnerCreditCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/businessOwnerCreditCard.grpc",
        "x-hellobooks-handler": "createBusinessOwnerCreditCards",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `create` on `ownerCreditCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"BusinessOwnerCreditCardDetails\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "BusinessOwnerCreditCardDetails"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateOwnerCreditCard",
        "summary": "Update ownerCreditCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `ownerCreditCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/businessOwnerCreditCard.grpc` → `updateBusinessOwnerCreditCards`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "ownerCreditCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/OwnerCreditCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `OwnerCreditCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/OwnerCreditCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/businessOwnerCreditCard.grpc",
        "x-hellobooks-handler": "updateBusinessOwnerCreditCards",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `update` on `ownerCreditCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"BusinessOwnerCreditCardDetails\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "BusinessOwnerCreditCardDetails"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteOwnerCreditCard",
        "summary": "Delete ownerCreditCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `ownerCreditCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/businessOwnerCreditCard.grpc` → `deleteBusinessOwnerCreditCards`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "ownerCreditCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/OwnerCreditCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `OwnerCreditCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/OwnerCreditCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/businessOwnerCreditCard.grpc",
        "x-hellobooks-handler": "deleteBusinessOwnerCreditCards",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `del` on `ownerCreditCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"BusinessOwnerCreditCardDetails\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "BusinessOwnerCreditCardDetails"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/ownerCreditCard/{id}": {
      "get": {
        "operationId": "getOwnerCreditCard",
        "summary": "Fetch one ownerCreditCard record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `ownerCreditCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/businessOwnerCreditCard.grpc` → `getBusinessOwnerCreditCardById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:read\")`.",
        "tags": [
          "ownerCreditCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/OwnerCreditCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `OwnerCreditCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/OwnerCreditCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/businessOwnerCreditCard.grpc",
        "x-hellobooks-handler": "getBusinessOwnerCreditCardById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:read"
        ],
        "x-hellobooks-scope-domain": "paymentmethods"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/ownerDebitCard": {
      "post": {
        "operationId": "createOwnerDebitCard",
        "summary": "Create ownerDebitCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `ownerDebitCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/businessOwnerDebitCard.grpc` → `createBusinessOwnerDebitCards`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "ownerDebitCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/OwnerDebitCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `OwnerDebitCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/OwnerDebitCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/businessOwnerDebitCard.grpc",
        "x-hellobooks-handler": "createBusinessOwnerDebitCards",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `create` on `ownerDebitCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"DebitCards\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "DebitCards"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateOwnerDebitCard",
        "summary": "Update ownerDebitCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `ownerDebitCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/businessOwnerDebitCard.grpc` → `updateBusinessOwnerDebitCards`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "ownerDebitCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/OwnerDebitCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `OwnerDebitCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/OwnerDebitCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/businessOwnerDebitCard.grpc",
        "x-hellobooks-handler": "updateBusinessOwnerDebitCards",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `update` on `ownerDebitCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"DebitCards\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "DebitCards"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteOwnerDebitCard",
        "summary": "Delete ownerDebitCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `ownerDebitCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/businessOwnerDebitCard.grpc` → `deleteBusinessOwnerDebitCards`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "ownerDebitCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/OwnerDebitCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `OwnerDebitCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/OwnerDebitCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/businessOwnerDebitCard.grpc",
        "x-hellobooks-handler": "deleteBusinessOwnerDebitCards",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `del` on `ownerDebitCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"DebitCards\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "DebitCards"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/ownerDebitCard/{id}": {
      "get": {
        "operationId": "getOwnerDebitCard",
        "summary": "Fetch one ownerDebitCard record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `ownerDebitCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/businessOwnerDebitCard.grpc` → `getBusinessOwnerDebitCardById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:read\")`.",
        "tags": [
          "ownerDebitCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/OwnerDebitCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `OwnerDebitCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/OwnerDebitCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/businessOwnerDebitCard.grpc",
        "x-hellobooks-handler": "getBusinessOwnerDebitCardById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:read"
        ],
        "x-hellobooks-scope-domain": "paymentmethods"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/ownerLoanAccounts": {
      "post": {
        "operationId": "createOwnerLoanAccounts",
        "summary": "Create ownerLoanAccounts record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `ownerLoanAccounts` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/businessOwnerLoanAccount.grpc` → `createBusinessOwnerLoanAccounts`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "ownerLoanAccounts"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/OwnerLoanAccounts"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `OwnerLoanAccounts` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/OwnerLoanAccounts"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/businessOwnerLoanAccount.grpc",
        "x-hellobooks-handler": "createBusinessOwnerLoanAccounts",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `create` on `ownerLoanAccounts`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"LoanAccounts\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "LoanAccounts"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateOwnerLoanAccounts",
        "summary": "Update ownerLoanAccounts record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `ownerLoanAccounts` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/businessOwnerLoanAccount.grpc` → `updateBusinessOwnerLoanAccounts`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "ownerLoanAccounts"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/OwnerLoanAccounts"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `OwnerLoanAccounts` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/OwnerLoanAccounts"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/businessOwnerLoanAccount.grpc",
        "x-hellobooks-handler": "updateBusinessOwnerLoanAccounts",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `update` on `ownerLoanAccounts`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"LoanAccounts\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "LoanAccounts"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteOwnerLoanAccounts",
        "summary": "Delete ownerLoanAccounts record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `ownerLoanAccounts` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/businessOwnerLoanAccount.grpc` → `deleteBusinessOwnerLoanAccounts`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "ownerLoanAccounts"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/OwnerLoanAccounts"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `OwnerLoanAccounts` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/OwnerLoanAccounts"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/businessOwnerLoanAccount.grpc",
        "x-hellobooks-handler": "deleteBusinessOwnerLoanAccounts",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `del` on `ownerLoanAccounts`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"LoanAccounts\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "LoanAccounts"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/ownerLoanAccounts/{id}": {
      "get": {
        "operationId": "getOwnerLoanAccounts",
        "summary": "Fetch one ownerLoanAccounts record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `ownerLoanAccounts` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/businessOwnerLoanAccount.grpc` → `getBusinessOwnerLoanAccountById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:read\")`.",
        "tags": [
          "ownerLoanAccounts"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/OwnerLoanAccounts"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `OwnerLoanAccounts` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/OwnerLoanAccounts"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/businessOwnerLoanAccount.grpc",
        "x-hellobooks-handler": "getBusinessOwnerLoanAccountById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:read"
        ],
        "x-hellobooks-scope-domain": "contacts"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/payment": {
      "get": {
        "operationId": "listPayment",
        "summary": "List payment records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `payment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/payment.grpc` → `getPayments`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"payments:read\")`.",
        "tags": [
          "payment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "payments:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Payment"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `Payment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/Payment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/payment.grpc",
        "x-hellobooks-handler": "getPayments",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "payments:read"
        ],
        "x-hellobooks-scope-domain": "payments"
      },
      "post": {
        "operationId": "createPayment",
        "summary": "Create payment record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `payment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/payment.grpc` → `createPayments`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"payments:write\")`.",
        "tags": [
          "payment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "payments:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Payment"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Payment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Payment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/payment.grpc",
        "x-hellobooks-handler": "createPayments",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "payments:write"
        ],
        "x-hellobooks-scope-domain": "payments",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountRef": {
                    "type": "string"
                  },
                  "AdjustmentAmount": {
                    "type": "number"
                  },
                  "AdjustmentDebitCredit": {
                    "type": "string"
                  },
                  "AdjustmentDescription": {
                    "type": "string"
                  },
                  "AdjustmentType": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "string"
                  },
                  "AmountApplied": {
                    "type": "number"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BillRefId": {
                    "type": "string"
                  },
                  "CheckStockType": {
                    "type": "string"
                  },
                  "ChequeBank": {
                    "type": "string"
                  },
                  "ChequeDate": {
                    "type": "string"
                  },
                  "ChequeNumber": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "CounterpartyEntityRefId": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CreatedByMatchId": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "DocumentCurrencyRef": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpenseClaimRefId": {
                    "type": "string"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GatewayMethodCategory": {
                    "type": "string"
                  },
                  "GatewayMethodCode": {
                    "type": "string"
                  },
                  "GatewayMethodSubtype": {
                    "type": "string"
                  },
                  "GatewayProvider": {
                    "type": "string"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "InvoiceRefId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsCheque": {
                    "type": "boolean"
                  },
                  "IsInterCompany": {
                    "type": "boolean"
                  },
                  "IsReconciled": {
                    "type": "boolean"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PaymentMethod": {
                    "type": "string"
                  },
                  "PrintBatchRef": {
                    "type": "string"
                  },
                  "PrintStatus": {
                    "type": "string"
                  },
                  "PrintedAt": {
                    "type": "string"
                  },
                  "PrintedBy": {
                    "type": "string"
                  },
                  "PurchaseCreditNoteRefId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "ReconciledAt": {
                    "type": "string"
                  },
                  "ReconciledBy": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "SalesCreditNoteRefId": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyOrderId": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "ShopifyTransactionId": {
                    "type": "string"
                  },
                  "SourceModule": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "TallyNumber": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TransactionLineRefId": {
                    "type": "string"
                  },
                  "TransactionRefId": {
                    "type": "string"
                  },
                  "UpdatedBy": {
                    "type": "string"
                  },
                  "VoidReason": {
                    "type": "string"
                  },
                  "VoidedAt": {
                    "type": "string"
                  },
                  "VoidedBy": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `payment`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updatePayment",
        "summary": "Update payment record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `payment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/payment.grpc` → `updatePayments`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"payments:write\")`.",
        "tags": [
          "payment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "payments:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Payment"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Payment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Payment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/payment.grpc",
        "x-hellobooks-handler": "updatePayments",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "payments:write"
        ],
        "x-hellobooks-scope-domain": "payments",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountRef": {
                    "type": "string"
                  },
                  "AdjustmentAmount": {
                    "type": "number"
                  },
                  "AdjustmentDebitCredit": {
                    "type": "string"
                  },
                  "AdjustmentDescription": {
                    "type": "string"
                  },
                  "AdjustmentType": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "string"
                  },
                  "AmountApplied": {
                    "type": "number"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BillRefId": {
                    "type": "string"
                  },
                  "CheckStockType": {
                    "type": "string"
                  },
                  "ChequeBank": {
                    "type": "string"
                  },
                  "ChequeDate": {
                    "type": "string"
                  },
                  "ChequeNumber": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "CounterpartyEntityRefId": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CreatedByMatchId": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "DocumentCurrencyRef": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpenseClaimRefId": {
                    "type": "string"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GatewayMethodCategory": {
                    "type": "string"
                  },
                  "GatewayMethodCode": {
                    "type": "string"
                  },
                  "GatewayMethodSubtype": {
                    "type": "string"
                  },
                  "GatewayProvider": {
                    "type": "string"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "InvoiceRefId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsCheque": {
                    "type": "boolean"
                  },
                  "IsInterCompany": {
                    "type": "boolean"
                  },
                  "IsReconciled": {
                    "type": "boolean"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PaymentMethod": {
                    "type": "string"
                  },
                  "PrintBatchRef": {
                    "type": "string"
                  },
                  "PrintStatus": {
                    "type": "string"
                  },
                  "PrintedAt": {
                    "type": "string"
                  },
                  "PrintedBy": {
                    "type": "string"
                  },
                  "PurchaseCreditNoteRefId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "ReconciledAt": {
                    "type": "string"
                  },
                  "ReconciledBy": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "SalesCreditNoteRefId": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyOrderId": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "ShopifyTransactionId": {
                    "type": "string"
                  },
                  "SourceModule": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "TallyNumber": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TransactionLineRefId": {
                    "type": "string"
                  },
                  "TransactionRefId": {
                    "type": "string"
                  },
                  "UpdatedBy": {
                    "type": "string"
                  },
                  "VoidReason": {
                    "type": "string"
                  },
                  "VoidedAt": {
                    "type": "string"
                  },
                  "VoidedBy": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `payment`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deletePayment",
        "summary": "Delete payment record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `payment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/payment.grpc` → `deletePayments`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"payments:write\")`.",
        "tags": [
          "payment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "payments:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Payment"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Payment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Payment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/payment.grpc",
        "x-hellobooks-handler": "deletePayments",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "payments:write"
        ],
        "x-hellobooks-scope-domain": "payments",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountRef": {
                    "type": "string"
                  },
                  "AdjustmentAmount": {
                    "type": "number"
                  },
                  "AdjustmentDebitCredit": {
                    "type": "string"
                  },
                  "AdjustmentDescription": {
                    "type": "string"
                  },
                  "AdjustmentType": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "string"
                  },
                  "AmountApplied": {
                    "type": "number"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BillRefId": {
                    "type": "string"
                  },
                  "CheckStockType": {
                    "type": "string"
                  },
                  "ChequeBank": {
                    "type": "string"
                  },
                  "ChequeDate": {
                    "type": "string"
                  },
                  "ChequeNumber": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "CounterpartyEntityRefId": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CreatedByMatchId": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "DocumentCurrencyRef": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpenseClaimRefId": {
                    "type": "string"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GatewayMethodCategory": {
                    "type": "string"
                  },
                  "GatewayMethodCode": {
                    "type": "string"
                  },
                  "GatewayMethodSubtype": {
                    "type": "string"
                  },
                  "GatewayProvider": {
                    "type": "string"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "InvoiceRefId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsCheque": {
                    "type": "boolean"
                  },
                  "IsInterCompany": {
                    "type": "boolean"
                  },
                  "IsReconciled": {
                    "type": "boolean"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PaymentMethod": {
                    "type": "string"
                  },
                  "PrintBatchRef": {
                    "type": "string"
                  },
                  "PrintStatus": {
                    "type": "string"
                  },
                  "PrintedAt": {
                    "type": "string"
                  },
                  "PrintedBy": {
                    "type": "string"
                  },
                  "PurchaseCreditNoteRefId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "ReconciledAt": {
                    "type": "string"
                  },
                  "ReconciledBy": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "SalesCreditNoteRefId": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyOrderId": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "ShopifyTransactionId": {
                    "type": "string"
                  },
                  "SourceModule": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "TallyNumber": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TransactionLineRefId": {
                    "type": "string"
                  },
                  "TransactionRefId": {
                    "type": "string"
                  },
                  "UpdatedBy": {
                    "type": "string"
                  },
                  "VoidReason": {
                    "type": "string"
                  },
                  "VoidedAt": {
                    "type": "string"
                  },
                  "VoidedBy": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `payment`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/payment/restore": {
      "put": {
        "operationId": "restorePayment",
        "summary": "Restore archived payment record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `payment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/payment.grpc` → `restorePayments`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"payments:write\")`.",
        "tags": [
          "payment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "payments:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Payment"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Payment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Payment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/payment.grpc",
        "x-hellobooks-handler": "restorePayments",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "payments:write"
        ],
        "x-hellobooks-scope-domain": "payments",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountRef": {
                    "type": "string"
                  },
                  "AdjustmentAmount": {
                    "type": "number"
                  },
                  "AdjustmentDebitCredit": {
                    "type": "string"
                  },
                  "AdjustmentDescription": {
                    "type": "string"
                  },
                  "AdjustmentType": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "string"
                  },
                  "AmountApplied": {
                    "type": "number"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BillRefId": {
                    "type": "string"
                  },
                  "CheckStockType": {
                    "type": "string"
                  },
                  "ChequeBank": {
                    "type": "string"
                  },
                  "ChequeDate": {
                    "type": "string"
                  },
                  "ChequeNumber": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "CounterpartyEntityRefId": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CreatedByMatchId": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "DocumentCurrencyRef": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpenseClaimRefId": {
                    "type": "string"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GatewayMethodCategory": {
                    "type": "string"
                  },
                  "GatewayMethodCode": {
                    "type": "string"
                  },
                  "GatewayMethodSubtype": {
                    "type": "string"
                  },
                  "GatewayProvider": {
                    "type": "string"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "InvoiceRefId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsCheque": {
                    "type": "boolean"
                  },
                  "IsInterCompany": {
                    "type": "boolean"
                  },
                  "IsReconciled": {
                    "type": "boolean"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PaymentMethod": {
                    "type": "string"
                  },
                  "PrintBatchRef": {
                    "type": "string"
                  },
                  "PrintStatus": {
                    "type": "string"
                  },
                  "PrintedAt": {
                    "type": "string"
                  },
                  "PrintedBy": {
                    "type": "string"
                  },
                  "PurchaseCreditNoteRefId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "ReconciledAt": {
                    "type": "string"
                  },
                  "ReconciledBy": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "SalesCreditNoteRefId": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyOrderId": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "ShopifyTransactionId": {
                    "type": "string"
                  },
                  "SourceModule": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "TallyNumber": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TransactionLineRefId": {
                    "type": "string"
                  },
                  "TransactionRefId": {
                    "type": "string"
                  },
                  "UpdatedBy": {
                    "type": "string"
                  },
                  "VoidReason": {
                    "type": "string"
                  },
                  "VoidedAt": {
                    "type": "string"
                  },
                  "VoidedBy": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `payment`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/payment/{id}": {
      "get": {
        "operationId": "getPayment",
        "summary": "Fetch one payment record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `payment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/payment.grpc` → `getPaymentById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"payments:read\")`.",
        "tags": [
          "payment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "payments:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Payment"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Payment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Payment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/payment.grpc",
        "x-hellobooks-handler": "getPaymentById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "payments:read"
        ],
        "x-hellobooks-scope-domain": "payments"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/profitLoss": {
      "get": {
        "operationId": "listProfitLoss",
        "summary": "List profitLoss records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `profitLoss` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/reports/profitLoss.grpc` → `getProfitAndLossReport`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"reports:read\")`.",
        "tags": [
          "profitLoss"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "reports:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/ProfitLoss"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `ProfitLoss` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/ProfitLoss"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/reports/profitLoss.grpc",
        "x-hellobooks-handler": "getProfitAndLossReport",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "reports:read"
        ],
        "x-hellobooks-scope-domain": "reports"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/project": {
      "get": {
        "operationId": "listProject",
        "summary": "List project records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `project` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/project.grpc` → `getProjects`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"projects:read\")`.",
        "tags": [
          "project"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "projects:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Project"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `Project` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/Project"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/project.grpc",
        "x-hellobooks-handler": "getProjects",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "projects:read"
        ],
        "x-hellobooks-scope-domain": "projects"
      },
      "post": {
        "operationId": "createProject",
        "summary": "Create project record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `project` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/project.grpc` → `createProjects`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"projects:write\")`.",
        "tags": [
          "project"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "projects:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Project"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Project` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Project"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/project.grpc",
        "x-hellobooks-handler": "createProjects",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "projects:write"
        ],
        "x-hellobooks-scope-domain": "projects",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Attachment": {
                    "type": "string"
                  },
                  "Billable": {
                    "type": "boolean"
                  },
                  "BoardData": {
                    "type": "string"
                  },
                  "Budget": {
                    "type": "number"
                  },
                  "Category": {
                    "type": "string"
                  },
                  "Client": {
                    "type": "array"
                  },
                  "ContactId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DueDate": {
                    "type": "string"
                  },
                  "EndDate": {
                    "type": "string"
                  },
                  "Group": {
                    "type": "array"
                  },
                  "HourlyRate": {
                    "type": "number"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsBoard": {
                    "type": "boolean"
                  },
                  "MilestoneDue": {
                    "type": "string"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "NextMilestone": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "object"
                  },
                  "Priority": {
                    "type": "string"
                  },
                  "Progress": {
                    "type": "integer"
                  },
                  "ProjectHealth": {
                    "type": "string"
                  },
                  "Risks": {
                    "type": "integer"
                  },
                  "Spent": {
                    "type": "number"
                  },
                  "StartDate": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "Tags": {
                    "type": "array"
                  },
                  "Team": {
                    "type": "array"
                  },
                  "TimeEstimated": {
                    "type": "number"
                  },
                  "TimeTracked": {
                    "type": "number"
                  },
                  "TotalExpenses": {
                    "type": "number"
                  },
                  "TotalIncome": {
                    "type": "number"
                  },
                  "UnbilledExpenses": {
                    "type": "number"
                  },
                  "UnbilledTime": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `project`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateProject",
        "summary": "Update project record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `project` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/project.grpc` → `updateProjects`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"projects:write\")`.",
        "tags": [
          "project"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "projects:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Project"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Project` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Project"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/project.grpc",
        "x-hellobooks-handler": "updateProjects",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "projects:write"
        ],
        "x-hellobooks-scope-domain": "projects",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Attachment": {
                    "type": "string"
                  },
                  "Billable": {
                    "type": "boolean"
                  },
                  "BoardData": {
                    "type": "string"
                  },
                  "Budget": {
                    "type": "number"
                  },
                  "Category": {
                    "type": "string"
                  },
                  "Client": {
                    "type": "array"
                  },
                  "ContactId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DueDate": {
                    "type": "string"
                  },
                  "EndDate": {
                    "type": "string"
                  },
                  "Group": {
                    "type": "array"
                  },
                  "HourlyRate": {
                    "type": "number"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsBoard": {
                    "type": "boolean"
                  },
                  "MilestoneDue": {
                    "type": "string"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "NextMilestone": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "object"
                  },
                  "Priority": {
                    "type": "string"
                  },
                  "Progress": {
                    "type": "integer"
                  },
                  "ProjectHealth": {
                    "type": "string"
                  },
                  "Risks": {
                    "type": "integer"
                  },
                  "Spent": {
                    "type": "number"
                  },
                  "StartDate": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "Tags": {
                    "type": "array"
                  },
                  "Team": {
                    "type": "array"
                  },
                  "TimeEstimated": {
                    "type": "number"
                  },
                  "TimeTracked": {
                    "type": "number"
                  },
                  "TotalExpenses": {
                    "type": "number"
                  },
                  "TotalIncome": {
                    "type": "number"
                  },
                  "UnbilledExpenses": {
                    "type": "number"
                  },
                  "UnbilledTime": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `project`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteProject",
        "summary": "Delete project record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `project` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/project.grpc` → `deleteProjects`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"projects:write\")`.",
        "tags": [
          "project"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "projects:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Project"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Project` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Project"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/project.grpc",
        "x-hellobooks-handler": "deleteProjects",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "projects:write"
        ],
        "x-hellobooks-scope-domain": "projects",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Attachment": {
                    "type": "string"
                  },
                  "Billable": {
                    "type": "boolean"
                  },
                  "BoardData": {
                    "type": "string"
                  },
                  "Budget": {
                    "type": "number"
                  },
                  "Category": {
                    "type": "string"
                  },
                  "Client": {
                    "type": "array"
                  },
                  "ContactId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DueDate": {
                    "type": "string"
                  },
                  "EndDate": {
                    "type": "string"
                  },
                  "Group": {
                    "type": "array"
                  },
                  "HourlyRate": {
                    "type": "number"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsBoard": {
                    "type": "boolean"
                  },
                  "MilestoneDue": {
                    "type": "string"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "NextMilestone": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "object"
                  },
                  "Priority": {
                    "type": "string"
                  },
                  "Progress": {
                    "type": "integer"
                  },
                  "ProjectHealth": {
                    "type": "string"
                  },
                  "Risks": {
                    "type": "integer"
                  },
                  "Spent": {
                    "type": "number"
                  },
                  "StartDate": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "Tags": {
                    "type": "array"
                  },
                  "Team": {
                    "type": "array"
                  },
                  "TimeEstimated": {
                    "type": "number"
                  },
                  "TimeTracked": {
                    "type": "number"
                  },
                  "TotalExpenses": {
                    "type": "number"
                  },
                  "TotalIncome": {
                    "type": "number"
                  },
                  "UnbilledExpenses": {
                    "type": "number"
                  },
                  "UnbilledTime": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `project`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/project/restore": {
      "put": {
        "operationId": "restoreProject",
        "summary": "Restore archived project record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `project` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/project.grpc` → `restoreProjects`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"projects:write\")`.",
        "tags": [
          "project"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "projects:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Project"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Project` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Project"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/project.grpc",
        "x-hellobooks-handler": "restoreProjects",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "projects:write"
        ],
        "x-hellobooks-scope-domain": "projects",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Attachment": {
                    "type": "string"
                  },
                  "Billable": {
                    "type": "boolean"
                  },
                  "BoardData": {
                    "type": "string"
                  },
                  "Budget": {
                    "type": "number"
                  },
                  "Category": {
                    "type": "string"
                  },
                  "Client": {
                    "type": "array"
                  },
                  "ContactId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DueDate": {
                    "type": "string"
                  },
                  "EndDate": {
                    "type": "string"
                  },
                  "Group": {
                    "type": "array"
                  },
                  "HourlyRate": {
                    "type": "number"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsBoard": {
                    "type": "boolean"
                  },
                  "MilestoneDue": {
                    "type": "string"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "NextMilestone": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "object"
                  },
                  "Priority": {
                    "type": "string"
                  },
                  "Progress": {
                    "type": "integer"
                  },
                  "ProjectHealth": {
                    "type": "string"
                  },
                  "Risks": {
                    "type": "integer"
                  },
                  "Spent": {
                    "type": "number"
                  },
                  "StartDate": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "Tags": {
                    "type": "array"
                  },
                  "Team": {
                    "type": "array"
                  },
                  "TimeEstimated": {
                    "type": "number"
                  },
                  "TimeTracked": {
                    "type": "number"
                  },
                  "TotalExpenses": {
                    "type": "number"
                  },
                  "TotalIncome": {
                    "type": "number"
                  },
                  "UnbilledExpenses": {
                    "type": "number"
                  },
                  "UnbilledTime": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `project`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/project/{id}": {
      "get": {
        "operationId": "getProject",
        "summary": "Fetch one project record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `project` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/project.grpc` → `getProjectById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"projects:read\")`.",
        "tags": [
          "project"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "projects:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Project"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Project` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Project"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/project.grpc",
        "x-hellobooks-handler": "getProjectById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "projects:read"
        ],
        "x-hellobooks-scope-domain": "projects"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/purchaseCreditNote": {
      "get": {
        "operationId": "listPurchaseCreditNote",
        "summary": "List purchaseCreditNote records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseCreditNote` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseCreditNote.grpc` → `getPurchaseCreditNotes`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "purchaseCreditNote"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/PurchaseCreditNote"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `PurchaseCreditNote` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/PurchaseCreditNote"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseCreditNote.grpc",
        "x-hellobooks-handler": "getPurchaseCreditNotes",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      },
      "post": {
        "operationId": "createPurchaseCreditNote",
        "summary": "Create purchaseCreditNote record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseCreditNote` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseCreditNote.grpc` → `createPurchaseCreditNotes`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseCreditNote"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseCreditNote"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseCreditNote` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseCreditNote"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseCreditNote.grpc",
        "x-hellobooks-handler": "createPurchaseCreditNotes",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AmountApplied": {
                    "type": "number"
                  },
                  "AmountRefunded": {
                    "type": "number"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BillRef": {
                    "type": "string"
                  },
                  "Branding": {
                    "type": "string"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DifferentialPercent": {
                    "type": "number"
                  },
                  "EwbGeneratedAt": {
                    "type": "string"
                  },
                  "EwbNo": {
                    "type": "string"
                  },
                  "EwbRefId": {
                    "type": "string"
                  },
                  "EwbStatus": {
                    "type": "string"
                  },
                  "EwbValidUpto": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExcludeFromEwb": {
                    "type": "boolean"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FunctionalTotalAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "GoodsReceiptNoteRefId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsITCReversal": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "OriginalBillDate": {
                    "type": "string"
                  },
                  "OriginalBillNo": {
                    "type": "string"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "PurchaseCreditNoteNumber": {
                    "type": "string"
                  },
                  "PurchaseCreditNoteType": {
                    "type": "string"
                  },
                  "Purpose": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "RemainingAmount": {
                    "type": "number"
                  },
                  "ReturnReason": {
                    "type": "string"
                  },
                  "SellerGSTIN": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyNumber": {
                    "type": "string"
                  },
                  "TallyVoucherSeries": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TotalAmount": {
                    "type": "number"
                  },
                  "TotalCGST": {
                    "type": "number"
                  },
                  "TotalCess": {
                    "type": "number"
                  },
                  "TotalCessNonAdvalorem": {
                    "type": "number"
                  },
                  "TotalIGST": {
                    "type": "number"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalSGST": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "VendorCreditNoteDate": {
                    "type": "string"
                  },
                  "VendorCreditNoteNo": {
                    "type": "string"
                  },
                  "VendorRef": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `purchaseCreditNote`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updatePurchaseCreditNote",
        "summary": "Update purchaseCreditNote record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseCreditNote` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseCreditNote.grpc` → `updatePurchaseCreditNotes`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseCreditNote"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseCreditNote"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseCreditNote` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseCreditNote"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseCreditNote.grpc",
        "x-hellobooks-handler": "updatePurchaseCreditNotes",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AmountApplied": {
                    "type": "number"
                  },
                  "AmountRefunded": {
                    "type": "number"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BillRef": {
                    "type": "string"
                  },
                  "Branding": {
                    "type": "string"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DifferentialPercent": {
                    "type": "number"
                  },
                  "EwbGeneratedAt": {
                    "type": "string"
                  },
                  "EwbNo": {
                    "type": "string"
                  },
                  "EwbRefId": {
                    "type": "string"
                  },
                  "EwbStatus": {
                    "type": "string"
                  },
                  "EwbValidUpto": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExcludeFromEwb": {
                    "type": "boolean"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FunctionalTotalAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "GoodsReceiptNoteRefId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsITCReversal": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "OriginalBillDate": {
                    "type": "string"
                  },
                  "OriginalBillNo": {
                    "type": "string"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "PurchaseCreditNoteNumber": {
                    "type": "string"
                  },
                  "PurchaseCreditNoteType": {
                    "type": "string"
                  },
                  "Purpose": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "RemainingAmount": {
                    "type": "number"
                  },
                  "ReturnReason": {
                    "type": "string"
                  },
                  "SellerGSTIN": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyNumber": {
                    "type": "string"
                  },
                  "TallyVoucherSeries": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TotalAmount": {
                    "type": "number"
                  },
                  "TotalCGST": {
                    "type": "number"
                  },
                  "TotalCess": {
                    "type": "number"
                  },
                  "TotalCessNonAdvalorem": {
                    "type": "number"
                  },
                  "TotalIGST": {
                    "type": "number"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalSGST": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "VendorCreditNoteDate": {
                    "type": "string"
                  },
                  "VendorCreditNoteNo": {
                    "type": "string"
                  },
                  "VendorRef": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `purchaseCreditNote`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deletePurchaseCreditNote",
        "summary": "Delete purchaseCreditNote record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseCreditNote` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseCreditNote.grpc` → `deletePurchaseCreditNotes`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseCreditNote"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseCreditNote"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseCreditNote` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseCreditNote"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseCreditNote.grpc",
        "x-hellobooks-handler": "deletePurchaseCreditNotes",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AmountApplied": {
                    "type": "number"
                  },
                  "AmountRefunded": {
                    "type": "number"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BillRef": {
                    "type": "string"
                  },
                  "Branding": {
                    "type": "string"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DifferentialPercent": {
                    "type": "number"
                  },
                  "EwbGeneratedAt": {
                    "type": "string"
                  },
                  "EwbNo": {
                    "type": "string"
                  },
                  "EwbRefId": {
                    "type": "string"
                  },
                  "EwbStatus": {
                    "type": "string"
                  },
                  "EwbValidUpto": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExcludeFromEwb": {
                    "type": "boolean"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FunctionalTotalAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "GoodsReceiptNoteRefId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsITCReversal": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "OriginalBillDate": {
                    "type": "string"
                  },
                  "OriginalBillNo": {
                    "type": "string"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "PurchaseCreditNoteNumber": {
                    "type": "string"
                  },
                  "PurchaseCreditNoteType": {
                    "type": "string"
                  },
                  "Purpose": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "RemainingAmount": {
                    "type": "number"
                  },
                  "ReturnReason": {
                    "type": "string"
                  },
                  "SellerGSTIN": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyNumber": {
                    "type": "string"
                  },
                  "TallyVoucherSeries": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TotalAmount": {
                    "type": "number"
                  },
                  "TotalCGST": {
                    "type": "number"
                  },
                  "TotalCess": {
                    "type": "number"
                  },
                  "TotalCessNonAdvalorem": {
                    "type": "number"
                  },
                  "TotalIGST": {
                    "type": "number"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalSGST": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "VendorCreditNoteDate": {
                    "type": "string"
                  },
                  "VendorCreditNoteNo": {
                    "type": "string"
                  },
                  "VendorRef": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `purchaseCreditNote`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/purchaseCreditNote/restore": {
      "put": {
        "operationId": "restorePurchaseCreditNote",
        "summary": "Restore archived purchaseCreditNote record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseCreditNote` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseCreditNote.grpc` → `restorePurchaseCreditNotes`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseCreditNote"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseCreditNote"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseCreditNote` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseCreditNote"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseCreditNote.grpc",
        "x-hellobooks-handler": "restorePurchaseCreditNotes",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AmountApplied": {
                    "type": "number"
                  },
                  "AmountRefunded": {
                    "type": "number"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BillRef": {
                    "type": "string"
                  },
                  "Branding": {
                    "type": "string"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DifferentialPercent": {
                    "type": "number"
                  },
                  "EwbGeneratedAt": {
                    "type": "string"
                  },
                  "EwbNo": {
                    "type": "string"
                  },
                  "EwbRefId": {
                    "type": "string"
                  },
                  "EwbStatus": {
                    "type": "string"
                  },
                  "EwbValidUpto": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExcludeFromEwb": {
                    "type": "boolean"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FunctionalTotalAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "GoodsReceiptNoteRefId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsITCReversal": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "OriginalBillDate": {
                    "type": "string"
                  },
                  "OriginalBillNo": {
                    "type": "string"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "PurchaseCreditNoteNumber": {
                    "type": "string"
                  },
                  "PurchaseCreditNoteType": {
                    "type": "string"
                  },
                  "Purpose": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "RemainingAmount": {
                    "type": "number"
                  },
                  "ReturnReason": {
                    "type": "string"
                  },
                  "SellerGSTIN": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyNumber": {
                    "type": "string"
                  },
                  "TallyVoucherSeries": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TotalAmount": {
                    "type": "number"
                  },
                  "TotalCGST": {
                    "type": "number"
                  },
                  "TotalCess": {
                    "type": "number"
                  },
                  "TotalCessNonAdvalorem": {
                    "type": "number"
                  },
                  "TotalIGST": {
                    "type": "number"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalSGST": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "VendorCreditNoteDate": {
                    "type": "string"
                  },
                  "VendorCreditNoteNo": {
                    "type": "string"
                  },
                  "VendorRef": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `purchaseCreditNote`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/purchaseCreditNote/{id}": {
      "get": {
        "operationId": "getPurchaseCreditNote",
        "summary": "Fetch one purchaseCreditNote record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseCreditNote` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseCreditNote.grpc` → `getPurchaseCreditNoteById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "purchaseCreditNote"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseCreditNote"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseCreditNote` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseCreditNote"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseCreditNote.grpc",
        "x-hellobooks-handler": "getPurchaseCreditNoteById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/purchaseCreditNoteLine": {
      "post": {
        "operationId": "createPurchaseCreditNoteLine",
        "summary": "Create purchaseCreditNoteLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseCreditNoteLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseCreditNoteLine.grpc` → `createPurchaseCreditNoteLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseCreditNoteLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseCreditNoteLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseCreditNoteLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseCreditNoteLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseCreditNoteLine.grpc",
        "x-hellobooks-handler": "createPurchaseCreditNoteLines",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "CGSTAmount": {
                    "type": "number"
                  },
                  "CGSTRate": {
                    "type": "number"
                  },
                  "CessAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremRate": {
                    "type": "number"
                  },
                  "CessRate": {
                    "type": "number"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "GSTRate": {
                    "type": "number"
                  },
                  "HSNCode": {
                    "type": "string"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IGSTAmount": {
                    "type": "number"
                  },
                  "IGSTRate": {
                    "type": "number"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LabourAccountHeadRef": {
                    "type": "string"
                  },
                  "LabourAmount": {
                    "type": "number"
                  },
                  "LabourHSN_SAC": {
                    "type": "string"
                  },
                  "LabourRate": {
                    "type": "number"
                  },
                  "LabourTaxAmount": {
                    "type": "number"
                  },
                  "LabourTaxRate": {
                    "type": "number"
                  },
                  "LabourTaxRefId": {
                    "type": "string"
                  },
                  "LineExchangeRate": {
                    "type": "number"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "MarginValue": {
                    "type": "number"
                  },
                  "NCCDAmount": {
                    "type": "number"
                  },
                  "NCCDRate": {
                    "type": "number"
                  },
                  "ProjectRefId": {
                    "type": "string"
                  },
                  "PurchaseCreditNoteId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "SGSTAmount": {
                    "type": "number"
                  },
                  "SGSTRate": {
                    "type": "number"
                  },
                  "SupplyAmount": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxClassification": {
                    "type": "string"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "UTGSTAmount": {
                    "type": "number"
                  },
                  "UTGSTRate": {
                    "type": "number"
                  },
                  "UnitRefId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `purchaseCreditNoteLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updatePurchaseCreditNoteLine",
        "summary": "Update purchaseCreditNoteLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseCreditNoteLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseCreditNoteLine.grpc` → `updatePurchaseCreditNoteLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseCreditNoteLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseCreditNoteLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseCreditNoteLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseCreditNoteLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseCreditNoteLine.grpc",
        "x-hellobooks-handler": "updatePurchaseCreditNoteLines",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "CGSTAmount": {
                    "type": "number"
                  },
                  "CGSTRate": {
                    "type": "number"
                  },
                  "CessAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremRate": {
                    "type": "number"
                  },
                  "CessRate": {
                    "type": "number"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "GSTRate": {
                    "type": "number"
                  },
                  "HSNCode": {
                    "type": "string"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IGSTAmount": {
                    "type": "number"
                  },
                  "IGSTRate": {
                    "type": "number"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LabourAccountHeadRef": {
                    "type": "string"
                  },
                  "LabourAmount": {
                    "type": "number"
                  },
                  "LabourHSN_SAC": {
                    "type": "string"
                  },
                  "LabourRate": {
                    "type": "number"
                  },
                  "LabourTaxAmount": {
                    "type": "number"
                  },
                  "LabourTaxRate": {
                    "type": "number"
                  },
                  "LabourTaxRefId": {
                    "type": "string"
                  },
                  "LineExchangeRate": {
                    "type": "number"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "MarginValue": {
                    "type": "number"
                  },
                  "NCCDAmount": {
                    "type": "number"
                  },
                  "NCCDRate": {
                    "type": "number"
                  },
                  "ProjectRefId": {
                    "type": "string"
                  },
                  "PurchaseCreditNoteId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "SGSTAmount": {
                    "type": "number"
                  },
                  "SGSTRate": {
                    "type": "number"
                  },
                  "SupplyAmount": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxClassification": {
                    "type": "string"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "UTGSTAmount": {
                    "type": "number"
                  },
                  "UTGSTRate": {
                    "type": "number"
                  },
                  "UnitRefId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `purchaseCreditNoteLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deletePurchaseCreditNoteLine",
        "summary": "Delete purchaseCreditNoteLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseCreditNoteLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseCreditNoteLine.grpc` → `deletePurchaseCreditNoteLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseCreditNoteLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseCreditNoteLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseCreditNoteLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseCreditNoteLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseCreditNoteLine.grpc",
        "x-hellobooks-handler": "deletePurchaseCreditNoteLines",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "CGSTAmount": {
                    "type": "number"
                  },
                  "CGSTRate": {
                    "type": "number"
                  },
                  "CessAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremRate": {
                    "type": "number"
                  },
                  "CessRate": {
                    "type": "number"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "GSTRate": {
                    "type": "number"
                  },
                  "HSNCode": {
                    "type": "string"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IGSTAmount": {
                    "type": "number"
                  },
                  "IGSTRate": {
                    "type": "number"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LabourAccountHeadRef": {
                    "type": "string"
                  },
                  "LabourAmount": {
                    "type": "number"
                  },
                  "LabourHSN_SAC": {
                    "type": "string"
                  },
                  "LabourRate": {
                    "type": "number"
                  },
                  "LabourTaxAmount": {
                    "type": "number"
                  },
                  "LabourTaxRate": {
                    "type": "number"
                  },
                  "LabourTaxRefId": {
                    "type": "string"
                  },
                  "LineExchangeRate": {
                    "type": "number"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "MarginValue": {
                    "type": "number"
                  },
                  "NCCDAmount": {
                    "type": "number"
                  },
                  "NCCDRate": {
                    "type": "number"
                  },
                  "ProjectRefId": {
                    "type": "string"
                  },
                  "PurchaseCreditNoteId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "SGSTAmount": {
                    "type": "number"
                  },
                  "SGSTRate": {
                    "type": "number"
                  },
                  "SupplyAmount": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxClassification": {
                    "type": "string"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "UTGSTAmount": {
                    "type": "number"
                  },
                  "UTGSTRate": {
                    "type": "number"
                  },
                  "UnitRefId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `purchaseCreditNoteLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/purchaseCreditNoteLine/{id}": {
      "get": {
        "operationId": "getPurchaseCreditNoteLine",
        "summary": "Fetch one purchaseCreditNoteLine record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseCreditNoteLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseCreditNoteLine.grpc` → `getPurchaseCreditNoteLineById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "purchaseCreditNoteLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseCreditNoteLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseCreditNoteLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseCreditNoteLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseCreditNoteLine.grpc",
        "x-hellobooks-handler": "getPurchaseCreditNoteLineById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/purchaseOrder": {
      "get": {
        "operationId": "listPurchaseOrder",
        "summary": "List purchaseOrder records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseOrder` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseOrder.grpc` → `getPurchaseOrders`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "purchaseOrder"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/PurchaseOrder"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `PurchaseOrder` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/PurchaseOrder"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseOrder.grpc",
        "x-hellobooks-handler": "getPurchaseOrders",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      },
      "post": {
        "operationId": "createPurchaseOrder",
        "summary": "Create purchaseOrder record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseOrder` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseOrder.grpc` → `createPurchaseOrders`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseOrder"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseOrder"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseOrder` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseOrder"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseOrder.grpc",
        "x-hellobooks-handler": "createPurchaseOrders",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AcceptedByVendorAt": {
                    "type": "string"
                  },
                  "Addresses": {
                    "type": "array"
                  },
                  "ApprovalComment": {
                    "type": "string"
                  },
                  "ApprovalStatus": {
                    "type": "string"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BrandingThemeId": {
                    "type": "string"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CreatedByName": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DeclinedByVendorAt": {
                    "type": "string"
                  },
                  "DeclinedReason": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpectedDeliveryDate": {
                    "type": "string"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FunctionalTotalPayableAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "PurchaseOrderNumber": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "ReceiptStatus": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  },
                  "chartOfAccountId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `purchaseOrder`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updatePurchaseOrder",
        "summary": "Update purchaseOrder record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseOrder` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseOrder.grpc` → `updatePurchaseOrders`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseOrder"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseOrder"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseOrder` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseOrder"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseOrder.grpc",
        "x-hellobooks-handler": "updatePurchaseOrders",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AcceptedByVendorAt": {
                    "type": "string"
                  },
                  "Addresses": {
                    "type": "array"
                  },
                  "ApprovalComment": {
                    "type": "string"
                  },
                  "ApprovalStatus": {
                    "type": "string"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BrandingThemeId": {
                    "type": "string"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CreatedByName": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DeclinedByVendorAt": {
                    "type": "string"
                  },
                  "DeclinedReason": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpectedDeliveryDate": {
                    "type": "string"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FunctionalTotalPayableAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "PurchaseOrderNumber": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "ReceiptStatus": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  },
                  "chartOfAccountId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `purchaseOrder`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deletePurchaseOrder",
        "summary": "Delete purchaseOrder record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseOrder` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseOrder.grpc` → `deletePurchaseOrders`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseOrder"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseOrder"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseOrder` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseOrder"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseOrder.grpc",
        "x-hellobooks-handler": "deletePurchaseOrders",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AcceptedByVendorAt": {
                    "type": "string"
                  },
                  "Addresses": {
                    "type": "array"
                  },
                  "ApprovalComment": {
                    "type": "string"
                  },
                  "ApprovalStatus": {
                    "type": "string"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BrandingThemeId": {
                    "type": "string"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CreatedByName": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DeclinedByVendorAt": {
                    "type": "string"
                  },
                  "DeclinedReason": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpectedDeliveryDate": {
                    "type": "string"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FunctionalTotalPayableAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "PurchaseOrderNumber": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "ReceiptStatus": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  },
                  "chartOfAccountId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `purchaseOrder`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/purchaseOrder/restore": {
      "put": {
        "operationId": "restorePurchaseOrder",
        "summary": "Restore archived purchaseOrder record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseOrder` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseOrder.grpc` → `restorePurchaseOrders`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseOrder"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseOrder"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseOrder` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseOrder"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseOrder.grpc",
        "x-hellobooks-handler": "restorePurchaseOrders",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AcceptedByVendorAt": {
                    "type": "string"
                  },
                  "Addresses": {
                    "type": "array"
                  },
                  "ApprovalComment": {
                    "type": "string"
                  },
                  "ApprovalStatus": {
                    "type": "string"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BrandingThemeId": {
                    "type": "string"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CreatedByName": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DeclinedByVendorAt": {
                    "type": "string"
                  },
                  "DeclinedReason": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpectedDeliveryDate": {
                    "type": "string"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FunctionalTotalPayableAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "PurchaseOrderNumber": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "ReceiptStatus": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  },
                  "chartOfAccountId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `purchaseOrder`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/purchaseOrder/{id}": {
      "get": {
        "operationId": "getPurchaseOrder",
        "summary": "Fetch one purchaseOrder record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseOrder` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseOrder.grpc` → `getPurchaseOrderById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "purchaseOrder"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseOrder"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseOrder` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseOrder"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseOrder.grpc",
        "x-hellobooks-handler": "getPurchaseOrderById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/purchaseOrderAddress": {
      "get": {
        "operationId": "listPurchaseOrderAddress",
        "summary": "List purchaseOrderAddress records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseOrderAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseOrderAddress.grpc` → `getPurchaseOrderAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "purchaseOrderAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/PurchaseOrderAddress"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `PurchaseOrderAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/PurchaseOrderAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseOrderAddress.grpc",
        "x-hellobooks-handler": "getPurchaseOrderAddresses",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      },
      "post": {
        "operationId": "createPurchaseOrderAddress",
        "summary": "Create purchaseOrderAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseOrderAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseOrderAddress.grpc` → `createPurchaseOrderAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseOrderAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseOrderAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseOrderAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseOrderAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseOrderAddress.grpc",
        "x-hellobooks-handler": "createPurchaseOrderAddresses",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `create` on `purchaseOrderAddress`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. In addition, this gateway delegates straight to the internal controller, which in several cases expects the records under a resource-named wrapper key. This resource does not declare one — its create and update handlers disagree about the key, or it takes no records array at all — so the accepted envelope is not described here rather than guessed at.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updatePurchaseOrderAddress",
        "summary": "Update purchaseOrderAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseOrderAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseOrderAddress.grpc` → `updatePurchaseOrderAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseOrderAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseOrderAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseOrderAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseOrderAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseOrderAddress.grpc",
        "x-hellobooks-handler": "updatePurchaseOrderAddresses",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `update` on `purchaseOrderAddress`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. In addition, this gateway delegates straight to the internal controller, which in several cases expects the records under a resource-named wrapper key. This resource does not declare one — its create and update handlers disagree about the key, or it takes no records array at all — so the accepted envelope is not described here rather than guessed at.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deletePurchaseOrderAddress",
        "summary": "Delete purchaseOrderAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseOrderAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseOrderAddress.grpc` → `deletePurchaseOrderAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseOrderAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseOrderAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseOrderAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseOrderAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseOrderAddress.grpc",
        "x-hellobooks-handler": "deletePurchaseOrderAddresses",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `del` on `purchaseOrderAddress`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. In addition, this gateway delegates straight to the internal controller, which in several cases expects the records under a resource-named wrapper key. This resource does not declare one — its create and update handlers disagree about the key, or it takes no records array at all — so the accepted envelope is not described here rather than guessed at.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/purchaseOrderAddress/restore": {
      "put": {
        "operationId": "restorePurchaseOrderAddress",
        "summary": "Restore archived purchaseOrderAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseOrderAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseOrderAddress.grpc` → `restorePurchaseOrderAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseOrderAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseOrderAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseOrderAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseOrderAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseOrderAddress.grpc",
        "x-hellobooks-handler": "restorePurchaseOrderAddresses",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `restore` on `purchaseOrderAddress`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. In addition, this gateway delegates straight to the internal controller, which in several cases expects the records under a resource-named wrapper key. This resource does not declare one — its create and update handlers disagree about the key, or it takes no records array at all — so the accepted envelope is not described here rather than guessed at.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/purchaseOrderAddress/{id}": {
      "get": {
        "operationId": "getPurchaseOrderAddress",
        "summary": "Fetch one purchaseOrderAddress record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseOrderAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseOrderAddress.grpc` → `getPurchaseOrderAddressById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "purchaseOrderAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseOrderAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseOrderAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseOrderAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseOrderAddress.grpc",
        "x-hellobooks-handler": "getPurchaseOrderAddressById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/purchaseOrderLine": {
      "post": {
        "operationId": "createPurchaseOrderLine",
        "summary": "Create purchaseOrderLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseOrderLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseOrderLine.grpc` → `createPurchaseOrderLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseOrderLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseOrderLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseOrderLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseOrderLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseOrderLine.grpc",
        "x-hellobooks-handler": "createPurchaseOrderLines",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "BrandRefId": {
                    "type": "string"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "CostCodeRefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DiscountAmount": {
                    "type": "number"
                  },
                  "DiscountPercentage": {
                    "type": "number"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IsDiscountBeforeTax": {
                    "type": "boolean"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LabourAccountHeadRef": {
                    "type": "string"
                  },
                  "LabourAmount": {
                    "type": "number"
                  },
                  "LabourHSN_SAC": {
                    "type": "string"
                  },
                  "LabourRate": {
                    "type": "number"
                  },
                  "LabourTaxAmount": {
                    "type": "number"
                  },
                  "LabourTaxRate": {
                    "type": "number"
                  },
                  "LabourTaxRefId": {
                    "type": "string"
                  },
                  "LineExchangeRate": {
                    "type": "number"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "PurchaseOrderId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "SupplyAmount": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "UnitRefId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `purchaseOrderLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updatePurchaseOrderLine",
        "summary": "Update purchaseOrderLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseOrderLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseOrderLine.grpc` → `updatePurchaseOrderLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseOrderLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseOrderLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseOrderLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseOrderLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseOrderLine.grpc",
        "x-hellobooks-handler": "updatePurchaseOrderLines",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "BrandRefId": {
                    "type": "string"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "CostCodeRefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DiscountAmount": {
                    "type": "number"
                  },
                  "DiscountPercentage": {
                    "type": "number"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IsDiscountBeforeTax": {
                    "type": "boolean"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LabourAccountHeadRef": {
                    "type": "string"
                  },
                  "LabourAmount": {
                    "type": "number"
                  },
                  "LabourHSN_SAC": {
                    "type": "string"
                  },
                  "LabourRate": {
                    "type": "number"
                  },
                  "LabourTaxAmount": {
                    "type": "number"
                  },
                  "LabourTaxRate": {
                    "type": "number"
                  },
                  "LabourTaxRefId": {
                    "type": "string"
                  },
                  "LineExchangeRate": {
                    "type": "number"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "PurchaseOrderId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "SupplyAmount": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "UnitRefId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `purchaseOrderLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deletePurchaseOrderLine",
        "summary": "Delete purchaseOrderLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseOrderLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseOrderLine.grpc` → `deletePurchaseOrderLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseOrderLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseOrderLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseOrderLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseOrderLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseOrderLine.grpc",
        "x-hellobooks-handler": "deletePurchaseOrderLines",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "BrandRefId": {
                    "type": "string"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "CostCodeRefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DiscountAmount": {
                    "type": "number"
                  },
                  "DiscountPercentage": {
                    "type": "number"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IsDiscountBeforeTax": {
                    "type": "boolean"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LabourAccountHeadRef": {
                    "type": "string"
                  },
                  "LabourAmount": {
                    "type": "number"
                  },
                  "LabourHSN_SAC": {
                    "type": "string"
                  },
                  "LabourRate": {
                    "type": "number"
                  },
                  "LabourTaxAmount": {
                    "type": "number"
                  },
                  "LabourTaxRate": {
                    "type": "number"
                  },
                  "LabourTaxRefId": {
                    "type": "string"
                  },
                  "LineExchangeRate": {
                    "type": "number"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "PurchaseOrderId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "SupplyAmount": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "UnitRefId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `purchaseOrderLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/purchaseOrderLine/{id}": {
      "get": {
        "operationId": "getPurchaseOrderLine",
        "summary": "Fetch one purchaseOrderLine record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseOrderLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseOrderLine.grpc` → `getPurchaseOrderLineById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "purchaseOrderLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseOrderLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseOrderLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseOrderLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseOrderLine.grpc",
        "x-hellobooks-handler": "getPurchaseOrderLineById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/purchaseRequest": {
      "get": {
        "operationId": "listPurchaseRequest",
        "summary": "List purchaseRequest records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseRequest` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseRequest.grpc` → `getPurchaseRequests`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "purchaseRequest"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/PurchaseRequest"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `PurchaseRequest` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/PurchaseRequest"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseRequest.grpc",
        "x-hellobooks-handler": "getPurchaseRequests",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      },
      "post": {
        "operationId": "createPurchaseRequest",
        "summary": "Create purchaseRequest record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseRequest` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseRequest.grpc` → `createPurchaseRequests`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseRequest"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseRequest"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseRequest` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseRequest"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseRequest.grpc",
        "x-hellobooks-handler": "createPurchaseRequests",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Addresses": {
                    "type": "array"
                  },
                  "ApprovalComment": {
                    "type": "string"
                  },
                  "ApprovalStatus": {
                    "type": "string"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "ConvertedToPORef": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpectedDeliveryDate": {
                    "type": "string"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FunctionalTotalPayableAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "MRPRunRefId": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "PurchaseRequestNumber": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "chartOfAccountId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `purchaseRequest`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updatePurchaseRequest",
        "summary": "Update purchaseRequest record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseRequest` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseRequest.grpc` → `updatePurchaseRequests`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseRequest"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseRequest"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseRequest` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseRequest"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseRequest.grpc",
        "x-hellobooks-handler": "updatePurchaseRequests",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Addresses": {
                    "type": "array"
                  },
                  "ApprovalComment": {
                    "type": "string"
                  },
                  "ApprovalStatus": {
                    "type": "string"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "ConvertedToPORef": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpectedDeliveryDate": {
                    "type": "string"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FunctionalTotalPayableAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "MRPRunRefId": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "PurchaseRequestNumber": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "chartOfAccountId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `purchaseRequest`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deletePurchaseRequest",
        "summary": "Delete purchaseRequest record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseRequest` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseRequest.grpc` → `deletePurchaseRequests`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseRequest"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseRequest"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseRequest` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseRequest"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseRequest.grpc",
        "x-hellobooks-handler": "deletePurchaseRequests",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Addresses": {
                    "type": "array"
                  },
                  "ApprovalComment": {
                    "type": "string"
                  },
                  "ApprovalStatus": {
                    "type": "string"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "ConvertedToPORef": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpectedDeliveryDate": {
                    "type": "string"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FunctionalTotalPayableAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "MRPRunRefId": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "PurchaseRequestNumber": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "chartOfAccountId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `purchaseRequest`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/purchaseRequest/restore": {
      "put": {
        "operationId": "restorePurchaseRequest",
        "summary": "Restore archived purchaseRequest record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseRequest` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseRequest.grpc` → `restorePurchaseRequests`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseRequest"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseRequest"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseRequest` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseRequest"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseRequest.grpc",
        "x-hellobooks-handler": "restorePurchaseRequests",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Addresses": {
                    "type": "array"
                  },
                  "ApprovalComment": {
                    "type": "string"
                  },
                  "ApprovalStatus": {
                    "type": "string"
                  },
                  "ApprovedAt": {
                    "type": "string"
                  },
                  "ApprovedBy": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "ConvertedToPORef": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpectedDeliveryDate": {
                    "type": "string"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FunctionalTotalPayableAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "MRPRunRefId": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "PurchaseRequestNumber": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "chartOfAccountId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `purchaseRequest`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/purchaseRequest/{id}": {
      "get": {
        "operationId": "getPurchaseRequest",
        "summary": "Fetch one purchaseRequest record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseRequest` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseRequest.grpc` → `getPurchaseRequestById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "purchaseRequest"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseRequest"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseRequest` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseRequest"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseRequest.grpc",
        "x-hellobooks-handler": "getPurchaseRequestById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/purchaseRequestLine": {
      "post": {
        "operationId": "createPurchaseRequestLine",
        "summary": "Create purchaseRequestLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseRequestLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseRequestLine.grpc` → `createPurchaseRequestLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseRequestLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseRequestLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseRequestLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseRequestLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseRequestLine.grpc",
        "x-hellobooks-handler": "createPurchaseRequestLines",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DiscountAmount": {
                    "type": "number"
                  },
                  "DiscountPercentage": {
                    "type": "number"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IsDiscountBeforeTax": {
                    "type": "boolean"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "PurchaseRequestId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `purchaseRequestLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updatePurchaseRequestLine",
        "summary": "Update purchaseRequestLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseRequestLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseRequestLine.grpc` → `updatePurchaseRequestLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseRequestLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseRequestLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseRequestLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseRequestLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseRequestLine.grpc",
        "x-hellobooks-handler": "updatePurchaseRequestLines",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DiscountAmount": {
                    "type": "number"
                  },
                  "DiscountPercentage": {
                    "type": "number"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IsDiscountBeforeTax": {
                    "type": "boolean"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "PurchaseRequestId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `purchaseRequestLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deletePurchaseRequestLine",
        "summary": "Delete purchaseRequestLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseRequestLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseRequestLine.grpc` → `deletePurchaseRequestLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "purchaseRequestLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseRequestLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseRequestLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseRequestLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseRequestLine.grpc",
        "x-hellobooks-handler": "deletePurchaseRequestLines",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DiscountAmount": {
                    "type": "number"
                  },
                  "DiscountPercentage": {
                    "type": "number"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IsDiscountBeforeTax": {
                    "type": "boolean"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "PurchaseRequestId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `purchaseRequestLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/purchaseRequestLine/{id}": {
      "get": {
        "operationId": "getPurchaseRequestLine",
        "summary": "Fetch one purchaseRequestLine record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `purchaseRequestLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/purchaseRequestLine.grpc` → `getPurchaseRequestLineById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "purchaseRequestLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/PurchaseRequestLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `PurchaseRequestLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/PurchaseRequestLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/purchaseRequestLine.grpc",
        "x-hellobooks-handler": "getPurchaseRequestLineById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/quote": {
      "get": {
        "operationId": "listQuote",
        "summary": "List quote records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `quote` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/quote.grpc` → `getQuotes`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "quote"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Quote"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `Quote` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/Quote"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/quote.grpc",
        "x-hellobooks-handler": "getQuotes",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      },
      "post": {
        "operationId": "createQuote",
        "summary": "Create quote record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `quote` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/quote.grpc` → `createQuotes`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "quote"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Quote"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Quote` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Quote"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/quote.grpc",
        "x-hellobooks-handler": "createQuotes",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AdvanceReceived": {
                    "type": "string"
                  },
                  "ApprovalNote": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BrandingThemeId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpiryDate": {
                    "type": "string"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "ForceApproved": {
                    "type": "boolean"
                  },
                  "FunctionalTotalPayableAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsShippingSameAsBilling": {
                    "type": "boolean"
                  },
                  "IssueDate": {
                    "type": "string"
                  },
                  "MasterDiscountRef": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "QuoteNumber": {
                    "type": "string"
                  },
                  "QuoteType": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "SalesPerson": {
                    "type": "string"
                  },
                  "SalesPersonId": {
                    "type": "string"
                  },
                  "SelectedBillingAddressId": {
                    "type": "string"
                  },
                  "SelectedShippingAddressId": {
                    "type": "string"
                  },
                  "ShopifyDraftOrderId": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SyncedTo": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "Terms": {
                    "type": "object"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `quote`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateQuote",
        "summary": "Update quote record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `quote` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/quote.grpc` → `updateQuotes`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "quote"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Quote"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Quote` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Quote"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/quote.grpc",
        "x-hellobooks-handler": "updateQuotes",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AdvanceReceived": {
                    "type": "string"
                  },
                  "ApprovalNote": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BrandingThemeId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpiryDate": {
                    "type": "string"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "ForceApproved": {
                    "type": "boolean"
                  },
                  "FunctionalTotalPayableAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsShippingSameAsBilling": {
                    "type": "boolean"
                  },
                  "IssueDate": {
                    "type": "string"
                  },
                  "MasterDiscountRef": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "QuoteNumber": {
                    "type": "string"
                  },
                  "QuoteType": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "SalesPerson": {
                    "type": "string"
                  },
                  "SalesPersonId": {
                    "type": "string"
                  },
                  "SelectedBillingAddressId": {
                    "type": "string"
                  },
                  "SelectedShippingAddressId": {
                    "type": "string"
                  },
                  "ShopifyDraftOrderId": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SyncedTo": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "Terms": {
                    "type": "object"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `quote`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteQuote",
        "summary": "Delete quote record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `quote` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/quote.grpc` → `deleteQuotes`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "quote"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Quote"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Quote` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Quote"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/quote.grpc",
        "x-hellobooks-handler": "deleteQuotes",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AdvanceReceived": {
                    "type": "string"
                  },
                  "ApprovalNote": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BrandingThemeId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpiryDate": {
                    "type": "string"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "ForceApproved": {
                    "type": "boolean"
                  },
                  "FunctionalTotalPayableAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsShippingSameAsBilling": {
                    "type": "boolean"
                  },
                  "IssueDate": {
                    "type": "string"
                  },
                  "MasterDiscountRef": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "QuoteNumber": {
                    "type": "string"
                  },
                  "QuoteType": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "SalesPerson": {
                    "type": "string"
                  },
                  "SalesPersonId": {
                    "type": "string"
                  },
                  "SelectedBillingAddressId": {
                    "type": "string"
                  },
                  "SelectedShippingAddressId": {
                    "type": "string"
                  },
                  "ShopifyDraftOrderId": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SyncedTo": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "Terms": {
                    "type": "object"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `quote`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/quote/restore": {
      "put": {
        "operationId": "restoreQuote",
        "summary": "Restore archived quote record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `quote` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/quote.grpc` → `restoreQuotes`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "quote"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Quote"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Quote` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Quote"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/quote.grpc",
        "x-hellobooks-handler": "restoreQuotes",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AdvanceReceived": {
                    "type": "string"
                  },
                  "ApprovalNote": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BrandingThemeId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpiryDate": {
                    "type": "string"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "ForceApproved": {
                    "type": "boolean"
                  },
                  "FunctionalTotalPayableAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsShippingSameAsBilling": {
                    "type": "boolean"
                  },
                  "IssueDate": {
                    "type": "string"
                  },
                  "MasterDiscountRef": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "QuoteNumber": {
                    "type": "string"
                  },
                  "QuoteType": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "SalesPerson": {
                    "type": "string"
                  },
                  "SalesPersonId": {
                    "type": "string"
                  },
                  "SelectedBillingAddressId": {
                    "type": "string"
                  },
                  "SelectedShippingAddressId": {
                    "type": "string"
                  },
                  "ShopifyDraftOrderId": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SyncedTo": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "Terms": {
                    "type": "object"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `quote`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/quote/{id}": {
      "get": {
        "operationId": "getQuote",
        "summary": "Fetch one quote record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `quote` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/quote.grpc` → `getQuoteById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "quote"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Quote"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Quote` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Quote"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/quote.grpc",
        "x-hellobooks-handler": "getQuoteById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/quoteLine": {
      "delete": {
        "operationId": "deleteQuoteLine",
        "summary": "Delete quoteLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `quoteLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/quoteLine.grpc` → `deleteQuoteLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "quoteLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/QuoteLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `QuoteLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/QuoteLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/quoteLine.grpc",
        "x-hellobooks-handler": "deleteQuoteLines",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DiscountAmount": {
                    "type": "number"
                  },
                  "DiscountD2Amount": {
                    "type": "number"
                  },
                  "DiscountD2Percentage": {
                    "type": "number"
                  },
                  "DiscountD3Amount": {
                    "type": "number"
                  },
                  "DiscountD3Percentage": {
                    "type": "number"
                  },
                  "DiscountPercentage": {
                    "type": "number"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LabourAccountHeadRef": {
                    "type": "string"
                  },
                  "LabourAmount": {
                    "type": "number"
                  },
                  "LabourHSN_SAC": {
                    "type": "string"
                  },
                  "LabourRate": {
                    "type": "number"
                  },
                  "LabourTaxAmount": {
                    "type": "number"
                  },
                  "LabourTaxRate": {
                    "type": "number"
                  },
                  "LabourTaxRefId": {
                    "type": "string"
                  },
                  "LineExchangeRate": {
                    "type": "number"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "QuoteId": {
                    "type": "string"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "SupplyAmount": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRef": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `quoteLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/quoteLine/{id}": {
      "get": {
        "operationId": "getQuoteLine",
        "summary": "Fetch one quoteLine record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `quoteLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/quoteLine.grpc` → `getQuoteLineById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "quoteLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/QuoteLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `QuoteLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/QuoteLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/quoteLine.grpc",
        "x-hellobooks-handler": "getQuoteLineById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/reconcile-period": {
      "get": {
        "operationId": "listReconcile_period",
        "summary": "List reconcile-period records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `reconcile-period` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/reconcilePeriod.grpc` → `getReconcilePeriods`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:read\")`.",
        "tags": [
          "reconcile-period"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Reconcile_period"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `Reconcile_period` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/Reconcile_period"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/reconcilePeriod.grpc",
        "x-hellobooks-handler": "getReconcilePeriods",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:read"
        ],
        "x-hellobooks-scope-domain": "accounting"
      },
      "post": {
        "operationId": "createReconcile_period",
        "summary": "Create reconcile-period record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `reconcile-period` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/reconcilePeriod.grpc` → `createReconcilePeriods`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "reconcile-period"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Reconcile_period"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Reconcile_period` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Reconcile_period"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/reconcilePeriod.grpc",
        "x-hellobooks-handler": "createReconcilePeriods",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountRefId": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "AmountSign": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "ClosedAt": {
                    "type": "string"
                  },
                  "ClosedByName": {
                    "type": "string"
                  },
                  "ClosedByUserId": {
                    "type": "string"
                  },
                  "ClosingBalance": {
                    "type": "number"
                  },
                  "ClosingCurrencyRef": {
                    "type": "string"
                  },
                  "CreatedByName": {
                    "type": "string"
                  },
                  "CreatedByUserId": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LastReportGeneratedAt": {
                    "type": "string"
                  },
                  "LastReportGeneratedBy": {
                    "type": "string"
                  },
                  "OpeningBalance": {
                    "type": "number"
                  },
                  "OpeningCurrencyRef": {
                    "type": "string"
                  },
                  "PeriodEnd": {
                    "type": "string"
                  },
                  "PeriodStart": {
                    "type": "string"
                  },
                  "SourceDocumentUrl": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `reconcile-period`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateReconcile_period",
        "summary": "Update reconcile-period record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `reconcile-period` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/reconcilePeriod.grpc` → `updateReconcilePeriods`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "reconcile-period"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Reconcile_period"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Reconcile_period` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Reconcile_period"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/reconcilePeriod.grpc",
        "x-hellobooks-handler": "updateReconcilePeriods",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountRefId": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "AmountSign": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "ClosedAt": {
                    "type": "string"
                  },
                  "ClosedByName": {
                    "type": "string"
                  },
                  "ClosedByUserId": {
                    "type": "string"
                  },
                  "ClosingBalance": {
                    "type": "number"
                  },
                  "ClosingCurrencyRef": {
                    "type": "string"
                  },
                  "CreatedByName": {
                    "type": "string"
                  },
                  "CreatedByUserId": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LastReportGeneratedAt": {
                    "type": "string"
                  },
                  "LastReportGeneratedBy": {
                    "type": "string"
                  },
                  "OpeningBalance": {
                    "type": "number"
                  },
                  "OpeningCurrencyRef": {
                    "type": "string"
                  },
                  "PeriodEnd": {
                    "type": "string"
                  },
                  "PeriodStart": {
                    "type": "string"
                  },
                  "SourceDocumentUrl": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `reconcile-period`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteReconcile_period",
        "summary": "Delete reconcile-period record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `reconcile-period` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/reconcilePeriod.grpc` → `deleteReconcilePeriods`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "reconcile-period"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Reconcile_period"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Reconcile_period` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Reconcile_period"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/reconcilePeriod.grpc",
        "x-hellobooks-handler": "deleteReconcilePeriods",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountRefId": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "AmountSign": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "ClosedAt": {
                    "type": "string"
                  },
                  "ClosedByName": {
                    "type": "string"
                  },
                  "ClosedByUserId": {
                    "type": "string"
                  },
                  "ClosingBalance": {
                    "type": "number"
                  },
                  "ClosingCurrencyRef": {
                    "type": "string"
                  },
                  "CreatedByName": {
                    "type": "string"
                  },
                  "CreatedByUserId": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LastReportGeneratedAt": {
                    "type": "string"
                  },
                  "LastReportGeneratedBy": {
                    "type": "string"
                  },
                  "OpeningBalance": {
                    "type": "number"
                  },
                  "OpeningCurrencyRef": {
                    "type": "string"
                  },
                  "PeriodEnd": {
                    "type": "string"
                  },
                  "PeriodStart": {
                    "type": "string"
                  },
                  "SourceDocumentUrl": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `reconcile-period`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/reconcile-period/restore": {
      "put": {
        "operationId": "restoreReconcile_period",
        "summary": "Restore archived reconcile-period record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `reconcile-period` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/reconcilePeriod.grpc` → `restoreReconcilePeriods`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "reconcile-period"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Reconcile_period"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Reconcile_period` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Reconcile_period"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/reconcilePeriod.grpc",
        "x-hellobooks-handler": "restoreReconcilePeriods",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountRefId": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "AmountSign": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "ClosedAt": {
                    "type": "string"
                  },
                  "ClosedByName": {
                    "type": "string"
                  },
                  "ClosedByUserId": {
                    "type": "string"
                  },
                  "ClosingBalance": {
                    "type": "number"
                  },
                  "ClosingCurrencyRef": {
                    "type": "string"
                  },
                  "CreatedByName": {
                    "type": "string"
                  },
                  "CreatedByUserId": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LastReportGeneratedAt": {
                    "type": "string"
                  },
                  "LastReportGeneratedBy": {
                    "type": "string"
                  },
                  "OpeningBalance": {
                    "type": "number"
                  },
                  "OpeningCurrencyRef": {
                    "type": "string"
                  },
                  "PeriodEnd": {
                    "type": "string"
                  },
                  "PeriodStart": {
                    "type": "string"
                  },
                  "SourceDocumentUrl": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `reconcile-period`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/reconcile-period/{id}": {
      "get": {
        "operationId": "getReconcile_period",
        "summary": "Fetch one reconcile-period record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `reconcile-period` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/reconcilePeriod.grpc` → `getReconcilePeriodById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:read\")`.",
        "tags": [
          "reconcile-period"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Reconcile_period"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Reconcile_period` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Reconcile_period"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/reconcilePeriod.grpc",
        "x-hellobooks-handler": "getReconcilePeriodById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:read"
        ],
        "x-hellobooks-scope-domain": "accounting"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/recurringBill": {
      "get": {
        "operationId": "listRecurringBill",
        "summary": "List recurringBill records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringBill` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringBill.grpc` → `getRecurringBills`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "recurringBill"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/RecurringBill"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `RecurringBill` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/RecurringBill"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringBill.grpc",
        "x-hellobooks-handler": "getRecurringBills",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      },
      "post": {
        "operationId": "createRecurringBill",
        "summary": "Create recurringBill record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringBill` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringBill.grpc` → `createRecurringBills`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "recurringBill"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringBill"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringBill` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringBill"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringBill.grpc",
        "x-hellobooks-handler": "createRecurringBills",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Addresses": {
                    "type": "array"
                  },
                  "AutoGenerate": {
                    "type": "boolean"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CreatedById": {
                    "type": "string"
                  },
                  "CurrencyMismatchWarning": {
                    "type": "boolean"
                  },
                  "CurrencyRefId": {
                    "type": "string"
                  },
                  "DueDateType": {
                    "type": "string"
                  },
                  "DueOffsetDays": {
                    "type": "integer"
                  },
                  "EmailVendorOnGenerate": {
                    "type": "boolean"
                  },
                  "EnablePlaceholderParse": {
                    "type": "boolean"
                  },
                  "EndDate": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GoodsReceiptNoteRefId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LastGeneratedDate": {
                    "type": "string"
                  },
                  "MasterDiscountRef": {
                    "type": "string"
                  },
                  "NextScheduledDate": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "NotifyInternalEmails": {
                    "type": "array"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "Placeholder": {
                    "type": "string"
                  },
                  "PlannedPaymentDate": {
                    "type": "string"
                  },
                  "PurchaseOrderRefId": {
                    "type": "string"
                  },
                  "RecurringBillApprovalStatus": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "RequireApproval": {
                    "type": "boolean"
                  },
                  "ScheduleArn": {
                    "type": "string"
                  },
                  "ScheduleTimezone": {
                    "type": "string"
                  },
                  "SkipIfMissed": {
                    "type": "boolean"
                  },
                  "StartDate": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TemplateName": {
                    "type": "string"
                  },
                  "UpdatedBy": {
                    "type": "string"
                  },
                  "UpdatedById": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `recurringBill`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateRecurringBill",
        "summary": "Update recurringBill record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringBill` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringBill.grpc` → `updateRecurringBills`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "recurringBill"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringBill"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringBill` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringBill"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringBill.grpc",
        "x-hellobooks-handler": "updateRecurringBills",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Addresses": {
                    "type": "array"
                  },
                  "AutoGenerate": {
                    "type": "boolean"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CreatedById": {
                    "type": "string"
                  },
                  "CurrencyMismatchWarning": {
                    "type": "boolean"
                  },
                  "CurrencyRefId": {
                    "type": "string"
                  },
                  "DueDateType": {
                    "type": "string"
                  },
                  "DueOffsetDays": {
                    "type": "integer"
                  },
                  "EmailVendorOnGenerate": {
                    "type": "boolean"
                  },
                  "EnablePlaceholderParse": {
                    "type": "boolean"
                  },
                  "EndDate": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GoodsReceiptNoteRefId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LastGeneratedDate": {
                    "type": "string"
                  },
                  "MasterDiscountRef": {
                    "type": "string"
                  },
                  "NextScheduledDate": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "NotifyInternalEmails": {
                    "type": "array"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "Placeholder": {
                    "type": "string"
                  },
                  "PlannedPaymentDate": {
                    "type": "string"
                  },
                  "PurchaseOrderRefId": {
                    "type": "string"
                  },
                  "RecurringBillApprovalStatus": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "RequireApproval": {
                    "type": "boolean"
                  },
                  "ScheduleArn": {
                    "type": "string"
                  },
                  "ScheduleTimezone": {
                    "type": "string"
                  },
                  "SkipIfMissed": {
                    "type": "boolean"
                  },
                  "StartDate": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TemplateName": {
                    "type": "string"
                  },
                  "UpdatedBy": {
                    "type": "string"
                  },
                  "UpdatedById": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `recurringBill`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteRecurringBill",
        "summary": "Delete recurringBill record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringBill` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringBill.grpc` → `deleteRecurringBills`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "recurringBill"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringBill"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringBill` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringBill"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringBill.grpc",
        "x-hellobooks-handler": "deleteRecurringBills",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Addresses": {
                    "type": "array"
                  },
                  "AutoGenerate": {
                    "type": "boolean"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CreatedById": {
                    "type": "string"
                  },
                  "CurrencyMismatchWarning": {
                    "type": "boolean"
                  },
                  "CurrencyRefId": {
                    "type": "string"
                  },
                  "DueDateType": {
                    "type": "string"
                  },
                  "DueOffsetDays": {
                    "type": "integer"
                  },
                  "EmailVendorOnGenerate": {
                    "type": "boolean"
                  },
                  "EnablePlaceholderParse": {
                    "type": "boolean"
                  },
                  "EndDate": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GoodsReceiptNoteRefId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LastGeneratedDate": {
                    "type": "string"
                  },
                  "MasterDiscountRef": {
                    "type": "string"
                  },
                  "NextScheduledDate": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "NotifyInternalEmails": {
                    "type": "array"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "Placeholder": {
                    "type": "string"
                  },
                  "PlannedPaymentDate": {
                    "type": "string"
                  },
                  "PurchaseOrderRefId": {
                    "type": "string"
                  },
                  "RecurringBillApprovalStatus": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "RequireApproval": {
                    "type": "boolean"
                  },
                  "ScheduleArn": {
                    "type": "string"
                  },
                  "ScheduleTimezone": {
                    "type": "string"
                  },
                  "SkipIfMissed": {
                    "type": "boolean"
                  },
                  "StartDate": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TemplateName": {
                    "type": "string"
                  },
                  "UpdatedBy": {
                    "type": "string"
                  },
                  "UpdatedById": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `recurringBill`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/recurringBill/restore": {
      "put": {
        "operationId": "restoreRecurringBill",
        "summary": "Restore archived recurringBill record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringBill` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringBill.grpc` → `restoreRecurringBills`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "recurringBill"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringBill"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringBill` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringBill"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringBill.grpc",
        "x-hellobooks-handler": "restoreRecurringBills",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Addresses": {
                    "type": "array"
                  },
                  "AutoGenerate": {
                    "type": "boolean"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CreatedById": {
                    "type": "string"
                  },
                  "CurrencyMismatchWarning": {
                    "type": "boolean"
                  },
                  "CurrencyRefId": {
                    "type": "string"
                  },
                  "DueDateType": {
                    "type": "string"
                  },
                  "DueOffsetDays": {
                    "type": "integer"
                  },
                  "EmailVendorOnGenerate": {
                    "type": "boolean"
                  },
                  "EnablePlaceholderParse": {
                    "type": "boolean"
                  },
                  "EndDate": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GoodsReceiptNoteRefId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LastGeneratedDate": {
                    "type": "string"
                  },
                  "MasterDiscountRef": {
                    "type": "string"
                  },
                  "NextScheduledDate": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "NotifyInternalEmails": {
                    "type": "array"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "Placeholder": {
                    "type": "string"
                  },
                  "PlannedPaymentDate": {
                    "type": "string"
                  },
                  "PurchaseOrderRefId": {
                    "type": "string"
                  },
                  "RecurringBillApprovalStatus": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "RequireApproval": {
                    "type": "boolean"
                  },
                  "ScheduleArn": {
                    "type": "string"
                  },
                  "ScheduleTimezone": {
                    "type": "string"
                  },
                  "SkipIfMissed": {
                    "type": "boolean"
                  },
                  "StartDate": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TemplateName": {
                    "type": "string"
                  },
                  "UpdatedBy": {
                    "type": "string"
                  },
                  "UpdatedById": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `recurringBill`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/recurringBill/{id}": {
      "get": {
        "operationId": "getRecurringBill",
        "summary": "Fetch one recurringBill record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringBill` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringBill.grpc` → `getRecurringBillById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "recurringBill"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringBill"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringBill` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringBill"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringBill.grpc",
        "x-hellobooks-handler": "getRecurringBillById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/recurringInvoice": {
      "get": {
        "operationId": "listRecurringInvoice",
        "summary": "List recurringInvoice records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringInvoice` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringInvoiceTemplate.grpc` → `getRecurringInvoiceTemplates`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "recurringInvoice"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/RecurringInvoice"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `RecurringInvoice` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/RecurringInvoice"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringInvoiceTemplate.grpc",
        "x-hellobooks-handler": "getRecurringInvoiceTemplates",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      },
      "post": {
        "operationId": "createRecurringInvoice",
        "summary": "Create recurringInvoice record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringInvoice` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringInvoiceTemplate.grpc` → `createRecurringInvoiceTemplates`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "recurringInvoice"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringInvoice"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringInvoice` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringInvoice"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringInvoiceTemplate.grpc",
        "x-hellobooks-handler": "createRecurringInvoiceTemplates",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Addresses": {
                    "type": "array"
                  },
                  "AutoGenerate": {
                    "type": "boolean"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CurrencyMismatchWarning": {
                    "type": "boolean"
                  },
                  "CurrencyRefId": {
                    "type": "string"
                  },
                  "DueDateType": {
                    "type": "string"
                  },
                  "DueOffsetDays": {
                    "type": "integer"
                  },
                  "EmailCustomerOnGenerate": {
                    "type": "boolean"
                  },
                  "EnablePlaceholderParse": {
                    "type": "boolean"
                  },
                  "EndDate": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GoodsReceiptNoteRefId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsShippingSameAsBilling": {
                    "type": "boolean"
                  },
                  "LastGeneratedDate": {
                    "type": "string"
                  },
                  "MasterDiscountRef": {
                    "type": "string"
                  },
                  "NextScheduledDate": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "NotifyInternalEmails": {
                    "type": "array"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "Placeholder": {
                    "type": "string"
                  },
                  "PlannedPaymentDate": {
                    "type": "string"
                  },
                  "RecurringInvoiceApprovalStatus": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "RequireApproval": {
                    "type": "boolean"
                  },
                  "SalesOrderRefId": {
                    "type": "string"
                  },
                  "ScheduleArn": {
                    "type": "string"
                  },
                  "ScheduleTimezone": {
                    "type": "string"
                  },
                  "SelectedBillingAddressId": {
                    "type": "string"
                  },
                  "SelectedShippingAddressId": {
                    "type": "string"
                  },
                  "SkipIfMissed": {
                    "type": "boolean"
                  },
                  "StartDate": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TCS": {
                    "type": "boolean"
                  },
                  "TDS": {
                    "type": "boolean"
                  },
                  "TaxRef": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TemplateName": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `recurringInvoice`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateRecurringInvoice",
        "summary": "Update recurringInvoice record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringInvoice` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringInvoiceTemplate.grpc` → `updateRecurringInvoiceTemplates`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "recurringInvoice"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringInvoice"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringInvoice` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringInvoice"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringInvoiceTemplate.grpc",
        "x-hellobooks-handler": "updateRecurringInvoiceTemplates",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Addresses": {
                    "type": "array"
                  },
                  "AutoGenerate": {
                    "type": "boolean"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CurrencyMismatchWarning": {
                    "type": "boolean"
                  },
                  "CurrencyRefId": {
                    "type": "string"
                  },
                  "DueDateType": {
                    "type": "string"
                  },
                  "DueOffsetDays": {
                    "type": "integer"
                  },
                  "EmailCustomerOnGenerate": {
                    "type": "boolean"
                  },
                  "EnablePlaceholderParse": {
                    "type": "boolean"
                  },
                  "EndDate": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GoodsReceiptNoteRefId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsShippingSameAsBilling": {
                    "type": "boolean"
                  },
                  "LastGeneratedDate": {
                    "type": "string"
                  },
                  "MasterDiscountRef": {
                    "type": "string"
                  },
                  "NextScheduledDate": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "NotifyInternalEmails": {
                    "type": "array"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "Placeholder": {
                    "type": "string"
                  },
                  "PlannedPaymentDate": {
                    "type": "string"
                  },
                  "RecurringInvoiceApprovalStatus": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "RequireApproval": {
                    "type": "boolean"
                  },
                  "SalesOrderRefId": {
                    "type": "string"
                  },
                  "ScheduleArn": {
                    "type": "string"
                  },
                  "ScheduleTimezone": {
                    "type": "string"
                  },
                  "SelectedBillingAddressId": {
                    "type": "string"
                  },
                  "SelectedShippingAddressId": {
                    "type": "string"
                  },
                  "SkipIfMissed": {
                    "type": "boolean"
                  },
                  "StartDate": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TCS": {
                    "type": "boolean"
                  },
                  "TDS": {
                    "type": "boolean"
                  },
                  "TaxRef": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TemplateName": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `recurringInvoice`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteRecurringInvoice",
        "summary": "Delete recurringInvoice record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringInvoice` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringInvoiceTemplate.grpc` → `deleteRecurringInvoiceTemplates`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "recurringInvoice"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringInvoice"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringInvoice` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringInvoice"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringInvoiceTemplate.grpc",
        "x-hellobooks-handler": "deleteRecurringInvoiceTemplates",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Addresses": {
                    "type": "array"
                  },
                  "AutoGenerate": {
                    "type": "boolean"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CurrencyMismatchWarning": {
                    "type": "boolean"
                  },
                  "CurrencyRefId": {
                    "type": "string"
                  },
                  "DueDateType": {
                    "type": "string"
                  },
                  "DueOffsetDays": {
                    "type": "integer"
                  },
                  "EmailCustomerOnGenerate": {
                    "type": "boolean"
                  },
                  "EnablePlaceholderParse": {
                    "type": "boolean"
                  },
                  "EndDate": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GoodsReceiptNoteRefId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsShippingSameAsBilling": {
                    "type": "boolean"
                  },
                  "LastGeneratedDate": {
                    "type": "string"
                  },
                  "MasterDiscountRef": {
                    "type": "string"
                  },
                  "NextScheduledDate": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "NotifyInternalEmails": {
                    "type": "array"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "Placeholder": {
                    "type": "string"
                  },
                  "PlannedPaymentDate": {
                    "type": "string"
                  },
                  "RecurringInvoiceApprovalStatus": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "RequireApproval": {
                    "type": "boolean"
                  },
                  "SalesOrderRefId": {
                    "type": "string"
                  },
                  "ScheduleArn": {
                    "type": "string"
                  },
                  "ScheduleTimezone": {
                    "type": "string"
                  },
                  "SelectedBillingAddressId": {
                    "type": "string"
                  },
                  "SelectedShippingAddressId": {
                    "type": "string"
                  },
                  "SkipIfMissed": {
                    "type": "boolean"
                  },
                  "StartDate": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TCS": {
                    "type": "boolean"
                  },
                  "TDS": {
                    "type": "boolean"
                  },
                  "TaxRef": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TemplateName": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `recurringInvoice`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/recurringInvoice/restore": {
      "put": {
        "operationId": "restoreRecurringInvoice",
        "summary": "Restore archived recurringInvoice record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringInvoice` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringInvoiceTemplate.grpc` → `restoreRecurringInvoiceTemplates`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "recurringInvoice"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringInvoice"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringInvoice` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringInvoice"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringInvoiceTemplate.grpc",
        "x-hellobooks-handler": "restoreRecurringInvoiceTemplates",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Addresses": {
                    "type": "array"
                  },
                  "AutoGenerate": {
                    "type": "boolean"
                  },
                  "CreatedBy": {
                    "type": "string"
                  },
                  "CurrencyMismatchWarning": {
                    "type": "boolean"
                  },
                  "CurrencyRefId": {
                    "type": "string"
                  },
                  "DueDateType": {
                    "type": "string"
                  },
                  "DueOffsetDays": {
                    "type": "integer"
                  },
                  "EmailCustomerOnGenerate": {
                    "type": "boolean"
                  },
                  "EnablePlaceholderParse": {
                    "type": "boolean"
                  },
                  "EndDate": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GoodsReceiptNoteRefId": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsShippingSameAsBilling": {
                    "type": "boolean"
                  },
                  "LastGeneratedDate": {
                    "type": "string"
                  },
                  "MasterDiscountRef": {
                    "type": "string"
                  },
                  "NextScheduledDate": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "NotifyInternalEmails": {
                    "type": "array"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "Placeholder": {
                    "type": "string"
                  },
                  "PlannedPaymentDate": {
                    "type": "string"
                  },
                  "RecurringInvoiceApprovalStatus": {
                    "type": "string"
                  },
                  "ReferenceNumber": {
                    "type": "string"
                  },
                  "RequireApproval": {
                    "type": "boolean"
                  },
                  "SalesOrderRefId": {
                    "type": "string"
                  },
                  "ScheduleArn": {
                    "type": "string"
                  },
                  "ScheduleTimezone": {
                    "type": "string"
                  },
                  "SelectedBillingAddressId": {
                    "type": "string"
                  },
                  "SelectedShippingAddressId": {
                    "type": "string"
                  },
                  "SkipIfMissed": {
                    "type": "boolean"
                  },
                  "StartDate": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TCS": {
                    "type": "boolean"
                  },
                  "TDS": {
                    "type": "boolean"
                  },
                  "TaxRef": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TemplateName": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `recurringInvoice`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/recurringInvoice/{id}": {
      "get": {
        "operationId": "getRecurringInvoice",
        "summary": "Fetch one recurringInvoice record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringInvoice` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringInvoiceTemplate.grpc` → `getRecurringInvoiceTemplateById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "recurringInvoice"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringInvoice"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringInvoice` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringInvoice"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringInvoiceTemplate.grpc",
        "x-hellobooks-handler": "getRecurringInvoiceTemplateById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/recurringInvoiceAttachment": {
      "post": {
        "operationId": "createRecurringInvoiceAttachment",
        "summary": "Create recurringInvoiceAttachment record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringInvoiceAttachment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringInvoiceAttachment.grpc` → `createRecurringInvoiceAttachments`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "recurringInvoiceAttachment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringInvoiceAttachment"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringInvoiceAttachment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringInvoiceAttachment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringInvoiceAttachment.grpc",
        "x-hellobooks-handler": "createRecurringInvoiceAttachments",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "FileName": {
                    "type": "string"
                  },
                  "FileUrl": {
                    "type": "string"
                  },
                  "TemplateId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `recurringInvoiceAttachment`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateRecurringInvoiceAttachment",
        "summary": "Update recurringInvoiceAttachment record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringInvoiceAttachment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringInvoiceAttachment.grpc` → `updateRecurringInvoiceAttachments`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "recurringInvoiceAttachment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringInvoiceAttachment"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringInvoiceAttachment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringInvoiceAttachment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringInvoiceAttachment.grpc",
        "x-hellobooks-handler": "updateRecurringInvoiceAttachments",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "FileName": {
                    "type": "string"
                  },
                  "FileUrl": {
                    "type": "string"
                  },
                  "TemplateId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `recurringInvoiceAttachment`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteRecurringInvoiceAttachment",
        "summary": "Delete recurringInvoiceAttachment record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringInvoiceAttachment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringInvoiceAttachment.grpc` → `deleteRecurringInvoiceAttachments`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "recurringInvoiceAttachment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringInvoiceAttachment"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringInvoiceAttachment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringInvoiceAttachment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringInvoiceAttachment.grpc",
        "x-hellobooks-handler": "deleteRecurringInvoiceAttachments",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "FileName": {
                    "type": "string"
                  },
                  "FileUrl": {
                    "type": "string"
                  },
                  "TemplateId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `recurringInvoiceAttachment`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/recurringInvoiceAttachment/restore": {
      "put": {
        "operationId": "restoreRecurringInvoiceAttachment",
        "summary": "Restore archived recurringInvoiceAttachment record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringInvoiceAttachment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringInvoiceAttachment.grpc` → `restoreRecurringInvoiceAttachments`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "recurringInvoiceAttachment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringInvoiceAttachment"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringInvoiceAttachment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringInvoiceAttachment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringInvoiceAttachment.grpc",
        "x-hellobooks-handler": "restoreRecurringInvoiceAttachments",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "FileName": {
                    "type": "string"
                  },
                  "FileUrl": {
                    "type": "string"
                  },
                  "TemplateId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `recurringInvoiceAttachment`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/recurringInvoiceAttachment/{id}": {
      "get": {
        "operationId": "getRecurringInvoiceAttachment",
        "summary": "Fetch one recurringInvoiceAttachment record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringInvoiceAttachment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringInvoiceAttachment.grpc` → `getRecurringInvoiceAttachmentById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "recurringInvoiceAttachment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringInvoiceAttachment"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringInvoiceAttachment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringInvoiceAttachment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringInvoiceAttachment.grpc",
        "x-hellobooks-handler": "getRecurringInvoiceAttachmentById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/recurringInvoiceLineItem": {
      "post": {
        "operationId": "createRecurringInvoiceLineItem",
        "summary": "Create recurringInvoiceLineItem record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringInvoiceLineItem` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringInvoiceLineItem.grpc` → `createRecurringInvoiceLineItems`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "recurringInvoiceLineItem"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringInvoiceLineItem"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringInvoiceLineItem` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringInvoiceLineItem"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringInvoiceLineItem.grpc",
        "x-hellobooks-handler": "createRecurringInvoiceLineItems",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DiscountAmount": {
                    "type": "number"
                  },
                  "DiscountD2Amount": {
                    "type": "number"
                  },
                  "DiscountD2Percentage": {
                    "type": "number"
                  },
                  "DiscountD3Amount": {
                    "type": "number"
                  },
                  "DiscountD3Percentage": {
                    "type": "number"
                  },
                  "DiscountPercent": {
                    "type": "number"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IsDiscountBeforeTax": {
                    "type": "boolean"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "ProjectRefId": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TemplateId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `recurringInvoiceLineItem`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateRecurringInvoiceLineItem",
        "summary": "Update recurringInvoiceLineItem record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringInvoiceLineItem` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringInvoiceLineItem.grpc` → `updateRecurringInvoiceLineItems`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "recurringInvoiceLineItem"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringInvoiceLineItem"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringInvoiceLineItem` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringInvoiceLineItem"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringInvoiceLineItem.grpc",
        "x-hellobooks-handler": "updateRecurringInvoiceLineItems",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DiscountAmount": {
                    "type": "number"
                  },
                  "DiscountD2Amount": {
                    "type": "number"
                  },
                  "DiscountD2Percentage": {
                    "type": "number"
                  },
                  "DiscountD3Amount": {
                    "type": "number"
                  },
                  "DiscountD3Percentage": {
                    "type": "number"
                  },
                  "DiscountPercent": {
                    "type": "number"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IsDiscountBeforeTax": {
                    "type": "boolean"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "ProjectRefId": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TemplateId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `recurringInvoiceLineItem`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteRecurringInvoiceLineItem",
        "summary": "Delete recurringInvoiceLineItem record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringInvoiceLineItem` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringInvoiceLineItem.grpc` → `deleteRecurringInvoiceLineItems`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "recurringInvoiceLineItem"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringInvoiceLineItem"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringInvoiceLineItem` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringInvoiceLineItem"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringInvoiceLineItem.grpc",
        "x-hellobooks-handler": "deleteRecurringInvoiceLineItems",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DiscountAmount": {
                    "type": "number"
                  },
                  "DiscountD2Amount": {
                    "type": "number"
                  },
                  "DiscountD2Percentage": {
                    "type": "number"
                  },
                  "DiscountD3Amount": {
                    "type": "number"
                  },
                  "DiscountD3Percentage": {
                    "type": "number"
                  },
                  "DiscountPercent": {
                    "type": "number"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IsDiscountBeforeTax": {
                    "type": "boolean"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "ProjectRefId": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TemplateId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `recurringInvoiceLineItem`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/recurringInvoiceLineItem/restore": {
      "put": {
        "operationId": "restoreRecurringInvoiceLineItem",
        "summary": "Restore archived recurringInvoiceLineItem record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringInvoiceLineItem` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringInvoiceLineItem.grpc` → `restoreRecurringInvoiceLineItems`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "recurringInvoiceLineItem"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringInvoiceLineItem"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringInvoiceLineItem` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringInvoiceLineItem"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringInvoiceLineItem.grpc",
        "x-hellobooks-handler": "restoreRecurringInvoiceLineItems",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DiscountAmount": {
                    "type": "number"
                  },
                  "DiscountD2Amount": {
                    "type": "number"
                  },
                  "DiscountD2Percentage": {
                    "type": "number"
                  },
                  "DiscountD3Amount": {
                    "type": "number"
                  },
                  "DiscountD3Percentage": {
                    "type": "number"
                  },
                  "DiscountPercent": {
                    "type": "number"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IsDiscountBeforeTax": {
                    "type": "boolean"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "ProjectRefId": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TemplateId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `recurringInvoiceLineItem`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/recurringInvoiceLineItem/{id}": {
      "get": {
        "operationId": "getRecurringInvoiceLineItem",
        "summary": "Fetch one recurringInvoiceLineItem record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringInvoiceLineItem` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringInvoiceLineItem.grpc` → `getRecurringInvoiceLineItemById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "recurringInvoiceLineItem"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringInvoiceLineItem"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringInvoiceLineItem` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringInvoiceLineItem"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringInvoiceLineItem.grpc",
        "x-hellobooks-handler": "getRecurringInvoiceLineItemById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/recurringInvoiceLog": {
      "post": {
        "operationId": "createRecurringInvoiceLog",
        "summary": "Create recurringInvoiceLog record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringInvoiceLog` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringInvoiceLog.grpc` → `createRecurringInvoiceLogs`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "recurringInvoiceLog"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringInvoiceLog"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringInvoiceLog` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringInvoiceLog"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringInvoiceLog.grpc",
        "x-hellobooks-handler": "createRecurringInvoiceLogs",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "GeneratedOn": {
                    "type": "string"
                  },
                  "InvoiceRefId": {
                    "type": "string"
                  },
                  "Reason": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TemplateId": {
                    "type": "string"
                  },
                  "TriggeredBy": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `recurringInvoiceLog`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateRecurringInvoiceLog",
        "summary": "Update recurringInvoiceLog record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringInvoiceLog` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringInvoiceLog.grpc` → `updateRecurringInvoiceLogs`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "recurringInvoiceLog"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringInvoiceLog"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringInvoiceLog` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringInvoiceLog"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringInvoiceLog.grpc",
        "x-hellobooks-handler": "updateRecurringInvoiceLogs",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "GeneratedOn": {
                    "type": "string"
                  },
                  "InvoiceRefId": {
                    "type": "string"
                  },
                  "Reason": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TemplateId": {
                    "type": "string"
                  },
                  "TriggeredBy": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `recurringInvoiceLog`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteRecurringInvoiceLog",
        "summary": "Delete recurringInvoiceLog record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringInvoiceLog` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringInvoiceLog.grpc` → `deleteRecurringInvoiceLogs`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "recurringInvoiceLog"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringInvoiceLog"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringInvoiceLog` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringInvoiceLog"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringInvoiceLog.grpc",
        "x-hellobooks-handler": "deleteRecurringInvoiceLogs",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "GeneratedOn": {
                    "type": "string"
                  },
                  "InvoiceRefId": {
                    "type": "string"
                  },
                  "Reason": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TemplateId": {
                    "type": "string"
                  },
                  "TriggeredBy": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `recurringInvoiceLog`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/recurringInvoiceLog/restore": {
      "put": {
        "operationId": "restoreRecurringInvoiceLog",
        "summary": "Restore archived recurringInvoiceLog record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringInvoiceLog` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringInvoiceLog.grpc` → `restoreRecurringInvoiceLogs`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "recurringInvoiceLog"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringInvoiceLog"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringInvoiceLog` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringInvoiceLog"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringInvoiceLog.grpc",
        "x-hellobooks-handler": "restoreRecurringInvoiceLogs",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "GeneratedOn": {
                    "type": "string"
                  },
                  "InvoiceRefId": {
                    "type": "string"
                  },
                  "Reason": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TemplateId": {
                    "type": "string"
                  },
                  "TriggeredBy": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `recurringInvoiceLog`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/recurringInvoiceLog/{id}": {
      "get": {
        "operationId": "getRecurringInvoiceLog",
        "summary": "Fetch one recurringInvoiceLog record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `recurringInvoiceLog` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/recurringInvoiceLog.grpc` → `getRecurringInvoiceLogById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "recurringInvoiceLog"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/RecurringInvoiceLog"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `RecurringInvoiceLog` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/RecurringInvoiceLog"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/recurringInvoiceLog.grpc",
        "x-hellobooks-handler": "getRecurringInvoiceLogById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/revenueByCustomer": {
      "get": {
        "operationId": "listRevenueByCustomer",
        "summary": "List revenueByCustomer records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `revenueByCustomer` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/reports/revenueByCustomer.grpc` → `getRevenueByCustomer`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"reports:read\")`.",
        "tags": [
          "revenueByCustomer"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "reports:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/RevenueByCustomer"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `RevenueByCustomer` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/RevenueByCustomer"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/reports/revenueByCustomer.grpc",
        "x-hellobooks-handler": "getRevenueByCustomer",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "reports:read"
        ],
        "x-hellobooks-scope-domain": "reports"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/rfq": {
      "get": {
        "operationId": "listRfq",
        "summary": "List rfq records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `rfq` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/rfq.grpc` → `getRFQs`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "rfq"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Rfq"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `Rfq` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/Rfq"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/rfq.grpc",
        "x-hellobooks-handler": "getRFQs",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      },
      "post": {
        "operationId": "createRfq",
        "summary": "Create rfq record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `rfq` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/rfq.grpc` → `createRFQs`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "rfq"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Rfq"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Rfq` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Rfq"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/rfq.grpc",
        "x-hellobooks-handler": "createRFQs",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Attachments": {
                    "type": "object"
                  },
                  "AwardedAt": {
                    "type": "string"
                  },
                  "CancellationReason": {
                    "type": "string"
                  },
                  "CancelledAt": {
                    "type": "string"
                  },
                  "ClosedAt": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "ConvertedPORefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DeliveryAddress": {
                    "type": "object"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpectedDeliveryDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "Incoterm": {
                    "type": "string"
                  },
                  "InternalNotes": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "PaymentTerms": {
                    "type": "string"
                  },
                  "RFQNumber": {
                    "type": "string"
                  },
                  "RequestDate": {
                    "type": "string"
                  },
                  "ResponseDueDate": {
                    "type": "string"
                  },
                  "SentAt": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "Title": {
                    "type": "string"
                  },
                  "VendorRef": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `rfq`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateRfq",
        "summary": "Update rfq record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `rfq` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/rfq.grpc` → `updateRFQs`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "rfq"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Rfq"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Rfq` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Rfq"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/rfq.grpc",
        "x-hellobooks-handler": "updateRFQs",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Attachments": {
                    "type": "object"
                  },
                  "AwardedAt": {
                    "type": "string"
                  },
                  "CancellationReason": {
                    "type": "string"
                  },
                  "CancelledAt": {
                    "type": "string"
                  },
                  "ClosedAt": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "ConvertedPORefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DeliveryAddress": {
                    "type": "object"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpectedDeliveryDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "Incoterm": {
                    "type": "string"
                  },
                  "InternalNotes": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "PaymentTerms": {
                    "type": "string"
                  },
                  "RFQNumber": {
                    "type": "string"
                  },
                  "RequestDate": {
                    "type": "string"
                  },
                  "ResponseDueDate": {
                    "type": "string"
                  },
                  "SentAt": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "Title": {
                    "type": "string"
                  },
                  "VendorRef": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `rfq`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteRfq",
        "summary": "Delete rfq record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `rfq` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/rfq.grpc` → `deleteRFQs`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "rfq"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Rfq"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Rfq` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Rfq"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/rfq.grpc",
        "x-hellobooks-handler": "deleteRFQs",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Attachments": {
                    "type": "object"
                  },
                  "AwardedAt": {
                    "type": "string"
                  },
                  "CancellationReason": {
                    "type": "string"
                  },
                  "CancelledAt": {
                    "type": "string"
                  },
                  "ClosedAt": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "ConvertedPORefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DeliveryAddress": {
                    "type": "object"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpectedDeliveryDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "Incoterm": {
                    "type": "string"
                  },
                  "InternalNotes": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "PaymentTerms": {
                    "type": "string"
                  },
                  "RFQNumber": {
                    "type": "string"
                  },
                  "RequestDate": {
                    "type": "string"
                  },
                  "ResponseDueDate": {
                    "type": "string"
                  },
                  "SentAt": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "Title": {
                    "type": "string"
                  },
                  "VendorRef": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `rfq`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/rfq/restore": {
      "put": {
        "operationId": "restoreRfq",
        "summary": "Restore archived rfq record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `rfq` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/rfq.grpc` → `restoreRFQs`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "rfq"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Rfq"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Rfq` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Rfq"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/rfq.grpc",
        "x-hellobooks-handler": "restoreRFQs",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Attachments": {
                    "type": "object"
                  },
                  "AwardedAt": {
                    "type": "string"
                  },
                  "CancellationReason": {
                    "type": "string"
                  },
                  "CancelledAt": {
                    "type": "string"
                  },
                  "ClosedAt": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "ConvertedPORefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DeliveryAddress": {
                    "type": "object"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExpectedDeliveryDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "Incoterm": {
                    "type": "string"
                  },
                  "InternalNotes": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "PaymentTerms": {
                    "type": "string"
                  },
                  "RFQNumber": {
                    "type": "string"
                  },
                  "RequestDate": {
                    "type": "string"
                  },
                  "ResponseDueDate": {
                    "type": "string"
                  },
                  "SentAt": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "Title": {
                    "type": "string"
                  },
                  "VendorRef": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `rfq`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/rfq/{id}": {
      "get": {
        "operationId": "getRfq",
        "summary": "Fetch one rfq record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `rfq` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/rfq.grpc` → `getRFQById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "rfq"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Rfq"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Rfq` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Rfq"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/rfq.grpc",
        "x-hellobooks-handler": "getRFQById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/salesCreditNote": {
      "get": {
        "operationId": "listSalesCreditNote",
        "summary": "List salesCreditNote records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `salesCreditNote` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/salesCreditNote.grpc` → `getSalesCreditNotes`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "salesCreditNote"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/SalesCreditNote"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `SalesCreditNote` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/SalesCreditNote"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/salesCreditNote.grpc",
        "x-hellobooks-handler": "getSalesCreditNotes",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      },
      "post": {
        "operationId": "createSalesCreditNote",
        "summary": "Create salesCreditNote record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `salesCreditNote` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/salesCreditNote.grpc` → `createSalesCreditNotes`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "salesCreditNote"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/SalesCreditNote"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `SalesCreditNote` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/SalesCreditNote"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/salesCreditNote.grpc",
        "x-hellobooks-handler": "createSalesCreditNotes",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AmountApplied": {
                    "type": "number"
                  },
                  "AmountRefunded": {
                    "type": "number"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "Branding": {
                    "type": "string"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomerRef": {
                    "type": "string"
                  },
                  "DifferentialPercent": {
                    "type": "number"
                  },
                  "EInvoiceCancelledAt": {
                    "type": "string"
                  },
                  "EInvoiceGeneratedAt": {
                    "type": "string"
                  },
                  "EInvoiceIRN": {
                    "type": "string"
                  },
                  "EInvoiceId": {
                    "type": "string"
                  },
                  "EInvoiceStatus": {
                    "type": "string"
                  },
                  "EcommerceGSTIN": {
                    "type": "string"
                  },
                  "EwbGeneratedAt": {
                    "type": "string"
                  },
                  "EwbNo": {
                    "type": "string"
                  },
                  "EwbRefId": {
                    "type": "string"
                  },
                  "EwbStatus": {
                    "type": "string"
                  },
                  "EwbValidUpto": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExcludeFromEwb": {
                    "type": "boolean"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FunctionalTotalAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "InvoiceClass": {
                    "type": "string"
                  },
                  "InvoiceRef": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "NoteType": {
                    "type": "string"
                  },
                  "OriginalInvoiceDate": {
                    "type": "string"
                  },
                  "OriginalInvoiceNo": {
                    "type": "string"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "Purpose": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "RemainingAmount": {
                    "type": "number"
                  },
                  "SalesCreditNoteNumber": {
                    "type": "string"
                  },
                  "SalesCreditNoteType": {
                    "type": "string"
                  },
                  "SellerGSTIN": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyOrderId": {
                    "type": "string"
                  },
                  "ShopifyRefundId": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyNumber": {
                    "type": "string"
                  },
                  "TallyVoucherSeries": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TotalAmount": {
                    "type": "number"
                  },
                  "TotalCGST": {
                    "type": "number"
                  },
                  "TotalCess": {
                    "type": "number"
                  },
                  "TotalCessNonAdvalorem": {
                    "type": "number"
                  },
                  "TotalIGST": {
                    "type": "number"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalSGST": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `salesCreditNote`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateSalesCreditNote",
        "summary": "Update salesCreditNote record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `salesCreditNote` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/salesCreditNote.grpc` → `updateSalesCreditNotes`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "salesCreditNote"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/SalesCreditNote"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `SalesCreditNote` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/SalesCreditNote"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/salesCreditNote.grpc",
        "x-hellobooks-handler": "updateSalesCreditNotes",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AmountApplied": {
                    "type": "number"
                  },
                  "AmountRefunded": {
                    "type": "number"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "Branding": {
                    "type": "string"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomerRef": {
                    "type": "string"
                  },
                  "DifferentialPercent": {
                    "type": "number"
                  },
                  "EInvoiceCancelledAt": {
                    "type": "string"
                  },
                  "EInvoiceGeneratedAt": {
                    "type": "string"
                  },
                  "EInvoiceIRN": {
                    "type": "string"
                  },
                  "EInvoiceId": {
                    "type": "string"
                  },
                  "EInvoiceStatus": {
                    "type": "string"
                  },
                  "EcommerceGSTIN": {
                    "type": "string"
                  },
                  "EwbGeneratedAt": {
                    "type": "string"
                  },
                  "EwbNo": {
                    "type": "string"
                  },
                  "EwbRefId": {
                    "type": "string"
                  },
                  "EwbStatus": {
                    "type": "string"
                  },
                  "EwbValidUpto": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExcludeFromEwb": {
                    "type": "boolean"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FunctionalTotalAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "InvoiceClass": {
                    "type": "string"
                  },
                  "InvoiceRef": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "NoteType": {
                    "type": "string"
                  },
                  "OriginalInvoiceDate": {
                    "type": "string"
                  },
                  "OriginalInvoiceNo": {
                    "type": "string"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "Purpose": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "RemainingAmount": {
                    "type": "number"
                  },
                  "SalesCreditNoteNumber": {
                    "type": "string"
                  },
                  "SalesCreditNoteType": {
                    "type": "string"
                  },
                  "SellerGSTIN": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyOrderId": {
                    "type": "string"
                  },
                  "ShopifyRefundId": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyNumber": {
                    "type": "string"
                  },
                  "TallyVoucherSeries": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TotalAmount": {
                    "type": "number"
                  },
                  "TotalCGST": {
                    "type": "number"
                  },
                  "TotalCess": {
                    "type": "number"
                  },
                  "TotalCessNonAdvalorem": {
                    "type": "number"
                  },
                  "TotalIGST": {
                    "type": "number"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalSGST": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `salesCreditNote`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteSalesCreditNote",
        "summary": "Delete salesCreditNote record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `salesCreditNote` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/salesCreditNote.grpc` → `deleteSalesCreditNotes`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "salesCreditNote"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/SalesCreditNote"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `SalesCreditNote` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/SalesCreditNote"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/salesCreditNote.grpc",
        "x-hellobooks-handler": "deleteSalesCreditNotes",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AmountApplied": {
                    "type": "number"
                  },
                  "AmountRefunded": {
                    "type": "number"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "Branding": {
                    "type": "string"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomerRef": {
                    "type": "string"
                  },
                  "DifferentialPercent": {
                    "type": "number"
                  },
                  "EInvoiceCancelledAt": {
                    "type": "string"
                  },
                  "EInvoiceGeneratedAt": {
                    "type": "string"
                  },
                  "EInvoiceIRN": {
                    "type": "string"
                  },
                  "EInvoiceId": {
                    "type": "string"
                  },
                  "EInvoiceStatus": {
                    "type": "string"
                  },
                  "EcommerceGSTIN": {
                    "type": "string"
                  },
                  "EwbGeneratedAt": {
                    "type": "string"
                  },
                  "EwbNo": {
                    "type": "string"
                  },
                  "EwbRefId": {
                    "type": "string"
                  },
                  "EwbStatus": {
                    "type": "string"
                  },
                  "EwbValidUpto": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExcludeFromEwb": {
                    "type": "boolean"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FunctionalTotalAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "InvoiceClass": {
                    "type": "string"
                  },
                  "InvoiceRef": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "NoteType": {
                    "type": "string"
                  },
                  "OriginalInvoiceDate": {
                    "type": "string"
                  },
                  "OriginalInvoiceNo": {
                    "type": "string"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "Purpose": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "RemainingAmount": {
                    "type": "number"
                  },
                  "SalesCreditNoteNumber": {
                    "type": "string"
                  },
                  "SalesCreditNoteType": {
                    "type": "string"
                  },
                  "SellerGSTIN": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyOrderId": {
                    "type": "string"
                  },
                  "ShopifyRefundId": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyNumber": {
                    "type": "string"
                  },
                  "TallyVoucherSeries": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TotalAmount": {
                    "type": "number"
                  },
                  "TotalCGST": {
                    "type": "number"
                  },
                  "TotalCess": {
                    "type": "number"
                  },
                  "TotalCessNonAdvalorem": {
                    "type": "number"
                  },
                  "TotalIGST": {
                    "type": "number"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalSGST": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `salesCreditNote`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/salesCreditNote/restore": {
      "put": {
        "operationId": "restoreSalesCreditNote",
        "summary": "Restore archived salesCreditNote record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `salesCreditNote` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/salesCreditNote.grpc` → `restoreSalesCreditNotes`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "salesCreditNote"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/SalesCreditNote"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `SalesCreditNote` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/SalesCreditNote"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/salesCreditNote.grpc",
        "x-hellobooks-handler": "restoreSalesCreditNotes",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AmountApplied": {
                    "type": "number"
                  },
                  "AmountRefunded": {
                    "type": "number"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "Branding": {
                    "type": "string"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomerRef": {
                    "type": "string"
                  },
                  "DifferentialPercent": {
                    "type": "number"
                  },
                  "EInvoiceCancelledAt": {
                    "type": "string"
                  },
                  "EInvoiceGeneratedAt": {
                    "type": "string"
                  },
                  "EInvoiceIRN": {
                    "type": "string"
                  },
                  "EInvoiceId": {
                    "type": "string"
                  },
                  "EInvoiceStatus": {
                    "type": "string"
                  },
                  "EcommerceGSTIN": {
                    "type": "string"
                  },
                  "EwbGeneratedAt": {
                    "type": "string"
                  },
                  "EwbNo": {
                    "type": "string"
                  },
                  "EwbRefId": {
                    "type": "string"
                  },
                  "EwbStatus": {
                    "type": "string"
                  },
                  "EwbValidUpto": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExcludeFromEwb": {
                    "type": "boolean"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FunctionalTotalAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "InvoiceClass": {
                    "type": "string"
                  },
                  "InvoiceRef": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "NoteType": {
                    "type": "string"
                  },
                  "OriginalInvoiceDate": {
                    "type": "string"
                  },
                  "OriginalInvoiceNo": {
                    "type": "string"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "Purpose": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "RemainingAmount": {
                    "type": "number"
                  },
                  "SalesCreditNoteNumber": {
                    "type": "string"
                  },
                  "SalesCreditNoteType": {
                    "type": "string"
                  },
                  "SellerGSTIN": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyOrderId": {
                    "type": "string"
                  },
                  "ShopifyRefundId": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyNumber": {
                    "type": "string"
                  },
                  "TallyVoucherSeries": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TotalAmount": {
                    "type": "number"
                  },
                  "TotalCGST": {
                    "type": "number"
                  },
                  "TotalCess": {
                    "type": "number"
                  },
                  "TotalCessNonAdvalorem": {
                    "type": "number"
                  },
                  "TotalIGST": {
                    "type": "number"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalSGST": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `salesCreditNote`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/salesCreditNote/{id}": {
      "get": {
        "operationId": "getSalesCreditNote",
        "summary": "Fetch one salesCreditNote record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `salesCreditNote` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/salesCreditNote.grpc` → `getSalesCreditNoteById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "salesCreditNote"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/SalesCreditNote"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `SalesCreditNote` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/SalesCreditNote"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/salesCreditNote.grpc",
        "x-hellobooks-handler": "getSalesCreditNoteById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/salesCreditNoteLine": {
      "post": {
        "operationId": "createSalesCreditNoteLine",
        "summary": "Create salesCreditNoteLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `salesCreditNoteLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/salesCreditNoteLine.grpc` → `createSalesCreditNoteLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "salesCreditNoteLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/SalesCreditNoteLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `SalesCreditNoteLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/SalesCreditNoteLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/salesCreditNoteLine.grpc",
        "x-hellobooks-handler": "createSalesCreditNoteLines",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "CGSTAmount": {
                    "type": "number"
                  },
                  "CGSTRate": {
                    "type": "number"
                  },
                  "CessAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremRate": {
                    "type": "number"
                  },
                  "CessRate": {
                    "type": "number"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "FreeQuantity": {
                    "type": "number"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "GSTRate": {
                    "type": "number"
                  },
                  "HSNCode": {
                    "type": "string"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IGSTAmount": {
                    "type": "number"
                  },
                  "IGSTRate": {
                    "type": "number"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LabourAccountHeadRef": {
                    "type": "string"
                  },
                  "LabourAmount": {
                    "type": "number"
                  },
                  "LabourHSN_SAC": {
                    "type": "string"
                  },
                  "LabourRate": {
                    "type": "number"
                  },
                  "LabourTaxAmount": {
                    "type": "number"
                  },
                  "LabourTaxRate": {
                    "type": "number"
                  },
                  "LabourTaxRefId": {
                    "type": "string"
                  },
                  "LineExchangeRate": {
                    "type": "number"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "MarginValue": {
                    "type": "number"
                  },
                  "NCCDAmount": {
                    "type": "number"
                  },
                  "NCCDRate": {
                    "type": "number"
                  },
                  "ProjectRefId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "SGSTAmount": {
                    "type": "number"
                  },
                  "SGSTRate": {
                    "type": "number"
                  },
                  "SalesCreditNoteId": {
                    "type": "string"
                  },
                  "SerialNumbers": {
                    "type": "array"
                  },
                  "ShopifyRefundLineId": {
                    "type": "string"
                  },
                  "StateCessAmount": {
                    "type": "number"
                  },
                  "StateCessNonAdvaloremAmount": {
                    "type": "number"
                  },
                  "StateCessNonAdvaloremRate": {
                    "type": "number"
                  },
                  "StateCessRate": {
                    "type": "number"
                  },
                  "SupplyAmount": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxClassification": {
                    "type": "string"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "UTGSTAmount": {
                    "type": "number"
                  },
                  "UTGSTRate": {
                    "type": "number"
                  },
                  "UnitRefId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `salesCreditNoteLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateSalesCreditNoteLine",
        "summary": "Update salesCreditNoteLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `salesCreditNoteLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/salesCreditNoteLine.grpc` → `updateSalesCreditNoteLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "salesCreditNoteLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/SalesCreditNoteLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `SalesCreditNoteLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/SalesCreditNoteLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/salesCreditNoteLine.grpc",
        "x-hellobooks-handler": "updateSalesCreditNoteLines",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "CGSTAmount": {
                    "type": "number"
                  },
                  "CGSTRate": {
                    "type": "number"
                  },
                  "CessAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremRate": {
                    "type": "number"
                  },
                  "CessRate": {
                    "type": "number"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "FreeQuantity": {
                    "type": "number"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "GSTRate": {
                    "type": "number"
                  },
                  "HSNCode": {
                    "type": "string"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IGSTAmount": {
                    "type": "number"
                  },
                  "IGSTRate": {
                    "type": "number"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LabourAccountHeadRef": {
                    "type": "string"
                  },
                  "LabourAmount": {
                    "type": "number"
                  },
                  "LabourHSN_SAC": {
                    "type": "string"
                  },
                  "LabourRate": {
                    "type": "number"
                  },
                  "LabourTaxAmount": {
                    "type": "number"
                  },
                  "LabourTaxRate": {
                    "type": "number"
                  },
                  "LabourTaxRefId": {
                    "type": "string"
                  },
                  "LineExchangeRate": {
                    "type": "number"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "MarginValue": {
                    "type": "number"
                  },
                  "NCCDAmount": {
                    "type": "number"
                  },
                  "NCCDRate": {
                    "type": "number"
                  },
                  "ProjectRefId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "SGSTAmount": {
                    "type": "number"
                  },
                  "SGSTRate": {
                    "type": "number"
                  },
                  "SalesCreditNoteId": {
                    "type": "string"
                  },
                  "SerialNumbers": {
                    "type": "array"
                  },
                  "ShopifyRefundLineId": {
                    "type": "string"
                  },
                  "StateCessAmount": {
                    "type": "number"
                  },
                  "StateCessNonAdvaloremAmount": {
                    "type": "number"
                  },
                  "StateCessNonAdvaloremRate": {
                    "type": "number"
                  },
                  "StateCessRate": {
                    "type": "number"
                  },
                  "SupplyAmount": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxClassification": {
                    "type": "string"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "UTGSTAmount": {
                    "type": "number"
                  },
                  "UTGSTRate": {
                    "type": "number"
                  },
                  "UnitRefId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `salesCreditNoteLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteSalesCreditNoteLine",
        "summary": "Delete salesCreditNoteLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `salesCreditNoteLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/salesCreditNoteLine.grpc` → `deleteSalesCreditNoteLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "salesCreditNoteLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/SalesCreditNoteLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `SalesCreditNoteLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/SalesCreditNoteLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/salesCreditNoteLine.grpc",
        "x-hellobooks-handler": "deleteSalesCreditNoteLines",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "CGSTAmount": {
                    "type": "number"
                  },
                  "CGSTRate": {
                    "type": "number"
                  },
                  "CessAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremAmount": {
                    "type": "number"
                  },
                  "CessNonAdvaloremRate": {
                    "type": "number"
                  },
                  "CessRate": {
                    "type": "number"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "FreeQuantity": {
                    "type": "number"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "GSTRate": {
                    "type": "number"
                  },
                  "HSNCode": {
                    "type": "string"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "IGSTAmount": {
                    "type": "number"
                  },
                  "IGSTRate": {
                    "type": "number"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LabourAccountHeadRef": {
                    "type": "string"
                  },
                  "LabourAmount": {
                    "type": "number"
                  },
                  "LabourHSN_SAC": {
                    "type": "string"
                  },
                  "LabourRate": {
                    "type": "number"
                  },
                  "LabourTaxAmount": {
                    "type": "number"
                  },
                  "LabourTaxRate": {
                    "type": "number"
                  },
                  "LabourTaxRefId": {
                    "type": "string"
                  },
                  "LineExchangeRate": {
                    "type": "number"
                  },
                  "LocationRefId": {
                    "type": "string"
                  },
                  "MarginValue": {
                    "type": "number"
                  },
                  "NCCDAmount": {
                    "type": "number"
                  },
                  "NCCDRate": {
                    "type": "number"
                  },
                  "ProjectRefId": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "SGSTAmount": {
                    "type": "number"
                  },
                  "SGSTRate": {
                    "type": "number"
                  },
                  "SalesCreditNoteId": {
                    "type": "string"
                  },
                  "SerialNumbers": {
                    "type": "array"
                  },
                  "ShopifyRefundLineId": {
                    "type": "string"
                  },
                  "StateCessAmount": {
                    "type": "number"
                  },
                  "StateCessNonAdvaloremAmount": {
                    "type": "number"
                  },
                  "StateCessNonAdvaloremRate": {
                    "type": "number"
                  },
                  "StateCessRate": {
                    "type": "number"
                  },
                  "SupplyAmount": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxClassification": {
                    "type": "string"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "UTGSTAmount": {
                    "type": "number"
                  },
                  "UTGSTRate": {
                    "type": "number"
                  },
                  "UnitRefId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `salesCreditNoteLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/salesCreditNoteLine/{id}": {
      "get": {
        "operationId": "getSalesCreditNoteLine",
        "summary": "Fetch one salesCreditNoteLine record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `salesCreditNoteLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/salesCreditNoteLine.grpc` → `getSalesCreditNoteLineById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "salesCreditNoteLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/SalesCreditNoteLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `SalesCreditNoteLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/SalesCreditNoteLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/salesCreditNoteLine.grpc",
        "x-hellobooks-handler": "getSalesCreditNoteLineById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/salesOrder": {
      "get": {
        "operationId": "listSalesOrder",
        "summary": "List salesOrder records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `salesOrder` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/salesOrder.grpc` → `getSalesOrders`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "salesOrder"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/SalesOrder"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `SalesOrder` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/SalesOrder"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/salesOrder.grpc",
        "x-hellobooks-handler": "getSalesOrders",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      },
      "post": {
        "operationId": "createSalesOrder",
        "summary": "Create salesOrder record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `salesOrder` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/salesOrder.grpc` → `createSalesOrders`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "salesOrder"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/SalesOrder"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `SalesOrder` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/SalesOrder"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/salesOrder.grpc",
        "x-hellobooks-handler": "createSalesOrders",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Addresses": {
                    "type": "array"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BrandingThemeId": {
                    "type": "string"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "ConvertedToInvoiceRef": {
                    "type": "string"
                  },
                  "CounterpartyEntityRefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DueDate": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FunctionalTotalPayableAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsInterCompany": {
                    "type": "boolean"
                  },
                  "IsShippingSameAsBilling": {
                    "type": "boolean"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "MasterDiscountRef": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "OrderNumber": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "QuoteRef": {
                    "type": "string"
                  },
                  "SelectedBillingAddressId": {
                    "type": "string"
                  },
                  "SelectedShippingAddressId": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyOrderId": {
                    "type": "string"
                  },
                  "ShopifyOrderName": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SyncedToTally": {
                    "type": "boolean"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "Terms": {
                    "type": "object"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `salesOrder`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateSalesOrder",
        "summary": "Update salesOrder record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `salesOrder` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/salesOrder.grpc` → `updateSalesOrders`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "salesOrder"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/SalesOrder"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `SalesOrder` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/SalesOrder"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/salesOrder.grpc",
        "x-hellobooks-handler": "updateSalesOrders",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Addresses": {
                    "type": "array"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BrandingThemeId": {
                    "type": "string"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "ConvertedToInvoiceRef": {
                    "type": "string"
                  },
                  "CounterpartyEntityRefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DueDate": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FunctionalTotalPayableAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsInterCompany": {
                    "type": "boolean"
                  },
                  "IsShippingSameAsBilling": {
                    "type": "boolean"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "MasterDiscountRef": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "OrderNumber": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "QuoteRef": {
                    "type": "string"
                  },
                  "SelectedBillingAddressId": {
                    "type": "string"
                  },
                  "SelectedShippingAddressId": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyOrderId": {
                    "type": "string"
                  },
                  "ShopifyOrderName": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SyncedToTally": {
                    "type": "boolean"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "Terms": {
                    "type": "object"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `salesOrder`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteSalesOrder",
        "summary": "Delete salesOrder record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `salesOrder` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/salesOrder.grpc` → `deleteSalesOrders`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "salesOrder"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/SalesOrder"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `SalesOrder` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/SalesOrder"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/salesOrder.grpc",
        "x-hellobooks-handler": "deleteSalesOrders",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Addresses": {
                    "type": "array"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BrandingThemeId": {
                    "type": "string"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "ConvertedToInvoiceRef": {
                    "type": "string"
                  },
                  "CounterpartyEntityRefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DueDate": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FunctionalTotalPayableAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsInterCompany": {
                    "type": "boolean"
                  },
                  "IsShippingSameAsBilling": {
                    "type": "boolean"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "MasterDiscountRef": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "OrderNumber": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "QuoteRef": {
                    "type": "string"
                  },
                  "SelectedBillingAddressId": {
                    "type": "string"
                  },
                  "SelectedShippingAddressId": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyOrderId": {
                    "type": "string"
                  },
                  "ShopifyOrderName": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SyncedToTally": {
                    "type": "boolean"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "Terms": {
                    "type": "object"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `salesOrder`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/salesOrder/restore": {
      "put": {
        "operationId": "restoreSalesOrder",
        "summary": "Restore archived salesOrder record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `salesOrder` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/salesOrder.grpc` → `restoreSalesOrders`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "salesOrder"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/SalesOrder"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `SalesOrder` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/SalesOrder"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/salesOrder.grpc",
        "x-hellobooks-handler": "restoreSalesOrders",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Addresses": {
                    "type": "array"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BrandingThemeId": {
                    "type": "string"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "ConvertedToInvoiceRef": {
                    "type": "string"
                  },
                  "CounterpartyEntityRefId": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DueDate": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FinancialYear": {
                    "type": "string"
                  },
                  "FunctionalTotalPayableAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsInterCompany": {
                    "type": "boolean"
                  },
                  "IsShippingSameAsBilling": {
                    "type": "boolean"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "MasterDiscountRef": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "OrderNumber": {
                    "type": "string"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "QuoteRef": {
                    "type": "string"
                  },
                  "SelectedBillingAddressId": {
                    "type": "string"
                  },
                  "SelectedShippingAddressId": {
                    "type": "string"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyOrderId": {
                    "type": "string"
                  },
                  "ShopifyOrderName": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SyncedToTally": {
                    "type": "boolean"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyVoucherType": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "Terms": {
                    "type": "object"
                  },
                  "TermsAndConditions": {
                    "type": "object"
                  },
                  "TotalLabourAmount": {
                    "type": "number"
                  },
                  "TotalPayableAmount": {
                    "type": "number"
                  },
                  "TotalSupplyAmount": {
                    "type": "number"
                  },
                  "TotalTaxAmount": {
                    "type": "number"
                  },
                  "TotalTaxableAmount": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `salesOrder`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/salesOrder/{id}": {
      "get": {
        "operationId": "getSalesOrder",
        "summary": "Fetch one salesOrder record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `salesOrder` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/salesOrder.grpc` → `getSalesOrderById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "salesOrder"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/SalesOrder"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `SalesOrder` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/SalesOrder"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/salesOrder.grpc",
        "x-hellobooks-handler": "getSalesOrderById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/salesOrderLine": {
      "get": {
        "operationId": "listSalesOrderLine",
        "summary": "List salesOrderLine records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `salesOrderLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/salesOrderLine.grpc` → `getSalesOrderLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "salesOrderLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/SalesOrderLine"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `SalesOrderLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/SalesOrderLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/salesOrderLine.grpc",
        "x-hellobooks-handler": "getSalesOrderLines",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      },
      "post": {
        "operationId": "createSalesOrderLine",
        "summary": "Create salesOrderLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `salesOrderLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/salesOrderLine.grpc` → `createSalesOrderLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "salesOrderLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/SalesOrderLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `SalesOrderLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/SalesOrderLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/salesOrderLine.grpc",
        "x-hellobooks-handler": "createSalesOrderLines",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "BrandRefId": {
                    "type": "string"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DeliveredQuantity": {
                    "type": "number"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DiscountAmount": {
                    "type": "number"
                  },
                  "DiscountD2Amount": {
                    "type": "number"
                  },
                  "DiscountD2Percentage": {
                    "type": "number"
                  },
                  "DiscountD3Amount": {
                    "type": "number"
                  },
                  "DiscountD3Percentage": {
                    "type": "number"
                  },
                  "DiscountPercentage": {
                    "type": "number"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "InventoryQtyCommitted": {
                    "type": "number"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LabourAccountHeadRef": {
                    "type": "string"
                  },
                  "LabourAmount": {
                    "type": "number"
                  },
                  "LabourHSN_SAC": {
                    "type": "string"
                  },
                  "LabourRate": {
                    "type": "number"
                  },
                  "LabourTaxAmount": {
                    "type": "number"
                  },
                  "LabourTaxRate": {
                    "type": "number"
                  },
                  "LabourTaxRefId": {
                    "type": "string"
                  },
                  "LineExchangeRate": {
                    "type": "number"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "SalesOrderId": {
                    "type": "string"
                  },
                  "ShopifyLineId": {
                    "type": "string"
                  },
                  "ShopifyVariantId": {
                    "type": "string"
                  },
                  "SupplyAmount": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "UnitRefId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `salesOrderLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateSalesOrderLine",
        "summary": "Update salesOrderLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `salesOrderLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/salesOrderLine.grpc` → `updateSalesOrderLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "salesOrderLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/SalesOrderLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `SalesOrderLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/SalesOrderLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/salesOrderLine.grpc",
        "x-hellobooks-handler": "updateSalesOrderLines",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "BrandRefId": {
                    "type": "string"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DeliveredQuantity": {
                    "type": "number"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DiscountAmount": {
                    "type": "number"
                  },
                  "DiscountD2Amount": {
                    "type": "number"
                  },
                  "DiscountD2Percentage": {
                    "type": "number"
                  },
                  "DiscountD3Amount": {
                    "type": "number"
                  },
                  "DiscountD3Percentage": {
                    "type": "number"
                  },
                  "DiscountPercentage": {
                    "type": "number"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "InventoryQtyCommitted": {
                    "type": "number"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LabourAccountHeadRef": {
                    "type": "string"
                  },
                  "LabourAmount": {
                    "type": "number"
                  },
                  "LabourHSN_SAC": {
                    "type": "string"
                  },
                  "LabourRate": {
                    "type": "number"
                  },
                  "LabourTaxAmount": {
                    "type": "number"
                  },
                  "LabourTaxRate": {
                    "type": "number"
                  },
                  "LabourTaxRefId": {
                    "type": "string"
                  },
                  "LineExchangeRate": {
                    "type": "number"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "SalesOrderId": {
                    "type": "string"
                  },
                  "ShopifyLineId": {
                    "type": "string"
                  },
                  "ShopifyVariantId": {
                    "type": "string"
                  },
                  "SupplyAmount": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "UnitRefId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `salesOrderLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteSalesOrderLine",
        "summary": "Delete salesOrderLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `salesOrderLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/salesOrderLine.grpc` → `deleteSalesOrderLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:write\")`.",
        "tags": [
          "salesOrderLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/SalesOrderLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `SalesOrderLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/SalesOrderLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/salesOrderLine.grpc",
        "x-hellobooks-handler": "deleteSalesOrderLines",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:write"
        ],
        "x-hellobooks-scope-domain": "sales",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AccountHeadRef": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "BrandRefId": {
                    "type": "string"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "DeliveredQuantity": {
                    "type": "number"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DiscountAmount": {
                    "type": "number"
                  },
                  "DiscountD2Amount": {
                    "type": "number"
                  },
                  "DiscountD2Percentage": {
                    "type": "number"
                  },
                  "DiscountD3Amount": {
                    "type": "number"
                  },
                  "DiscountD3Percentage": {
                    "type": "number"
                  },
                  "DiscountPercentage": {
                    "type": "number"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "InventoryQtyCommitted": {
                    "type": "number"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "LabourAccountHeadRef": {
                    "type": "string"
                  },
                  "LabourAmount": {
                    "type": "number"
                  },
                  "LabourHSN_SAC": {
                    "type": "string"
                  },
                  "LabourRate": {
                    "type": "number"
                  },
                  "LabourTaxAmount": {
                    "type": "number"
                  },
                  "LabourTaxRate": {
                    "type": "number"
                  },
                  "LabourTaxRefId": {
                    "type": "string"
                  },
                  "LineExchangeRate": {
                    "type": "number"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "number"
                  },
                  "Rate": {
                    "type": "number"
                  },
                  "SalesOrderId": {
                    "type": "string"
                  },
                  "ShopifyLineId": {
                    "type": "string"
                  },
                  "ShopifyVariantId": {
                    "type": "string"
                  },
                  "SupplyAmount": {
                    "type": "number"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "UnitRefId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `salesOrderLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/salesOrderLine/{id}": {
      "get": {
        "operationId": "getSalesOrderLine",
        "summary": "Fetch one salesOrderLine record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `salesOrderLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/salesOrderLine.grpc` → `getSalesOrderLineById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"sales:read\")`.",
        "tags": [
          "salesOrderLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "sales:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/SalesOrderLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `SalesOrderLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/SalesOrderLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/salesOrderLine.grpc",
        "x-hellobooks-handler": "getSalesOrderLineById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "sales:read"
        ],
        "x-hellobooks-scope-domain": "sales"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/taxation": {
      "get": {
        "operationId": "listTaxation",
        "summary": "List taxation records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `taxation` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/taxation.grpc` → `getTaxations`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:read\")`.",
        "tags": [
          "taxation"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Taxation"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `Taxation` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/Taxation"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/taxation.grpc",
        "x-hellobooks-handler": "getTaxations",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:read"
        ],
        "x-hellobooks-scope-domain": "accounting"
      },
      "post": {
        "operationId": "createTaxation",
        "summary": "Create taxation record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `taxation` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/taxation.grpc` → `createTaxations`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "taxation"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Taxation"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Taxation` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Taxation"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/taxation.grpc",
        "x-hellobooks-handler": "createTaxations",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "CalculationMethod": {
                    "type": "string"
                  },
                  "CountryRef": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsSystemDefined": {
                    "type": "boolean"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "TallyDepth": {
                    "type": "integer"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TallyGroupPath": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyLedgerName": {
                    "type": "string"
                  },
                  "TallyParentGroup": {
                    "type": "string"
                  },
                  "TallyPrimaryGroup": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `taxation`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateTaxation",
        "summary": "Update taxation record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `taxation` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/taxation.grpc` → `updateTaxations`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "taxation"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Taxation"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Taxation` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Taxation"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/taxation.grpc",
        "x-hellobooks-handler": "updateTaxations",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "CalculationMethod": {
                    "type": "string"
                  },
                  "CountryRef": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsSystemDefined": {
                    "type": "boolean"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "TallyDepth": {
                    "type": "integer"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TallyGroupPath": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyLedgerName": {
                    "type": "string"
                  },
                  "TallyParentGroup": {
                    "type": "string"
                  },
                  "TallyPrimaryGroup": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `taxation`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteTaxation",
        "summary": "Delete taxation record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `taxation` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/taxation.grpc` → `deleteTaxations`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "taxation"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Taxation"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Taxation` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Taxation"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/taxation.grpc",
        "x-hellobooks-handler": "deleteTaxations",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "CalculationMethod": {
                    "type": "string"
                  },
                  "CountryRef": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsSystemDefined": {
                    "type": "boolean"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "TallyDepth": {
                    "type": "integer"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TallyGroupPath": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyLedgerName": {
                    "type": "string"
                  },
                  "TallyParentGroup": {
                    "type": "string"
                  },
                  "TallyPrimaryGroup": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `taxation`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/taxation/restore": {
      "put": {
        "operationId": "restoreTaxation",
        "summary": "Restore archived taxation record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `taxation` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/taxation.grpc` → `restoreTaxations`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:write\")`.",
        "tags": [
          "taxation"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Taxation"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Taxation` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Taxation"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/taxation.grpc",
        "x-hellobooks-handler": "restoreTaxations",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:write"
        ],
        "x-hellobooks-scope-domain": "accounting",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "CalculationMethod": {
                    "type": "string"
                  },
                  "CountryRef": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsSystemDefined": {
                    "type": "boolean"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "TallyDepth": {
                    "type": "integer"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TallyGroupPath": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyLedgerName": {
                    "type": "string"
                  },
                  "TallyParentGroup": {
                    "type": "string"
                  },
                  "TallyPrimaryGroup": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `taxation`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/taxation/{id}": {
      "get": {
        "operationId": "getTaxation",
        "summary": "Fetch one taxation record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `taxation` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/taxation.grpc` → `getTaxationById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"accounting:read\")`.",
        "tags": [
          "taxation"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "accounting:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Taxation"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Taxation` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Taxation"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/taxation.grpc",
        "x-hellobooks-handler": "getTaxationById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "accounting:read"
        ],
        "x-hellobooks-scope-domain": "accounting"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/transaction": {
      "get": {
        "operationId": "listTransaction",
        "summary": "List transaction records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `transaction` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/transaction.grpc` → `getTransactions`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:read\")`.",
        "tags": [
          "transaction"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Transaction"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `Transaction` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/Transaction"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/transaction.grpc",
        "x-hellobooks-handler": "getTransactions",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:read"
        ],
        "x-hellobooks-scope-domain": "banking"
      },
      "post": {
        "operationId": "createTransaction",
        "summary": "Create transaction record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `transaction` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/transaction.grpc` → `createTransactions`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:write\")`.",
        "tags": [
          "transaction"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Transaction"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Transaction` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Transaction"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/transaction.grpc",
        "x-hellobooks-handler": "createTransactions",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:write"
        ],
        "x-hellobooks-scope-domain": "banking",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AnomalyDetectedAt": {
                    "type": "string"
                  },
                  "AnomalyDismissReason": {
                    "type": "string"
                  },
                  "AnomalyDismissedAt": {
                    "type": "string"
                  },
                  "AnomalyDismissedBy": {
                    "type": "string"
                  },
                  "AnomalyLLMReason": {
                    "type": "string"
                  },
                  "AnomalyReason": {
                    "type": "array"
                  },
                  "AnomalyScore": {
                    "type": "number"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "CategorizedStatus": {
                    "type": "string"
                  },
                  "CategoryConfidence": {
                    "type": "integer"
                  },
                  "CleanDescription": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExtractedPayeeName": {
                    "type": "string"
                  },
                  "FromAccountRef": {
                    "type": "string"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "HideFromReports": {
                    "type": "boolean"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "InProcess": {
                    "type": "boolean"
                  },
                  "IsAnomalous": {
                    "type": "boolean"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsImported": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsPending": {
                    "type": "boolean"
                  },
                  "IsPublishedToQbo": {
                    "type": "boolean"
                  },
                  "IsPublishedToWave": {
                    "type": "boolean"
                  },
                  "IsReconciledWithClosingPeriod": {
                    "type": "boolean"
                  },
                  "IsReconciliationAdjustment": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "IsSplit": {
                    "type": "boolean"
                  },
                  "IterationCount": {
                    "type": "integer"
                  },
                  "LastCategorizedAt": {
                    "type": "string"
                  },
                  "LastSourceUpgradeAt": {
                    "type": "string"
                  },
                  "MatchCandidateCount": {
                    "type": "integer"
                  },
                  "MatchCreatedPaymentIds": {
                    "type": "array"
                  },
                  "MatchDocConfidence": {
                    "type": "integer"
                  },
                  "MatchDocRef": {
                    "type": "string"
                  },
                  "MatchDocType": {
                    "type": "string"
                  },
                  "MatchMethod": {
                    "type": "string"
                  },
                  "MatchReconciledPaymentIds": {
                    "type": "array"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PayeeConfidence": {
                    "type": "integer"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PaymentAs": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "PlaidPendingTransactionId": {
                    "type": "string"
                  },
                  "PostedByActionId": {
                    "type": "string"
                  },
                  "PostsJournal": {
                    "type": "boolean"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Reason": {
                    "type": "string"
                  },
                  "ReconcilePeriodRefId": {
                    "type": "string"
                  },
                  "ReconciledAt": {
                    "type": "string"
                  },
                  "ReconciliationMode": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "SecondarySourcesCount": {
                    "type": "integer"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyPayoutId": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "Source": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SuggestedPayeeRef": {
                    "type": "string"
                  },
                  "SuggestedPayeeType": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "Tags": {
                    "type": "object"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TaxIntelligenceJson": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TotalAmount": {
                    "type": "number"
                  },
                  "TotalCGST": {
                    "type": "number"
                  },
                  "TotalCess": {
                    "type": "number"
                  },
                  "TotalCessNonAdvalorem": {
                    "type": "number"
                  },
                  "TotalIGST": {
                    "type": "number"
                  },
                  "TotalIterCachedTokens": {
                    "type": "integer"
                  },
                  "TotalIterInputTokens": {
                    "type": "integer"
                  },
                  "TotalIterOutputTokens": {
                    "type": "integer"
                  },
                  "TotalIterTotalINR": {
                    "type": "number"
                  },
                  "TotalIterTotalUSD": {
                    "type": "number"
                  },
                  "TotalSGST": {
                    "type": "number"
                  },
                  "TotalUTGST": {
                    "type": "number"
                  },
                  "TxnDate": {
                    "type": "string"
                  },
                  "TxnMode": {
                    "type": "string"
                  },
                  "TxnType": {
                    "type": "string"
                  },
                  "Type": {
                    "type": "string"
                  },
                  "UpdatedAt": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "aiConfidence": {
                    "type": "integer"
                  }
                },
                "description": "Writable fields for `transaction`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateTransaction",
        "summary": "Update transaction record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `transaction` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/transaction.grpc` → `updateTransactions`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:write\")`.",
        "tags": [
          "transaction"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Transaction"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Transaction` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Transaction"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/transaction.grpc",
        "x-hellobooks-handler": "updateTransactions",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:write"
        ],
        "x-hellobooks-scope-domain": "banking",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AnomalyDetectedAt": {
                    "type": "string"
                  },
                  "AnomalyDismissReason": {
                    "type": "string"
                  },
                  "AnomalyDismissedAt": {
                    "type": "string"
                  },
                  "AnomalyDismissedBy": {
                    "type": "string"
                  },
                  "AnomalyLLMReason": {
                    "type": "string"
                  },
                  "AnomalyReason": {
                    "type": "array"
                  },
                  "AnomalyScore": {
                    "type": "number"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "CategorizedStatus": {
                    "type": "string"
                  },
                  "CategoryConfidence": {
                    "type": "integer"
                  },
                  "CleanDescription": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExtractedPayeeName": {
                    "type": "string"
                  },
                  "FromAccountRef": {
                    "type": "string"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "HideFromReports": {
                    "type": "boolean"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "InProcess": {
                    "type": "boolean"
                  },
                  "IsAnomalous": {
                    "type": "boolean"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsImported": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsPending": {
                    "type": "boolean"
                  },
                  "IsPublishedToQbo": {
                    "type": "boolean"
                  },
                  "IsPublishedToWave": {
                    "type": "boolean"
                  },
                  "IsReconciledWithClosingPeriod": {
                    "type": "boolean"
                  },
                  "IsReconciliationAdjustment": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "IsSplit": {
                    "type": "boolean"
                  },
                  "IterationCount": {
                    "type": "integer"
                  },
                  "LastCategorizedAt": {
                    "type": "string"
                  },
                  "LastSourceUpgradeAt": {
                    "type": "string"
                  },
                  "MatchCandidateCount": {
                    "type": "integer"
                  },
                  "MatchCreatedPaymentIds": {
                    "type": "array"
                  },
                  "MatchDocConfidence": {
                    "type": "integer"
                  },
                  "MatchDocRef": {
                    "type": "string"
                  },
                  "MatchDocType": {
                    "type": "string"
                  },
                  "MatchMethod": {
                    "type": "string"
                  },
                  "MatchReconciledPaymentIds": {
                    "type": "array"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PayeeConfidence": {
                    "type": "integer"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PaymentAs": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "PlaidPendingTransactionId": {
                    "type": "string"
                  },
                  "PostedByActionId": {
                    "type": "string"
                  },
                  "PostsJournal": {
                    "type": "boolean"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Reason": {
                    "type": "string"
                  },
                  "ReconcilePeriodRefId": {
                    "type": "string"
                  },
                  "ReconciledAt": {
                    "type": "string"
                  },
                  "ReconciliationMode": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "SecondarySourcesCount": {
                    "type": "integer"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyPayoutId": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "Source": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SuggestedPayeeRef": {
                    "type": "string"
                  },
                  "SuggestedPayeeType": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "Tags": {
                    "type": "object"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TaxIntelligenceJson": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TotalAmount": {
                    "type": "number"
                  },
                  "TotalCGST": {
                    "type": "number"
                  },
                  "TotalCess": {
                    "type": "number"
                  },
                  "TotalCessNonAdvalorem": {
                    "type": "number"
                  },
                  "TotalIGST": {
                    "type": "number"
                  },
                  "TotalIterCachedTokens": {
                    "type": "integer"
                  },
                  "TotalIterInputTokens": {
                    "type": "integer"
                  },
                  "TotalIterOutputTokens": {
                    "type": "integer"
                  },
                  "TotalIterTotalINR": {
                    "type": "number"
                  },
                  "TotalIterTotalUSD": {
                    "type": "number"
                  },
                  "TotalSGST": {
                    "type": "number"
                  },
                  "TotalUTGST": {
                    "type": "number"
                  },
                  "TxnDate": {
                    "type": "string"
                  },
                  "TxnMode": {
                    "type": "string"
                  },
                  "TxnType": {
                    "type": "string"
                  },
                  "Type": {
                    "type": "string"
                  },
                  "UpdatedAt": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "aiConfidence": {
                    "type": "integer"
                  }
                },
                "description": "Writable fields for `transaction`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteTransaction",
        "summary": "Delete transaction record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `transaction` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/transaction.grpc` → `deleteTransactions`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:write\")`.",
        "tags": [
          "transaction"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Transaction"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Transaction` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Transaction"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/transaction.grpc",
        "x-hellobooks-handler": "deleteTransactions",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:write"
        ],
        "x-hellobooks-scope-domain": "banking",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AnomalyDetectedAt": {
                    "type": "string"
                  },
                  "AnomalyDismissReason": {
                    "type": "string"
                  },
                  "AnomalyDismissedAt": {
                    "type": "string"
                  },
                  "AnomalyDismissedBy": {
                    "type": "string"
                  },
                  "AnomalyLLMReason": {
                    "type": "string"
                  },
                  "AnomalyReason": {
                    "type": "array"
                  },
                  "AnomalyScore": {
                    "type": "number"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "CategorizedStatus": {
                    "type": "string"
                  },
                  "CategoryConfidence": {
                    "type": "integer"
                  },
                  "CleanDescription": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExtractedPayeeName": {
                    "type": "string"
                  },
                  "FromAccountRef": {
                    "type": "string"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "HideFromReports": {
                    "type": "boolean"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "InProcess": {
                    "type": "boolean"
                  },
                  "IsAnomalous": {
                    "type": "boolean"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsImported": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsPending": {
                    "type": "boolean"
                  },
                  "IsPublishedToQbo": {
                    "type": "boolean"
                  },
                  "IsPublishedToWave": {
                    "type": "boolean"
                  },
                  "IsReconciledWithClosingPeriod": {
                    "type": "boolean"
                  },
                  "IsReconciliationAdjustment": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "IsSplit": {
                    "type": "boolean"
                  },
                  "IterationCount": {
                    "type": "integer"
                  },
                  "LastCategorizedAt": {
                    "type": "string"
                  },
                  "LastSourceUpgradeAt": {
                    "type": "string"
                  },
                  "MatchCandidateCount": {
                    "type": "integer"
                  },
                  "MatchCreatedPaymentIds": {
                    "type": "array"
                  },
                  "MatchDocConfidence": {
                    "type": "integer"
                  },
                  "MatchDocRef": {
                    "type": "string"
                  },
                  "MatchDocType": {
                    "type": "string"
                  },
                  "MatchMethod": {
                    "type": "string"
                  },
                  "MatchReconciledPaymentIds": {
                    "type": "array"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PayeeConfidence": {
                    "type": "integer"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PaymentAs": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "PlaidPendingTransactionId": {
                    "type": "string"
                  },
                  "PostedByActionId": {
                    "type": "string"
                  },
                  "PostsJournal": {
                    "type": "boolean"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Reason": {
                    "type": "string"
                  },
                  "ReconcilePeriodRefId": {
                    "type": "string"
                  },
                  "ReconciledAt": {
                    "type": "string"
                  },
                  "ReconciliationMode": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "SecondarySourcesCount": {
                    "type": "integer"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyPayoutId": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "Source": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SuggestedPayeeRef": {
                    "type": "string"
                  },
                  "SuggestedPayeeType": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "Tags": {
                    "type": "object"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TaxIntelligenceJson": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TotalAmount": {
                    "type": "number"
                  },
                  "TotalCGST": {
                    "type": "number"
                  },
                  "TotalCess": {
                    "type": "number"
                  },
                  "TotalCessNonAdvalorem": {
                    "type": "number"
                  },
                  "TotalIGST": {
                    "type": "number"
                  },
                  "TotalIterCachedTokens": {
                    "type": "integer"
                  },
                  "TotalIterInputTokens": {
                    "type": "integer"
                  },
                  "TotalIterOutputTokens": {
                    "type": "integer"
                  },
                  "TotalIterTotalINR": {
                    "type": "number"
                  },
                  "TotalIterTotalUSD": {
                    "type": "number"
                  },
                  "TotalSGST": {
                    "type": "number"
                  },
                  "TotalUTGST": {
                    "type": "number"
                  },
                  "TxnDate": {
                    "type": "string"
                  },
                  "TxnMode": {
                    "type": "string"
                  },
                  "TxnType": {
                    "type": "string"
                  },
                  "Type": {
                    "type": "string"
                  },
                  "UpdatedAt": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "aiConfidence": {
                    "type": "integer"
                  }
                },
                "description": "Writable fields for `transaction`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/transaction/restore": {
      "put": {
        "operationId": "restoreTransaction",
        "summary": "Restore archived transaction record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `transaction` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/transaction.grpc` → `restoreTransactions`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:write\")`.",
        "tags": [
          "transaction"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Transaction"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Transaction` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Transaction"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/transaction.grpc",
        "x-hellobooks-handler": "restoreTransactions",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:write"
        ],
        "x-hellobooks-scope-domain": "banking",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AnomalyDetectedAt": {
                    "type": "string"
                  },
                  "AnomalyDismissReason": {
                    "type": "string"
                  },
                  "AnomalyDismissedAt": {
                    "type": "string"
                  },
                  "AnomalyDismissedBy": {
                    "type": "string"
                  },
                  "AnomalyLLMReason": {
                    "type": "string"
                  },
                  "AnomalyReason": {
                    "type": "array"
                  },
                  "AnomalyScore": {
                    "type": "number"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "CategorizedStatus": {
                    "type": "string"
                  },
                  "CategoryConfidence": {
                    "type": "integer"
                  },
                  "CleanDescription": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "ExtractedPayeeName": {
                    "type": "string"
                  },
                  "FromAccountRef": {
                    "type": "string"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "HideFromReports": {
                    "type": "boolean"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "InProcess": {
                    "type": "boolean"
                  },
                  "IsAnomalous": {
                    "type": "boolean"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsImported": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsPending": {
                    "type": "boolean"
                  },
                  "IsPublishedToQbo": {
                    "type": "boolean"
                  },
                  "IsPublishedToWave": {
                    "type": "boolean"
                  },
                  "IsReconciledWithClosingPeriod": {
                    "type": "boolean"
                  },
                  "IsReconciliationAdjustment": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "IsSplit": {
                    "type": "boolean"
                  },
                  "IterationCount": {
                    "type": "integer"
                  },
                  "LastCategorizedAt": {
                    "type": "string"
                  },
                  "LastSourceUpgradeAt": {
                    "type": "string"
                  },
                  "MatchCandidateCount": {
                    "type": "integer"
                  },
                  "MatchCreatedPaymentIds": {
                    "type": "array"
                  },
                  "MatchDocConfidence": {
                    "type": "integer"
                  },
                  "MatchDocRef": {
                    "type": "string"
                  },
                  "MatchDocType": {
                    "type": "string"
                  },
                  "MatchMethod": {
                    "type": "string"
                  },
                  "MatchReconciledPaymentIds": {
                    "type": "array"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PayeeConfidence": {
                    "type": "integer"
                  },
                  "PayeeRef": {
                    "type": "string"
                  },
                  "PayeeType": {
                    "type": "string"
                  },
                  "PaymentAs": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "PlaidPendingTransactionId": {
                    "type": "string"
                  },
                  "PostedByActionId": {
                    "type": "string"
                  },
                  "PostsJournal": {
                    "type": "boolean"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Reason": {
                    "type": "string"
                  },
                  "ReconcilePeriodRefId": {
                    "type": "string"
                  },
                  "ReconciledAt": {
                    "type": "string"
                  },
                  "ReconciliationMode": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "SecondarySourcesCount": {
                    "type": "integer"
                  },
                  "ShopifyLinkedAt": {
                    "type": "string"
                  },
                  "ShopifyPayoutId": {
                    "type": "string"
                  },
                  "ShopifyShop": {
                    "type": "string"
                  },
                  "Source": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SuggestedPayeeRef": {
                    "type": "string"
                  },
                  "SuggestedPayeeType": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "Tags": {
                    "type": "object"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TaxIntelligenceJson": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TotalAmount": {
                    "type": "number"
                  },
                  "TotalCGST": {
                    "type": "number"
                  },
                  "TotalCess": {
                    "type": "number"
                  },
                  "TotalCessNonAdvalorem": {
                    "type": "number"
                  },
                  "TotalIGST": {
                    "type": "number"
                  },
                  "TotalIterCachedTokens": {
                    "type": "integer"
                  },
                  "TotalIterInputTokens": {
                    "type": "integer"
                  },
                  "TotalIterOutputTokens": {
                    "type": "integer"
                  },
                  "TotalIterTotalINR": {
                    "type": "number"
                  },
                  "TotalIterTotalUSD": {
                    "type": "number"
                  },
                  "TotalSGST": {
                    "type": "number"
                  },
                  "TotalUTGST": {
                    "type": "number"
                  },
                  "TxnDate": {
                    "type": "string"
                  },
                  "TxnMode": {
                    "type": "string"
                  },
                  "TxnType": {
                    "type": "string"
                  },
                  "Type": {
                    "type": "string"
                  },
                  "UpdatedAt": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "aiConfidence": {
                    "type": "integer"
                  }
                },
                "description": "Writable fields for `transaction`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/transaction/{id}": {
      "get": {
        "operationId": "getTransaction",
        "summary": "Fetch one transaction record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `transaction` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/transaction.grpc` → `getTransactionById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:read\")`.",
        "tags": [
          "transaction"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Transaction"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Transaction` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Transaction"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/transaction.grpc",
        "x-hellobooks-handler": "getTransactionById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:read"
        ],
        "x-hellobooks-scope-domain": "banking"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/transactionCategorizationIteration": {
      "get": {
        "operationId": "listTransactionCategorizationIteration",
        "summary": "List transactionCategorizationIteration records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `transactionCategorizationIteration` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/transactionCategorizationIteration.grpc` → `getTransactionCategorizationIterations`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:read\")`.",
        "tags": [
          "transactionCategorizationIteration"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/TransactionCategorizationIteration"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `TransactionCategorizationIteration` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/TransactionCategorizationIteration"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/transactionCategorizationIteration.grpc",
        "x-hellobooks-handler": "getTransactionCategorizationIterations",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:read"
        ],
        "x-hellobooks-scope-domain": "banking"
      },
      "post": {
        "operationId": "createTransactionCategorizationIteration",
        "summary": "Create transactionCategorizationIteration record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `transactionCategorizationIteration` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/transactionCategorizationIteration.grpc` → `createTransactionCategorizationIterations`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:write\")`.",
        "tags": [
          "transactionCategorizationIteration"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/TransactionCategorizationIteration"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `TransactionCategorizationIteration` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/TransactionCategorizationIteration"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/transactionCategorizationIteration.grpc",
        "x-hellobooks-handler": "createTransactionCategorizationIterations",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:write"
        ],
        "x-hellobooks-scope-domain": "banking",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Breakdown": {
                    "type": "object"
                  },
                  "CategoryCachedTokens": {
                    "type": "integer"
                  },
                  "CategoryInputTokens": {
                    "type": "integer"
                  },
                  "CategoryOutputTokens": {
                    "type": "integer"
                  },
                  "CategoryTotalINR": {
                    "type": "number"
                  },
                  "CategoryTotalUSD": {
                    "type": "number"
                  },
                  "EndedAt": {
                    "type": "string"
                  },
                  "IsFallback": {
                    "type": "boolean"
                  },
                  "IterationNumber": {
                    "type": "integer"
                  },
                  "Model": {
                    "type": "string"
                  },
                  "ModelTier": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "object"
                  },
                  "PayeeCachedTokens": {
                    "type": "integer"
                  },
                  "PayeeInputTokens": {
                    "type": "integer"
                  },
                  "PayeeOutputTokens": {
                    "type": "integer"
                  },
                  "PayeeTotalINR": {
                    "type": "number"
                  },
                  "PayeeTotalUSD": {
                    "type": "number"
                  },
                  "PricingContext": {
                    "type": "object"
                  },
                  "Provider": {
                    "type": "string"
                  },
                  "TransactionId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `transactionCategorizationIteration`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateTransactionCategorizationIteration",
        "summary": "Update transactionCategorizationIteration record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `transactionCategorizationIteration` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/transactionCategorizationIteration.grpc` → `updateTransactionCategorizationIterations`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:write\")`.",
        "tags": [
          "transactionCategorizationIteration"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/TransactionCategorizationIteration"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `TransactionCategorizationIteration` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/TransactionCategorizationIteration"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/transactionCategorizationIteration.grpc",
        "x-hellobooks-handler": "updateTransactionCategorizationIterations",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:write"
        ],
        "x-hellobooks-scope-domain": "banking",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Breakdown": {
                    "type": "object"
                  },
                  "CategoryCachedTokens": {
                    "type": "integer"
                  },
                  "CategoryInputTokens": {
                    "type": "integer"
                  },
                  "CategoryOutputTokens": {
                    "type": "integer"
                  },
                  "CategoryTotalINR": {
                    "type": "number"
                  },
                  "CategoryTotalUSD": {
                    "type": "number"
                  },
                  "EndedAt": {
                    "type": "string"
                  },
                  "IsFallback": {
                    "type": "boolean"
                  },
                  "IterationNumber": {
                    "type": "integer"
                  },
                  "Model": {
                    "type": "string"
                  },
                  "ModelTier": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "object"
                  },
                  "PayeeCachedTokens": {
                    "type": "integer"
                  },
                  "PayeeInputTokens": {
                    "type": "integer"
                  },
                  "PayeeOutputTokens": {
                    "type": "integer"
                  },
                  "PayeeTotalINR": {
                    "type": "number"
                  },
                  "PayeeTotalUSD": {
                    "type": "number"
                  },
                  "PricingContext": {
                    "type": "object"
                  },
                  "Provider": {
                    "type": "string"
                  },
                  "TransactionId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `transactionCategorizationIteration`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteTransactionCategorizationIteration",
        "summary": "Delete transactionCategorizationIteration record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `transactionCategorizationIteration` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/transactionCategorizationIteration.grpc` → `deleteTransactionCategorizationIterations`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:write\")`.",
        "tags": [
          "transactionCategorizationIteration"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/TransactionCategorizationIteration"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `TransactionCategorizationIteration` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/TransactionCategorizationIteration"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/transactionCategorizationIteration.grpc",
        "x-hellobooks-handler": "deleteTransactionCategorizationIterations",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:write"
        ],
        "x-hellobooks-scope-domain": "banking",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Breakdown": {
                    "type": "object"
                  },
                  "CategoryCachedTokens": {
                    "type": "integer"
                  },
                  "CategoryInputTokens": {
                    "type": "integer"
                  },
                  "CategoryOutputTokens": {
                    "type": "integer"
                  },
                  "CategoryTotalINR": {
                    "type": "number"
                  },
                  "CategoryTotalUSD": {
                    "type": "number"
                  },
                  "EndedAt": {
                    "type": "string"
                  },
                  "IsFallback": {
                    "type": "boolean"
                  },
                  "IterationNumber": {
                    "type": "integer"
                  },
                  "Model": {
                    "type": "string"
                  },
                  "ModelTier": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "object"
                  },
                  "PayeeCachedTokens": {
                    "type": "integer"
                  },
                  "PayeeInputTokens": {
                    "type": "integer"
                  },
                  "PayeeOutputTokens": {
                    "type": "integer"
                  },
                  "PayeeTotalINR": {
                    "type": "number"
                  },
                  "PayeeTotalUSD": {
                    "type": "number"
                  },
                  "PricingContext": {
                    "type": "object"
                  },
                  "Provider": {
                    "type": "string"
                  },
                  "TransactionId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `transactionCategorizationIteration`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/transactionCategorizationIteration/{id}": {
      "get": {
        "operationId": "getTransactionCategorizationIteration",
        "summary": "Fetch one transactionCategorizationIteration record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `transactionCategorizationIteration` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/transactionCategorizationIteration.grpc` → `getTransactionCategorizationIterationById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:read\")`.",
        "tags": [
          "transactionCategorizationIteration"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/TransactionCategorizationIteration"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `TransactionCategorizationIteration` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/TransactionCategorizationIteration"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/transactionCategorizationIteration.grpc",
        "x-hellobooks-handler": "getTransactionCategorizationIterationById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:read"
        ],
        "x-hellobooks-scope-domain": "banking"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/transactionLine": {
      "post": {
        "operationId": "createTransactionLine",
        "summary": "Create transactionLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `transactionLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/transactionLine.grpc` → `createTransactionLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:write\")`.",
        "tags": [
          "transactionLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/TransactionLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `TransactionLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/TransactionLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/transactionLine.grpc",
        "x-hellobooks-handler": "createTransactionLines",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:write"
        ],
        "x-hellobooks-scope-domain": "banking",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AIConfidence": {
                    "type": "number"
                  },
                  "AIReasoning": {
                    "type": "string"
                  },
                  "AISuggested": {
                    "type": "boolean"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "CleanDescription": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomerRefId": {
                    "type": "string"
                  },
                  "DepartmentRefId": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "JobCostRef": {
                    "type": "string"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "string"
                  },
                  "SuggestedClassRef": {
                    "type": "string"
                  },
                  "SuggestedJobCostRef": {
                    "type": "string"
                  },
                  "SuggestedLocationRef": {
                    "type": "string"
                  },
                  "SuggestedProjectRef": {
                    "type": "string"
                  },
                  "SuggestedToAccountRef": {
                    "type": "string"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "ToAccountRef": {
                    "type": "string"
                  },
                  "TransactionId": {
                    "type": "string"
                  },
                  "UnitPrice": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `transactionLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateTransactionLine",
        "summary": "Update transactionLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `transactionLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/transactionLine.grpc` → `updateTransactionLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:write\")`.",
        "tags": [
          "transactionLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/TransactionLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `TransactionLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/TransactionLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/transactionLine.grpc",
        "x-hellobooks-handler": "updateTransactionLines",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:write"
        ],
        "x-hellobooks-scope-domain": "banking",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AIConfidence": {
                    "type": "number"
                  },
                  "AIReasoning": {
                    "type": "string"
                  },
                  "AISuggested": {
                    "type": "boolean"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "CleanDescription": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomerRefId": {
                    "type": "string"
                  },
                  "DepartmentRefId": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "JobCostRef": {
                    "type": "string"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "string"
                  },
                  "SuggestedClassRef": {
                    "type": "string"
                  },
                  "SuggestedJobCostRef": {
                    "type": "string"
                  },
                  "SuggestedLocationRef": {
                    "type": "string"
                  },
                  "SuggestedProjectRef": {
                    "type": "string"
                  },
                  "SuggestedToAccountRef": {
                    "type": "string"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "ToAccountRef": {
                    "type": "string"
                  },
                  "TransactionId": {
                    "type": "string"
                  },
                  "UnitPrice": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `transactionLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteTransactionLine",
        "summary": "Delete transactionLine record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `transactionLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/transactionLine.grpc` → `deleteTransactionLines`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:write\")`.",
        "tags": [
          "transactionLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/TransactionLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `TransactionLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/TransactionLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/transactionLine.grpc",
        "x-hellobooks-handler": "deleteTransactionLines",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:write"
        ],
        "x-hellobooks-scope-domain": "banking",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AIConfidence": {
                    "type": "number"
                  },
                  "AIReasoning": {
                    "type": "string"
                  },
                  "AISuggested": {
                    "type": "boolean"
                  },
                  "Amount": {
                    "type": "number"
                  },
                  "ClassComponentRef1": {
                    "type": "string"
                  },
                  "ClassComponentRef2": {
                    "type": "string"
                  },
                  "ClassComponentRef3": {
                    "type": "string"
                  },
                  "ClassComponentRef4": {
                    "type": "string"
                  },
                  "ClassRef1": {
                    "type": "string"
                  },
                  "ClassRef2": {
                    "type": "string"
                  },
                  "ClassRef3": {
                    "type": "string"
                  },
                  "ClassRef4": {
                    "type": "string"
                  },
                  "CleanDescription": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomerRefId": {
                    "type": "string"
                  },
                  "DepartmentRefId": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "HSN_SAC": {
                    "type": "string"
                  },
                  "ItemRef": {
                    "type": "string"
                  },
                  "JobCostRef": {
                    "type": "string"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "ProjectRef": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "Quantity": {
                    "type": "string"
                  },
                  "SuggestedClassRef": {
                    "type": "string"
                  },
                  "SuggestedJobCostRef": {
                    "type": "string"
                  },
                  "SuggestedLocationRef": {
                    "type": "string"
                  },
                  "SuggestedProjectRef": {
                    "type": "string"
                  },
                  "SuggestedToAccountRef": {
                    "type": "string"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "ToAccountRef": {
                    "type": "string"
                  },
                  "TransactionId": {
                    "type": "string"
                  },
                  "UnitPrice": {
                    "type": "number"
                  }
                },
                "description": "Writable fields for `transactionLine`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/transactionLine/{id}": {
      "get": {
        "operationId": "getTransactionLine",
        "summary": "Fetch one transactionLine record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `transactionLine` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/transactionLine.grpc` → `getTransactionLineById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:read\")`.",
        "tags": [
          "transactionLine"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/TransactionLine"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `TransactionLine` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/TransactionLine"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/transactionLine.grpc",
        "x-hellobooks-handler": "getTransactionLineById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:read"
        ],
        "x-hellobooks-scope-domain": "banking"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/transfer": {
      "get": {
        "operationId": "listTransfer",
        "summary": "List transfer records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `transfer` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/transfer.grpc` → `getTransfers`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:read\")`.",
        "tags": [
          "transfer"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Transfer"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `Transfer` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/Transfer"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/transfer.grpc",
        "x-hellobooks-handler": "getTransfers",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:read"
        ],
        "x-hellobooks-scope-domain": "banking"
      },
      "post": {
        "operationId": "createTransfer",
        "summary": "Create transfer record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `transfer` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/transfer.grpc` → `createTransfers`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:write\")`.",
        "tags": [
          "transfer"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Transfer"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Transfer` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Transfer"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/transfer.grpc",
        "x-hellobooks-handler": "createTransfers",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:write"
        ],
        "x-hellobooks-scope-domain": "banking",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Amount": {
                    "type": "number"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FromAccountRef": {
                    "type": "string"
                  },
                  "FromAmount": {
                    "type": "number"
                  },
                  "FromCurrencyRef": {
                    "type": "string"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "ToAccountRef": {
                    "type": "string"
                  },
                  "ToAmount": {
                    "type": "number"
                  },
                  "ToCurrencyRef": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `transfer`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateTransfer",
        "summary": "Update transfer record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `transfer` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/transfer.grpc` → `updateTransfers`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:write\")`.",
        "tags": [
          "transfer"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Transfer"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Transfer` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Transfer"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/transfer.grpc",
        "x-hellobooks-handler": "updateTransfers",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:write"
        ],
        "x-hellobooks-scope-domain": "banking",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Amount": {
                    "type": "number"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FromAccountRef": {
                    "type": "string"
                  },
                  "FromAmount": {
                    "type": "number"
                  },
                  "FromCurrencyRef": {
                    "type": "string"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "ToAccountRef": {
                    "type": "string"
                  },
                  "ToAmount": {
                    "type": "number"
                  },
                  "ToCurrencyRef": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `transfer`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteTransfer",
        "summary": "Delete transfer record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `transfer` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/transfer.grpc` → `deleteTransfers`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:write\")`.",
        "tags": [
          "transfer"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Transfer"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Transfer` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Transfer"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/transfer.grpc",
        "x-hellobooks-handler": "deleteTransfers",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:write"
        ],
        "x-hellobooks-scope-domain": "banking",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Amount": {
                    "type": "number"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FromAccountRef": {
                    "type": "string"
                  },
                  "FromAmount": {
                    "type": "number"
                  },
                  "FromCurrencyRef": {
                    "type": "string"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "ToAccountRef": {
                    "type": "string"
                  },
                  "ToAmount": {
                    "type": "number"
                  },
                  "ToCurrencyRef": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `transfer`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/transfer/restore": {
      "put": {
        "operationId": "restoreTransfer",
        "summary": "Restore archived transfer record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `transfer` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/transfer.grpc` → `restoreTransfers`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:write\")`.",
        "tags": [
          "transfer"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Transfer"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Transfer` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Transfer"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/transfer.grpc",
        "x-hellobooks-handler": "restoreTransfers",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:write"
        ],
        "x-hellobooks-scope-domain": "banking",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Amount": {
                    "type": "number"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FromAccountRef": {
                    "type": "string"
                  },
                  "FromAmount": {
                    "type": "number"
                  },
                  "FromCurrencyRef": {
                    "type": "string"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "ToAccountRef": {
                    "type": "string"
                  },
                  "ToAmount": {
                    "type": "number"
                  },
                  "ToCurrencyRef": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `transfer`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/transfer/{id}": {
      "get": {
        "operationId": "getTransfer",
        "summary": "Fetch one transfer record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `transfer` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/transfer.grpc` → `getTransferById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"banking:read\")`.",
        "tags": [
          "transfer"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "banking:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Transfer"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Transfer` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Transfer"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/transfer.grpc",
        "x-hellobooks-handler": "getTransferById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "banking:read"
        ],
        "x-hellobooks-scope-domain": "banking"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/trialBalance": {
      "get": {
        "operationId": "listTrialBalance",
        "summary": "List trialBalance records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `trialBalance` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/reports/trialBalance.grpc` → `getTrialBalanceReport`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"reports:read\")`.",
        "tags": [
          "trialBalance"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "reports:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "name": "asOfDate",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `trialBalance` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/reports/trialBalance.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fiscalYearStart",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `trialBalance` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/reports/trialBalance.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fiscalYearAnchor",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `trialBalance` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/reports/trialBalance.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "basis",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `trialBalance` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/reports/trialBalance.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeZeroBalances",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `trialBalance` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/reports/trialBalance.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeInactive",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `trialBalance` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/reports/trialBalance.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupBy",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `trialBalance` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/reports/trialBalance.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `trialBalance` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/reports/trialBalance.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `trialBalance` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/reports/trialBalance.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountIds",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `trialBalance` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/reports/trialBalance.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountTypes",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `trialBalance` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/reports/trialBalance.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "classifications",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `trialBalance` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/reports/trialBalance.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locationIds",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `trialBalance` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/reports/trialBalance.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "projectIds",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `trialBalance` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/reports/trialBalance.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "classSlices",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `trialBalance` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/reports/trialBalance.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeComparison",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `trialBalance` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/reports/trialBalance.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "comparisonPeriodStart",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `trialBalance` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/reports/trialBalance.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "comparisonPeriodEnd",
            "in": "query",
            "required": false,
            "description": "Filter declared by the registry row `trialBalance` in routes/publicApi.resources.js and read by `controllers/GRPC/Accounting/reports/trialBalance.grpc`. Forwarded to the internal controller verbatim; the gateway applies no coercion of its own.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/TrialBalance"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `TrialBalance` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/TrialBalance"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/reports/trialBalance.grpc",
        "x-hellobooks-handler": "getTrialBalanceReport",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "reports:read"
        ],
        "x-hellobooks-scope-domain": "reports"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendor": {
      "get": {
        "operationId": "listVendor",
        "summary": "List vendor records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendor` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendor.grpc` → `getVendors`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:read\")`.",
        "tags": [
          "vendor"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Vendor"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `Vendor` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/Vendor"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendor.grpc",
        "x-hellobooks-handler": "getVendors",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:read"
        ],
        "x-hellobooks-scope-domain": "contacts"
      },
      "post": {
        "operationId": "createVendor",
        "summary": "Create vendor record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendor` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendor.grpc` → `createVendors`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "vendor"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Vendor"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Vendor` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Vendor"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendor.grpc",
        "x-hellobooks-handler": "createVendors",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AtcCode": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BirRdoCode": {
                    "type": "string"
                  },
                  "BirTin": {
                    "type": "string"
                  },
                  "CategorizationRule": {
                    "type": "string"
                  },
                  "CisDeductionRate": {
                    "type": "string"
                  },
                  "CisUTR": {
                    "type": "string"
                  },
                  "CisVerificationDate": {
                    "type": "string"
                  },
                  "CodiceDestinatario": {
                    "type": "string"
                  },
                  "CodiceFiscale": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "CompanyName": {
                    "type": "string"
                  },
                  "ContactDetails": {
                    "type": "object"
                  },
                  "CountryOfResidence": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "CustomPaymentDays": {
                    "type": "string"
                  },
                  "DefaultExpenseAccountRef": {
                    "type": "string"
                  },
                  "DefaultPaymentTerm": {
                    "type": "string"
                  },
                  "DefaultTaxRef": {
                    "type": "string"
                  },
                  "DefaultTcsRefId": {
                    "type": "string"
                  },
                  "DefaultTdsRefId": {
                    "type": "string"
                  },
                  "DisplayName": {
                    "type": "string"
                  },
                  "Dnd": {
                    "type": "boolean"
                  },
                  "DndSetAt": {
                    "type": "string"
                  },
                  "DndSource": {
                    "type": "string"
                  },
                  "EfakturEnabled": {
                    "type": "boolean"
                  },
                  "EfakturSertifikatSerial": {
                    "type": "string"
                  },
                  "EwtExemptionCertNumber": {
                    "type": "string"
                  },
                  "EwtExemptionIsRevoked": {
                    "type": "boolean"
                  },
                  "EwtExemptionValidFrom": {
                    "type": "string"
                  },
                  "EwtExemptionValidUntil": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FreistellungsbescheinigungIsRevoked": {
                    "type": "boolean"
                  },
                  "FreistellungsbescheinigungIssuingFinanzamt": {
                    "type": "string"
                  },
                  "FreistellungsbescheinigungNumber": {
                    "type": "string"
                  },
                  "FreistellungsbescheinigungValidFrom": {
                    "type": "string"
                  },
                  "FreistellungsbescheinigungValidUntil": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GensenChoshuSection": {
                    "type": "string"
                  },
                  "GroupRef": {
                    "type": "array"
                  },
                  "GustoCompanyId": {
                    "type": "string"
                  },
                  "GustoContractorId": {
                    "type": "string"
                  },
                  "GustoLinkedAt": {
                    "type": "string"
                  },
                  "HboId": {
                    "type": "string"
                  },
                  "IndustryName": {
                    "type": "string"
                  },
                  "IndustryRefId": {
                    "type": "string"
                  },
                  "Ir330CReceivedDate": {
                    "type": "string"
                  },
                  "IrpfExemptCertNumber": {
                    "type": "string"
                  },
                  "IrpfExemptValidUntil": {
                    "type": "string"
                  },
                  "IrpfSection": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsBauabzugApplicable": {
                    "type": "boolean"
                  },
                  "IsEwtApplicable": {
                    "type": "boolean"
                  },
                  "IsGensenChoshuPayee": {
                    "type": "boolean"
                  },
                  "IsIrpfApplicable": {
                    "type": "boolean"
                  },
                  "IsPphWithholdable": {
                    "type": "boolean"
                  },
                  "IsRctSubcontractor": {
                    "type": "boolean"
                  },
                  "IsRitenutaApplicable": {
                    "type": "boolean"
                  },
                  "IsSchedularExempt": {
                    "type": "boolean"
                  },
                  "IsSchedularWithholdingApplicable": {
                    "type": "boolean"
                  },
                  "IsSubcontractor": {
                    "type": "boolean"
                  },
                  "IsTparReportable": {
                    "type": "boolean"
                  },
                  "IsWhtApplicable": {
                    "type": "boolean"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "PartitaIVA": {
                    "type": "string"
                  },
                  "PaymentNotes": {
                    "type": "string"
                  },
                  "PecAddress": {
                    "type": "string"
                  },
                  "PphArticle": {
                    "type": "string"
                  },
                  "PphSection": {
                    "type": "string"
                  },
                  "PphSkbIsRevoked": {
                    "type": "boolean"
                  },
                  "PphSkbNumber": {
                    "type": "string"
                  },
                  "PphSkbValidFrom": {
                    "type": "string"
                  },
                  "PphSkbValidUntil": {
                    "type": "string"
                  },
                  "PphTreatyRate": {
                    "type": "number"
                  },
                  "PreferredPaymentMethod": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "QualifiedInvoiceIssuerNumber": {
                    "type": "string"
                  },
                  "RctDeductionRate": {
                    "type": "number"
                  },
                  "RegimeFiscale": {
                    "type": "string"
                  },
                  "ResidencyStatus": {
                    "type": "string"
                  },
                  "RetencionIRPFRate": {
                    "type": "number"
                  },
                  "RitenutaBaseBasis": {
                    "type": "string"
                  },
                  "RitenutaCausale": {
                    "type": "string"
                  },
                  "RitenutaExemptionIsRevoked": {
                    "type": "boolean"
                  },
                  "RitenutaExemptionNumber": {
                    "type": "string"
                  },
                  "RitenutaExemptionValidFrom": {
                    "type": "string"
                  },
                  "RitenutaExemptionValidUntil": {
                    "type": "string"
                  },
                  "SchedularActivityCode": {
                    "type": "string"
                  },
                  "SchedularElectedRatePct": {
                    "type": "number"
                  },
                  "SchedularExemptCertNumber": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "TallyDepth": {
                    "type": "integer"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TallyGroupPath": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyLedgerName": {
                    "type": "string"
                  },
                  "TallyParentGroup": {
                    "type": "string"
                  },
                  "TallyPrimaryGroup": {
                    "type": "string"
                  },
                  "TdsNotificationsEnabled": {
                    "type": "boolean"
                  },
                  "VendorChartOfAccount": {
                    "type": "array"
                  },
                  "VendorClass": {
                    "type": "array"
                  },
                  "VendorLocation": {
                    "type": "array"
                  },
                  "VendorProject": {
                    "type": "array"
                  },
                  "VendorType": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "WhtCategory": {
                    "type": "string"
                  },
                  "WhtDtaRate": {
                    "type": "number"
                  },
                  "WhtExemptionIsRevoked": {
                    "type": "boolean"
                  },
                  "WhtExemptionNumber": {
                    "type": "string"
                  },
                  "WhtExemptionValidFrom": {
                    "type": "string"
                  },
                  "WhtExemptionValidUntil": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  },
                  "ZatcaCommercialRegNo": {
                    "type": "string"
                  },
                  "ZatcaTin": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `vendor`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateVendor",
        "summary": "Update vendor record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendor` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendor.grpc` → `updateVendors`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "vendor"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Vendor"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Vendor` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Vendor"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendor.grpc",
        "x-hellobooks-handler": "updateVendors",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AtcCode": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BirRdoCode": {
                    "type": "string"
                  },
                  "BirTin": {
                    "type": "string"
                  },
                  "CategorizationRule": {
                    "type": "string"
                  },
                  "CisDeductionRate": {
                    "type": "string"
                  },
                  "CisUTR": {
                    "type": "string"
                  },
                  "CisVerificationDate": {
                    "type": "string"
                  },
                  "CodiceDestinatario": {
                    "type": "string"
                  },
                  "CodiceFiscale": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "CompanyName": {
                    "type": "string"
                  },
                  "ContactDetails": {
                    "type": "object"
                  },
                  "CountryOfResidence": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "CustomPaymentDays": {
                    "type": "string"
                  },
                  "DefaultExpenseAccountRef": {
                    "type": "string"
                  },
                  "DefaultPaymentTerm": {
                    "type": "string"
                  },
                  "DefaultTaxRef": {
                    "type": "string"
                  },
                  "DefaultTcsRefId": {
                    "type": "string"
                  },
                  "DefaultTdsRefId": {
                    "type": "string"
                  },
                  "DisplayName": {
                    "type": "string"
                  },
                  "Dnd": {
                    "type": "boolean"
                  },
                  "DndSetAt": {
                    "type": "string"
                  },
                  "DndSource": {
                    "type": "string"
                  },
                  "EfakturEnabled": {
                    "type": "boolean"
                  },
                  "EfakturSertifikatSerial": {
                    "type": "string"
                  },
                  "EwtExemptionCertNumber": {
                    "type": "string"
                  },
                  "EwtExemptionIsRevoked": {
                    "type": "boolean"
                  },
                  "EwtExemptionValidFrom": {
                    "type": "string"
                  },
                  "EwtExemptionValidUntil": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FreistellungsbescheinigungIsRevoked": {
                    "type": "boolean"
                  },
                  "FreistellungsbescheinigungIssuingFinanzamt": {
                    "type": "string"
                  },
                  "FreistellungsbescheinigungNumber": {
                    "type": "string"
                  },
                  "FreistellungsbescheinigungValidFrom": {
                    "type": "string"
                  },
                  "FreistellungsbescheinigungValidUntil": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GensenChoshuSection": {
                    "type": "string"
                  },
                  "GroupRef": {
                    "type": "array"
                  },
                  "GustoCompanyId": {
                    "type": "string"
                  },
                  "GustoContractorId": {
                    "type": "string"
                  },
                  "GustoLinkedAt": {
                    "type": "string"
                  },
                  "HboId": {
                    "type": "string"
                  },
                  "IndustryName": {
                    "type": "string"
                  },
                  "IndustryRefId": {
                    "type": "string"
                  },
                  "Ir330CReceivedDate": {
                    "type": "string"
                  },
                  "IrpfExemptCertNumber": {
                    "type": "string"
                  },
                  "IrpfExemptValidUntil": {
                    "type": "string"
                  },
                  "IrpfSection": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsBauabzugApplicable": {
                    "type": "boolean"
                  },
                  "IsEwtApplicable": {
                    "type": "boolean"
                  },
                  "IsGensenChoshuPayee": {
                    "type": "boolean"
                  },
                  "IsIrpfApplicable": {
                    "type": "boolean"
                  },
                  "IsPphWithholdable": {
                    "type": "boolean"
                  },
                  "IsRctSubcontractor": {
                    "type": "boolean"
                  },
                  "IsRitenutaApplicable": {
                    "type": "boolean"
                  },
                  "IsSchedularExempt": {
                    "type": "boolean"
                  },
                  "IsSchedularWithholdingApplicable": {
                    "type": "boolean"
                  },
                  "IsSubcontractor": {
                    "type": "boolean"
                  },
                  "IsTparReportable": {
                    "type": "boolean"
                  },
                  "IsWhtApplicable": {
                    "type": "boolean"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "PartitaIVA": {
                    "type": "string"
                  },
                  "PaymentNotes": {
                    "type": "string"
                  },
                  "PecAddress": {
                    "type": "string"
                  },
                  "PphArticle": {
                    "type": "string"
                  },
                  "PphSection": {
                    "type": "string"
                  },
                  "PphSkbIsRevoked": {
                    "type": "boolean"
                  },
                  "PphSkbNumber": {
                    "type": "string"
                  },
                  "PphSkbValidFrom": {
                    "type": "string"
                  },
                  "PphSkbValidUntil": {
                    "type": "string"
                  },
                  "PphTreatyRate": {
                    "type": "number"
                  },
                  "PreferredPaymentMethod": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "QualifiedInvoiceIssuerNumber": {
                    "type": "string"
                  },
                  "RctDeductionRate": {
                    "type": "number"
                  },
                  "RegimeFiscale": {
                    "type": "string"
                  },
                  "ResidencyStatus": {
                    "type": "string"
                  },
                  "RetencionIRPFRate": {
                    "type": "number"
                  },
                  "RitenutaBaseBasis": {
                    "type": "string"
                  },
                  "RitenutaCausale": {
                    "type": "string"
                  },
                  "RitenutaExemptionIsRevoked": {
                    "type": "boolean"
                  },
                  "RitenutaExemptionNumber": {
                    "type": "string"
                  },
                  "RitenutaExemptionValidFrom": {
                    "type": "string"
                  },
                  "RitenutaExemptionValidUntil": {
                    "type": "string"
                  },
                  "SchedularActivityCode": {
                    "type": "string"
                  },
                  "SchedularElectedRatePct": {
                    "type": "number"
                  },
                  "SchedularExemptCertNumber": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "TallyDepth": {
                    "type": "integer"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TallyGroupPath": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyLedgerName": {
                    "type": "string"
                  },
                  "TallyParentGroup": {
                    "type": "string"
                  },
                  "TallyPrimaryGroup": {
                    "type": "string"
                  },
                  "TdsNotificationsEnabled": {
                    "type": "boolean"
                  },
                  "VendorChartOfAccount": {
                    "type": "array"
                  },
                  "VendorClass": {
                    "type": "array"
                  },
                  "VendorLocation": {
                    "type": "array"
                  },
                  "VendorProject": {
                    "type": "array"
                  },
                  "VendorType": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "WhtCategory": {
                    "type": "string"
                  },
                  "WhtDtaRate": {
                    "type": "number"
                  },
                  "WhtExemptionIsRevoked": {
                    "type": "boolean"
                  },
                  "WhtExemptionNumber": {
                    "type": "string"
                  },
                  "WhtExemptionValidFrom": {
                    "type": "string"
                  },
                  "WhtExemptionValidUntil": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  },
                  "ZatcaCommercialRegNo": {
                    "type": "string"
                  },
                  "ZatcaTin": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `vendor`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteVendor",
        "summary": "Delete vendor record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendor` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendor.grpc` → `deleteVendors`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "vendor"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Vendor"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Vendor` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Vendor"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendor.grpc",
        "x-hellobooks-handler": "deleteVendors",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AtcCode": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BirRdoCode": {
                    "type": "string"
                  },
                  "BirTin": {
                    "type": "string"
                  },
                  "CategorizationRule": {
                    "type": "string"
                  },
                  "CisDeductionRate": {
                    "type": "string"
                  },
                  "CisUTR": {
                    "type": "string"
                  },
                  "CisVerificationDate": {
                    "type": "string"
                  },
                  "CodiceDestinatario": {
                    "type": "string"
                  },
                  "CodiceFiscale": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "CompanyName": {
                    "type": "string"
                  },
                  "ContactDetails": {
                    "type": "object"
                  },
                  "CountryOfResidence": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "CustomPaymentDays": {
                    "type": "string"
                  },
                  "DefaultExpenseAccountRef": {
                    "type": "string"
                  },
                  "DefaultPaymentTerm": {
                    "type": "string"
                  },
                  "DefaultTaxRef": {
                    "type": "string"
                  },
                  "DefaultTcsRefId": {
                    "type": "string"
                  },
                  "DefaultTdsRefId": {
                    "type": "string"
                  },
                  "DisplayName": {
                    "type": "string"
                  },
                  "Dnd": {
                    "type": "boolean"
                  },
                  "DndSetAt": {
                    "type": "string"
                  },
                  "DndSource": {
                    "type": "string"
                  },
                  "EfakturEnabled": {
                    "type": "boolean"
                  },
                  "EfakturSertifikatSerial": {
                    "type": "string"
                  },
                  "EwtExemptionCertNumber": {
                    "type": "string"
                  },
                  "EwtExemptionIsRevoked": {
                    "type": "boolean"
                  },
                  "EwtExemptionValidFrom": {
                    "type": "string"
                  },
                  "EwtExemptionValidUntil": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FreistellungsbescheinigungIsRevoked": {
                    "type": "boolean"
                  },
                  "FreistellungsbescheinigungIssuingFinanzamt": {
                    "type": "string"
                  },
                  "FreistellungsbescheinigungNumber": {
                    "type": "string"
                  },
                  "FreistellungsbescheinigungValidFrom": {
                    "type": "string"
                  },
                  "FreistellungsbescheinigungValidUntil": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GensenChoshuSection": {
                    "type": "string"
                  },
                  "GroupRef": {
                    "type": "array"
                  },
                  "GustoCompanyId": {
                    "type": "string"
                  },
                  "GustoContractorId": {
                    "type": "string"
                  },
                  "GustoLinkedAt": {
                    "type": "string"
                  },
                  "HboId": {
                    "type": "string"
                  },
                  "IndustryName": {
                    "type": "string"
                  },
                  "IndustryRefId": {
                    "type": "string"
                  },
                  "Ir330CReceivedDate": {
                    "type": "string"
                  },
                  "IrpfExemptCertNumber": {
                    "type": "string"
                  },
                  "IrpfExemptValidUntil": {
                    "type": "string"
                  },
                  "IrpfSection": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsBauabzugApplicable": {
                    "type": "boolean"
                  },
                  "IsEwtApplicable": {
                    "type": "boolean"
                  },
                  "IsGensenChoshuPayee": {
                    "type": "boolean"
                  },
                  "IsIrpfApplicable": {
                    "type": "boolean"
                  },
                  "IsPphWithholdable": {
                    "type": "boolean"
                  },
                  "IsRctSubcontractor": {
                    "type": "boolean"
                  },
                  "IsRitenutaApplicable": {
                    "type": "boolean"
                  },
                  "IsSchedularExempt": {
                    "type": "boolean"
                  },
                  "IsSchedularWithholdingApplicable": {
                    "type": "boolean"
                  },
                  "IsSubcontractor": {
                    "type": "boolean"
                  },
                  "IsTparReportable": {
                    "type": "boolean"
                  },
                  "IsWhtApplicable": {
                    "type": "boolean"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "PartitaIVA": {
                    "type": "string"
                  },
                  "PaymentNotes": {
                    "type": "string"
                  },
                  "PecAddress": {
                    "type": "string"
                  },
                  "PphArticle": {
                    "type": "string"
                  },
                  "PphSection": {
                    "type": "string"
                  },
                  "PphSkbIsRevoked": {
                    "type": "boolean"
                  },
                  "PphSkbNumber": {
                    "type": "string"
                  },
                  "PphSkbValidFrom": {
                    "type": "string"
                  },
                  "PphSkbValidUntil": {
                    "type": "string"
                  },
                  "PphTreatyRate": {
                    "type": "number"
                  },
                  "PreferredPaymentMethod": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "QualifiedInvoiceIssuerNumber": {
                    "type": "string"
                  },
                  "RctDeductionRate": {
                    "type": "number"
                  },
                  "RegimeFiscale": {
                    "type": "string"
                  },
                  "ResidencyStatus": {
                    "type": "string"
                  },
                  "RetencionIRPFRate": {
                    "type": "number"
                  },
                  "RitenutaBaseBasis": {
                    "type": "string"
                  },
                  "RitenutaCausale": {
                    "type": "string"
                  },
                  "RitenutaExemptionIsRevoked": {
                    "type": "boolean"
                  },
                  "RitenutaExemptionNumber": {
                    "type": "string"
                  },
                  "RitenutaExemptionValidFrom": {
                    "type": "string"
                  },
                  "RitenutaExemptionValidUntil": {
                    "type": "string"
                  },
                  "SchedularActivityCode": {
                    "type": "string"
                  },
                  "SchedularElectedRatePct": {
                    "type": "number"
                  },
                  "SchedularExemptCertNumber": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "TallyDepth": {
                    "type": "integer"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TallyGroupPath": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyLedgerName": {
                    "type": "string"
                  },
                  "TallyParentGroup": {
                    "type": "string"
                  },
                  "TallyPrimaryGroup": {
                    "type": "string"
                  },
                  "TdsNotificationsEnabled": {
                    "type": "boolean"
                  },
                  "VendorChartOfAccount": {
                    "type": "array"
                  },
                  "VendorClass": {
                    "type": "array"
                  },
                  "VendorLocation": {
                    "type": "array"
                  },
                  "VendorProject": {
                    "type": "array"
                  },
                  "VendorType": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "WhtCategory": {
                    "type": "string"
                  },
                  "WhtDtaRate": {
                    "type": "number"
                  },
                  "WhtExemptionIsRevoked": {
                    "type": "boolean"
                  },
                  "WhtExemptionNumber": {
                    "type": "string"
                  },
                  "WhtExemptionValidFrom": {
                    "type": "string"
                  },
                  "WhtExemptionValidUntil": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  },
                  "ZatcaCommercialRegNo": {
                    "type": "string"
                  },
                  "ZatcaTin": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `vendor`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendor/restore": {
      "put": {
        "operationId": "restoreVendor",
        "summary": "Restore archived vendor record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendor` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendor.grpc` → `restoreVendors`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "vendor"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Vendor"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Vendor` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Vendor"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendor.grpc",
        "x-hellobooks-handler": "restoreVendors",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AtcCode": {
                    "type": "string"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BirRdoCode": {
                    "type": "string"
                  },
                  "BirTin": {
                    "type": "string"
                  },
                  "CategorizationRule": {
                    "type": "string"
                  },
                  "CisDeductionRate": {
                    "type": "string"
                  },
                  "CisUTR": {
                    "type": "string"
                  },
                  "CisVerificationDate": {
                    "type": "string"
                  },
                  "CodiceDestinatario": {
                    "type": "string"
                  },
                  "CodiceFiscale": {
                    "type": "string"
                  },
                  "Comment": {
                    "type": "string"
                  },
                  "CompanyName": {
                    "type": "string"
                  },
                  "ContactDetails": {
                    "type": "object"
                  },
                  "CountryOfResidence": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "CustomFields": {
                    "type": "object"
                  },
                  "CustomPaymentDays": {
                    "type": "string"
                  },
                  "DefaultExpenseAccountRef": {
                    "type": "string"
                  },
                  "DefaultPaymentTerm": {
                    "type": "string"
                  },
                  "DefaultTaxRef": {
                    "type": "string"
                  },
                  "DefaultTcsRefId": {
                    "type": "string"
                  },
                  "DefaultTdsRefId": {
                    "type": "string"
                  },
                  "DisplayName": {
                    "type": "string"
                  },
                  "Dnd": {
                    "type": "boolean"
                  },
                  "DndSetAt": {
                    "type": "string"
                  },
                  "DndSource": {
                    "type": "string"
                  },
                  "EfakturEnabled": {
                    "type": "boolean"
                  },
                  "EfakturSertifikatSerial": {
                    "type": "string"
                  },
                  "EwtExemptionCertNumber": {
                    "type": "string"
                  },
                  "EwtExemptionIsRevoked": {
                    "type": "boolean"
                  },
                  "EwtExemptionValidFrom": {
                    "type": "string"
                  },
                  "EwtExemptionValidUntil": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FreistellungsbescheinigungIsRevoked": {
                    "type": "boolean"
                  },
                  "FreistellungsbescheinigungIssuingFinanzamt": {
                    "type": "string"
                  },
                  "FreistellungsbescheinigungNumber": {
                    "type": "string"
                  },
                  "FreistellungsbescheinigungValidFrom": {
                    "type": "string"
                  },
                  "FreistellungsbescheinigungValidUntil": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GensenChoshuSection": {
                    "type": "string"
                  },
                  "GroupRef": {
                    "type": "array"
                  },
                  "GustoCompanyId": {
                    "type": "string"
                  },
                  "GustoContractorId": {
                    "type": "string"
                  },
                  "GustoLinkedAt": {
                    "type": "string"
                  },
                  "HboId": {
                    "type": "string"
                  },
                  "IndustryName": {
                    "type": "string"
                  },
                  "IndustryRefId": {
                    "type": "string"
                  },
                  "Ir330CReceivedDate": {
                    "type": "string"
                  },
                  "IrpfExemptCertNumber": {
                    "type": "string"
                  },
                  "IrpfExemptValidUntil": {
                    "type": "string"
                  },
                  "IrpfSection": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsBauabzugApplicable": {
                    "type": "boolean"
                  },
                  "IsEwtApplicable": {
                    "type": "boolean"
                  },
                  "IsGensenChoshuPayee": {
                    "type": "boolean"
                  },
                  "IsIrpfApplicable": {
                    "type": "boolean"
                  },
                  "IsPphWithholdable": {
                    "type": "boolean"
                  },
                  "IsRctSubcontractor": {
                    "type": "boolean"
                  },
                  "IsRitenutaApplicable": {
                    "type": "boolean"
                  },
                  "IsSchedularExempt": {
                    "type": "boolean"
                  },
                  "IsSchedularWithholdingApplicable": {
                    "type": "boolean"
                  },
                  "IsSubcontractor": {
                    "type": "boolean"
                  },
                  "IsTparReportable": {
                    "type": "boolean"
                  },
                  "IsWhtApplicable": {
                    "type": "boolean"
                  },
                  "LastEditedSystem": {
                    "type": "string"
                  },
                  "MigrationBatchId": {
                    "type": "string"
                  },
                  "OdooId": {
                    "type": "integer"
                  },
                  "OdooLinkedAt": {
                    "type": "string"
                  },
                  "OdooModel": {
                    "type": "string"
                  },
                  "OdooWriteDate": {
                    "type": "string"
                  },
                  "OriginId": {
                    "type": "string"
                  },
                  "OriginSystem": {
                    "type": "string"
                  },
                  "PartitaIVA": {
                    "type": "string"
                  },
                  "PaymentNotes": {
                    "type": "string"
                  },
                  "PecAddress": {
                    "type": "string"
                  },
                  "PphArticle": {
                    "type": "string"
                  },
                  "PphSection": {
                    "type": "string"
                  },
                  "PphSkbIsRevoked": {
                    "type": "boolean"
                  },
                  "PphSkbNumber": {
                    "type": "string"
                  },
                  "PphSkbValidFrom": {
                    "type": "string"
                  },
                  "PphSkbValidUntil": {
                    "type": "string"
                  },
                  "PphTreatyRate": {
                    "type": "number"
                  },
                  "PreferredPaymentMethod": {
                    "type": "string"
                  },
                  "QboId": {
                    "type": "string"
                  },
                  "QboLinkedAt": {
                    "type": "string"
                  },
                  "QboRealmId": {
                    "type": "string"
                  },
                  "QboSyncToken": {
                    "type": "string"
                  },
                  "QualifiedInvoiceIssuerNumber": {
                    "type": "string"
                  },
                  "RctDeductionRate": {
                    "type": "number"
                  },
                  "RegimeFiscale": {
                    "type": "string"
                  },
                  "ResidencyStatus": {
                    "type": "string"
                  },
                  "RetencionIRPFRate": {
                    "type": "number"
                  },
                  "RitenutaBaseBasis": {
                    "type": "string"
                  },
                  "RitenutaCausale": {
                    "type": "string"
                  },
                  "RitenutaExemptionIsRevoked": {
                    "type": "boolean"
                  },
                  "RitenutaExemptionNumber": {
                    "type": "string"
                  },
                  "RitenutaExemptionValidFrom": {
                    "type": "string"
                  },
                  "RitenutaExemptionValidUntil": {
                    "type": "string"
                  },
                  "SchedularActivityCode": {
                    "type": "string"
                  },
                  "SchedularElectedRatePct": {
                    "type": "number"
                  },
                  "SchedularExemptCertNumber": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SyncVersion": {
                    "type": "integer"
                  },
                  "TallyDepth": {
                    "type": "integer"
                  },
                  "TallyExtras": {
                    "type": "object"
                  },
                  "TallyGroupPath": {
                    "type": "string"
                  },
                  "TallyGuid": {
                    "type": "string"
                  },
                  "TallyLedgerName": {
                    "type": "string"
                  },
                  "TallyParentGroup": {
                    "type": "string"
                  },
                  "TallyPrimaryGroup": {
                    "type": "string"
                  },
                  "TdsNotificationsEnabled": {
                    "type": "boolean"
                  },
                  "VendorChartOfAccount": {
                    "type": "array"
                  },
                  "VendorClass": {
                    "type": "array"
                  },
                  "VendorLocation": {
                    "type": "array"
                  },
                  "VendorProject": {
                    "type": "array"
                  },
                  "VendorType": {
                    "type": "string"
                  },
                  "WaveBusinessId": {
                    "type": "string"
                  },
                  "WaveId": {
                    "type": "string"
                  },
                  "WaveLinkedAt": {
                    "type": "string"
                  },
                  "WhtCategory": {
                    "type": "string"
                  },
                  "WhtDtaRate": {
                    "type": "number"
                  },
                  "WhtExemptionIsRevoked": {
                    "type": "boolean"
                  },
                  "WhtExemptionNumber": {
                    "type": "string"
                  },
                  "WhtExemptionValidFrom": {
                    "type": "string"
                  },
                  "WhtExemptionValidUntil": {
                    "type": "string"
                  },
                  "XeroId": {
                    "type": "string"
                  },
                  "XeroLinkedAt": {
                    "type": "string"
                  },
                  "XeroTenantId": {
                    "type": "string"
                  },
                  "XeroUpdatedDateUTC": {
                    "type": "string"
                  },
                  "ZatcaCommercialRegNo": {
                    "type": "string"
                  },
                  "ZatcaTin": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `vendor`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendor/{id}": {
      "get": {
        "operationId": "getVendor",
        "summary": "Fetch one vendor record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendor` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendor.grpc` → `getVendorById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:read\")`.",
        "tags": [
          "vendor"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/Vendor"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `Vendor` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/Vendor"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendor.grpc",
        "x-hellobooks-handler": "getVendorById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:read"
        ],
        "x-hellobooks-scope-domain": "contacts"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendorAddress": {
      "post": {
        "operationId": "createVendorAddress",
        "summary": "Create vendorAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorAddress.grpc` → `createVendorAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "vendorAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorAddress.grpc",
        "x-hellobooks-handler": "createVendorAddresses",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AddressType": {
                    "type": "string"
                  },
                  "City": {
                    "type": "string"
                  },
                  "Country": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LineOne": {
                    "type": "string"
                  },
                  "LineTwo": {
                    "type": "string"
                  },
                  "Province": {
                    "type": "string"
                  },
                  "VendorId": {
                    "type": "string"
                  },
                  "ZipCode": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `vendorAddress`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateVendorAddress",
        "summary": "Update vendorAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorAddress.grpc` → `updateVendorAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "vendorAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorAddress.grpc",
        "x-hellobooks-handler": "updateVendorAddresses",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AddressType": {
                    "type": "string"
                  },
                  "City": {
                    "type": "string"
                  },
                  "Country": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LineOne": {
                    "type": "string"
                  },
                  "LineTwo": {
                    "type": "string"
                  },
                  "Province": {
                    "type": "string"
                  },
                  "VendorId": {
                    "type": "string"
                  },
                  "ZipCode": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `vendorAddress`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteVendorAddress",
        "summary": "Delete vendorAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorAddress.grpc` → `deleteVendorAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "vendorAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorAddress.grpc",
        "x-hellobooks-handler": "deleteVendorAddresses",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AddressType": {
                    "type": "string"
                  },
                  "City": {
                    "type": "string"
                  },
                  "Country": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LineOne": {
                    "type": "string"
                  },
                  "LineTwo": {
                    "type": "string"
                  },
                  "Province": {
                    "type": "string"
                  },
                  "VendorId": {
                    "type": "string"
                  },
                  "ZipCode": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `vendorAddress`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendorAddress/restore": {
      "put": {
        "operationId": "restoreVendorAddress",
        "summary": "Restore archived vendorAddress record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorAddress.grpc` → `restoreVendorAddresses`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "vendorAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorAddress.grpc",
        "x-hellobooks-handler": "restoreVendorAddresses",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AddressType": {
                    "type": "string"
                  },
                  "City": {
                    "type": "string"
                  },
                  "Country": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "LineOne": {
                    "type": "string"
                  },
                  "LineTwo": {
                    "type": "string"
                  },
                  "Province": {
                    "type": "string"
                  },
                  "VendorId": {
                    "type": "string"
                  },
                  "ZipCode": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `vendorAddress`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendorAddress/{id}": {
      "get": {
        "operationId": "getVendorAddress",
        "summary": "Fetch one vendorAddress record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorAddress` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorAddress.grpc` → `getVendorAddressById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:read\")`.",
        "tags": [
          "vendorAddress"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorAddress"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorAddress` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorAddress"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorAddress.grpc",
        "x-hellobooks-handler": "getVendorAddressById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:read"
        ],
        "x-hellobooks-scope-domain": "contacts"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendorBalance": {
      "post": {
        "operationId": "createVendorBalance",
        "summary": "Create vendorBalance record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorBalance` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorBalance.grpc` → `createVendorBalances`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "vendorBalance"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorBalance"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorBalance` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorBalance"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorBalance.grpc",
        "x-hellobooks-handler": "createVendorBalances",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Amount": {
                    "type": "number"
                  },
                  "AsOfDate": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "Type": {
                    "type": "string"
                  },
                  "VendorId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `vendorBalance`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateVendorBalance",
        "summary": "Update vendorBalance record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorBalance` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorBalance.grpc` → `updateVendorBalances`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "vendorBalance"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorBalance"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorBalance` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorBalance"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorBalance.grpc",
        "x-hellobooks-handler": "updateVendorBalances",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Amount": {
                    "type": "number"
                  },
                  "AsOfDate": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "Type": {
                    "type": "string"
                  },
                  "VendorId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `vendorBalance`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteVendorBalance",
        "summary": "Delete vendorBalance record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorBalance` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorBalance.grpc` → `deleteVendorBalances`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "vendorBalance"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorBalance"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorBalance` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorBalance"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorBalance.grpc",
        "x-hellobooks-handler": "deleteVendorBalances",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Amount": {
                    "type": "number"
                  },
                  "AsOfDate": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "FunctionalAmount": {
                    "type": "number"
                  },
                  "Type": {
                    "type": "string"
                  },
                  "VendorId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `vendorBalance`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendorBalance/{id}": {
      "get": {
        "operationId": "getVendorBalance",
        "summary": "Fetch one vendorBalance record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorBalance` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorBalance.grpc` → `getVendorBalanceById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:read\")`.",
        "tags": [
          "vendorBalance"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorBalance"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorBalance` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorBalance"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorBalance.grpc",
        "x-hellobooks-handler": "getVendorBalanceById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:read"
        ],
        "x-hellobooks-scope-domain": "contacts"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendorContactPersons": {
      "post": {
        "operationId": "createVendorContactPersons",
        "summary": "Create vendorContactPersons record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorContactPersons` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorContactPerson.grpc` → `createVendorContactPersons`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "vendorContactPersons"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorContactPersons"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorContactPersons` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorContactPersons"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorContactPerson.grpc",
        "x-hellobooks-handler": "createVendorContactPersons",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `create` on `vendorContactPersons`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"ContactPersons\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "ContactPersons"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateVendorContactPersons",
        "summary": "Update vendorContactPersons record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorContactPersons` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorContactPerson.grpc` → `updateVendorContactPersons`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "vendorContactPersons"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorContactPersons"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorContactPersons` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorContactPersons"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorContactPerson.grpc",
        "x-hellobooks-handler": "updateVendorContactPersons",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `update` on `vendorContactPersons`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"ContactPersons\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "ContactPersons"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteVendorContactPersons",
        "summary": "Delete vendorContactPersons record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorContactPersons` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorContactPerson.grpc` → `deleteVendorContactPersons`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "vendorContactPersons"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorContactPersons"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorContactPersons` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorContactPersons"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorContactPerson.grpc",
        "x-hellobooks-handler": "deleteVendorContactPersons",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `del` on `vendorContactPersons`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"ContactPersons\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "ContactPersons"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendorContactPersons/{id}": {
      "get": {
        "operationId": "getVendorContactPersons",
        "summary": "Fetch one vendorContactPersons record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorContactPersons` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorContactPerson.grpc` → `getVendorContactPersonById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:read\")`.",
        "tags": [
          "vendorContactPersons"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorContactPersons"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorContactPersons` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorContactPersons"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorContactPerson.grpc",
        "x-hellobooks-handler": "getVendorContactPersonById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:read"
        ],
        "x-hellobooks-scope-domain": "contacts"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendorCreditCard": {
      "post": {
        "operationId": "createVendorCreditCard",
        "summary": "Create vendorCreditCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorCreditCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorCreditCard.grpc` → `createVendorCreditCards`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "vendorCreditCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorCreditCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorCreditCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorCreditCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorCreditCard.grpc",
        "x-hellobooks-handler": "createVendorCreditCards",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `create` on `vendorCreditCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"CreditCards\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "CreditCards"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateVendorCreditCard",
        "summary": "Update vendorCreditCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorCreditCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorCreditCard.grpc` → `updateVendorCreditCards`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "vendorCreditCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorCreditCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorCreditCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorCreditCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorCreditCard.grpc",
        "x-hellobooks-handler": "updateVendorCreditCards",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `update` on `vendorCreditCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"CreditCards\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "CreditCards"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteVendorCreditCard",
        "summary": "Delete vendorCreditCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorCreditCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorCreditCard.grpc` → `deleteVendorCreditCards`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "vendorCreditCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorCreditCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorCreditCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorCreditCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorCreditCard.grpc",
        "x-hellobooks-handler": "deleteVendorCreditCards",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `del` on `vendorCreditCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"CreditCards\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "CreditCards"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendorCreditCard/{id}": {
      "get": {
        "operationId": "getVendorCreditCard",
        "summary": "Fetch one vendorCreditCard record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorCreditCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorCreditCard.grpc` → `getVendorCreditCardById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:read\")`.",
        "tags": [
          "vendorCreditCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorCreditCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorCreditCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorCreditCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorCreditCard.grpc",
        "x-hellobooks-handler": "getVendorCreditCardById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:read"
        ],
        "x-hellobooks-scope-domain": "paymentmethods"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendorDebitCard": {
      "post": {
        "operationId": "createVendorDebitCard",
        "summary": "Create vendorDebitCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorDebitCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorDebitCard.grpc` → `createVendorDebitCards`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "vendorDebitCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorDebitCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorDebitCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorDebitCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorDebitCard.grpc",
        "x-hellobooks-handler": "createVendorDebitCards",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `create` on `vendorDebitCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"DebitCards\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "DebitCards"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateVendorDebitCard",
        "summary": "Update vendorDebitCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorDebitCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorDebitCard.grpc` → `updateVendorDebitCards`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "vendorDebitCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorDebitCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorDebitCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorDebitCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorDebitCard.grpc",
        "x-hellobooks-handler": "updateVendorDebitCards",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `update` on `vendorDebitCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"DebitCards\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "DebitCards"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteVendorDebitCard",
        "summary": "Delete vendorDebitCard record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorDebitCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorDebitCard.grpc` → `deleteVendorDebitCards`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:write\")`.",
        "tags": [
          "vendorDebitCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorDebitCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorDebitCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorDebitCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorDebitCard.grpc",
        "x-hellobooks-handler": "deleteVendorDebitCards",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:write"
        ],
        "x-hellobooks-scope-domain": "paymentmethods",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request body for `del` on `vendorDebitCard`. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it. The ENVELOPE, however, is known: send `{ \"DebitCards\": [ … ] }` — an array of records under that key, even when writing one. A bare record or a bare array is also accepted and wrapped for you. `OrgRefId` and `EntityRefId` are filled in from the path.",
                "x-hellobooks-field-contract": "unpublished",
                "x-hellobooks-write-key": "DebitCards"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendorDebitCard/{id}": {
      "get": {
        "operationId": "getVendorDebitCard",
        "summary": "Fetch one vendorDebitCard record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorDebitCard` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorDebitCard.grpc` → `getVendorDebitCardById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"paymentmethods:read\")`.",
        "tags": [
          "vendorDebitCard"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "paymentmethods:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorDebitCard"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorDebitCard` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorDebitCard"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorDebitCard.grpc",
        "x-hellobooks-handler": "getVendorDebitCardById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "paymentmethods:read"
        ],
        "x-hellobooks-scope-domain": "paymentmethods"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendorGroup": {
      "get": {
        "operationId": "listVendorGroup",
        "summary": "List vendorGroup records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorGroup` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorGroup.grpc` → `getVendorGroups`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:read\")`.",
        "tags": [
          "vendorGroup"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/VendorGroup"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `VendorGroup` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/VendorGroup"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorGroup.grpc",
        "x-hellobooks-handler": "getVendorGroups",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:read"
        ],
        "x-hellobooks-scope-domain": "contacts"
      },
      "post": {
        "operationId": "createVendorGroup",
        "summary": "Create vendorGroup record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorGroup` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorGroup.grpc` → `createVendorGroups`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "vendorGroup"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorGroup"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorGroup` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorGroup"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorGroup.grpc",
        "x-hellobooks-handler": "createVendorGroups",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Name": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `vendorGroup`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateVendorGroup",
        "summary": "Update vendorGroup record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorGroup` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorGroup.grpc` → `updateVendorGroups`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "vendorGroup"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorGroup"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorGroup` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorGroup"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorGroup.grpc",
        "x-hellobooks-handler": "updateVendorGroups",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Name": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `vendorGroup`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteVendorGroup",
        "summary": "Delete vendorGroup record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorGroup` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorGroup.grpc` → `deleteVendorGroups`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "vendorGroup"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorGroup"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorGroup` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorGroup"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorGroup.grpc",
        "x-hellobooks-handler": "deleteVendorGroups",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Name": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `vendorGroup`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendorGroup/restore": {
      "put": {
        "operationId": "restoreVendorGroup",
        "summary": "Restore archived vendorGroup record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorGroup` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorGroup.grpc` → `restoreVendorGroups`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:write\")`.",
        "tags": [
          "vendorGroup"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorGroup"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorGroup` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorGroup"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorGroup.grpc",
        "x-hellobooks-handler": "restoreVendorGroups",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:write"
        ],
        "x-hellobooks-scope-domain": "contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "Name": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `vendorGroup`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendorGroup/{id}": {
      "get": {
        "operationId": "getVendorGroup",
        "summary": "Fetch one vendorGroup record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorGroup` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorGroup.grpc` → `getVendorGroupById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"contacts:read\")`.",
        "tags": [
          "vendorGroup"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "contacts:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorGroup"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorGroup` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorGroup"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorGroup.grpc",
        "x-hellobooks-handler": "getVendorGroupById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "contacts:read"
        ],
        "x-hellobooks-scope-domain": "contacts"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendorPrepayment": {
      "get": {
        "operationId": "listVendorPrepayment",
        "summary": "List vendorPrepayment records",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorPrepayment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorPrepayment.grpc` → `getVendorPrepayments`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "vendorPrepayment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/isArchived"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the collection.",
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/VendorPrepayment"
                          }
                        }
                      }
                    }
                  ],
                  "description": "The payload is a collection of `VendorPrepayment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "collection",
                    "record": "#/components/schemas/VendorPrepayment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorPrepayment.grpc",
        "x-hellobooks-handler": "getVendorPrepayments",
        "x-hellobooks-registry-verb": "list",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      },
      "post": {
        "operationId": "createVendorPrepayment",
        "summary": "Create vendorPrepayment record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorPrepayment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorPrepayment.grpc` → `createVendorPrepayment`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "vendorPrepayment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorPrepayment"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorPrepayment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorPrepayment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorPrepayment.grpc",
        "x-hellobooks-handler": "createVendorPrepayment",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AppliedAmount": {
                    "type": "number"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BankAccountRefId": {
                    "type": "string"
                  },
                  "ChequeDate": {
                    "type": "string"
                  },
                  "ChequeNumber": {
                    "type": "string"
                  },
                  "ClassComponentRef": {
                    "type": "string"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FunctionalTotalAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "IsTaxInclusive": {
                    "type": "boolean"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "Memo": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PaymentRefId": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "PrepaymentAccountRefId": {
                    "type": "string"
                  },
                  "PrepaymentNumber": {
                    "type": "string"
                  },
                  "PrevYearCarryFwd": {
                    "type": "number"
                  },
                  "PurchaseOrderRefId": {
                    "type": "string"
                  },
                  "RecurringBillTemplateRefId": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "ScheduleType": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "TdsAmount": {
                    "type": "number"
                  },
                  "TdsBaseAmount": {
                    "type": "number"
                  },
                  "TdsRate": {
                    "type": "number"
                  },
                  "TdsRefId": {
                    "type": "string"
                  },
                  "TotalAmount": {
                    "type": "number"
                  },
                  "TransactionRefId": {
                    "type": "string"
                  },
                  "UnappliedAmount": {
                    "type": "number"
                  },
                  "VendorRefId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `vendorPrepayment`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateVendorPrepayment",
        "summary": "Update vendorPrepayment record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorPrepayment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorPrepayment.grpc` → `updateVendorPrepayment`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "vendorPrepayment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorPrepayment"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorPrepayment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorPrepayment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorPrepayment.grpc",
        "x-hellobooks-handler": "updateVendorPrepayment",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AppliedAmount": {
                    "type": "number"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BankAccountRefId": {
                    "type": "string"
                  },
                  "ChequeDate": {
                    "type": "string"
                  },
                  "ChequeNumber": {
                    "type": "string"
                  },
                  "ClassComponentRef": {
                    "type": "string"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FunctionalTotalAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "IsTaxInclusive": {
                    "type": "boolean"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "Memo": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PaymentRefId": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "PrepaymentAccountRefId": {
                    "type": "string"
                  },
                  "PrepaymentNumber": {
                    "type": "string"
                  },
                  "PrevYearCarryFwd": {
                    "type": "number"
                  },
                  "PurchaseOrderRefId": {
                    "type": "string"
                  },
                  "RecurringBillTemplateRefId": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "ScheduleType": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "TdsAmount": {
                    "type": "number"
                  },
                  "TdsBaseAmount": {
                    "type": "number"
                  },
                  "TdsRate": {
                    "type": "number"
                  },
                  "TdsRefId": {
                    "type": "string"
                  },
                  "TotalAmount": {
                    "type": "number"
                  },
                  "TransactionRefId": {
                    "type": "string"
                  },
                  "UnappliedAmount": {
                    "type": "number"
                  },
                  "VendorRefId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `vendorPrepayment`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteVendorPrepayment",
        "summary": "Delete vendorPrepayment record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorPrepayment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorPrepayment.grpc` → `deleteVendorPrepayment`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "vendorPrepayment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorPrepayment"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorPrepayment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorPrepayment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorPrepayment.grpc",
        "x-hellobooks-handler": "deleteVendorPrepayment",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AppliedAmount": {
                    "type": "number"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BankAccountRefId": {
                    "type": "string"
                  },
                  "ChequeDate": {
                    "type": "string"
                  },
                  "ChequeNumber": {
                    "type": "string"
                  },
                  "ClassComponentRef": {
                    "type": "string"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FunctionalTotalAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "IsTaxInclusive": {
                    "type": "boolean"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "Memo": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PaymentRefId": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "PrepaymentAccountRefId": {
                    "type": "string"
                  },
                  "PrepaymentNumber": {
                    "type": "string"
                  },
                  "PrevYearCarryFwd": {
                    "type": "number"
                  },
                  "PurchaseOrderRefId": {
                    "type": "string"
                  },
                  "RecurringBillTemplateRefId": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "ScheduleType": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "TdsAmount": {
                    "type": "number"
                  },
                  "TdsBaseAmount": {
                    "type": "number"
                  },
                  "TdsRate": {
                    "type": "number"
                  },
                  "TdsRefId": {
                    "type": "string"
                  },
                  "TotalAmount": {
                    "type": "number"
                  },
                  "TransactionRefId": {
                    "type": "string"
                  },
                  "UnappliedAmount": {
                    "type": "number"
                  },
                  "VendorRefId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `vendorPrepayment`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendorPrepayment/restore": {
      "put": {
        "operationId": "restoreVendorPrepayment",
        "summary": "Restore archived vendorPrepayment record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorPrepayment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorPrepayment.grpc` → `restoreVendorPrepayment`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "vendorPrepayment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorPrepayment"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorPrepayment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorPrepayment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorPrepayment.grpc",
        "x-hellobooks-handler": "restoreVendorPrepayment",
        "x-hellobooks-registry-verb": "restore",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AppliedAmount": {
                    "type": "number"
                  },
                  "Attachments": {
                    "type": "object"
                  },
                  "BankAccountRefId": {
                    "type": "string"
                  },
                  "ChequeDate": {
                    "type": "string"
                  },
                  "ChequeNumber": {
                    "type": "string"
                  },
                  "ClassComponentRef": {
                    "type": "string"
                  },
                  "ClassRef": {
                    "type": "string"
                  },
                  "CurrencyRef": {
                    "type": "string"
                  },
                  "ExchangeRate": {
                    "type": "number"
                  },
                  "FunctionalTotalAmount": {
                    "type": "number"
                  },
                  "FxRateDate": {
                    "type": "string"
                  },
                  "FxSource": {
                    "type": "string"
                  },
                  "GSTCategory": {
                    "type": "string"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "IsArchived": {
                    "type": "boolean"
                  },
                  "IsPartyGSTRegistered": {
                    "type": "boolean"
                  },
                  "IsReverseCharge": {
                    "type": "boolean"
                  },
                  "IsTaxInclusive": {
                    "type": "boolean"
                  },
                  "LocationRef": {
                    "type": "string"
                  },
                  "Memo": {
                    "type": "string"
                  },
                  "Notes": {
                    "type": "string"
                  },
                  "PartyGSTIN": {
                    "type": "string"
                  },
                  "PartyStateCode": {
                    "type": "string"
                  },
                  "PaymentRefId": {
                    "type": "string"
                  },
                  "PlaceOfSupply": {
                    "type": "string"
                  },
                  "PrepaymentAccountRefId": {
                    "type": "string"
                  },
                  "PrepaymentNumber": {
                    "type": "string"
                  },
                  "PrevYearCarryFwd": {
                    "type": "number"
                  },
                  "PurchaseOrderRefId": {
                    "type": "string"
                  },
                  "RecurringBillTemplateRefId": {
                    "type": "string"
                  },
                  "Reference": {
                    "type": "string"
                  },
                  "ScheduleType": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "SupplyType": {
                    "type": "string"
                  },
                  "TaxAmount": {
                    "type": "number"
                  },
                  "TaxRefId": {
                    "type": "string"
                  },
                  "TaxType": {
                    "type": "string"
                  },
                  "TaxableAmount": {
                    "type": "number"
                  },
                  "TdsAmount": {
                    "type": "number"
                  },
                  "TdsBaseAmount": {
                    "type": "number"
                  },
                  "TdsRate": {
                    "type": "number"
                  },
                  "TdsRefId": {
                    "type": "string"
                  },
                  "TotalAmount": {
                    "type": "number"
                  },
                  "TransactionRefId": {
                    "type": "string"
                  },
                  "UnappliedAmount": {
                    "type": "number"
                  },
                  "VendorRefId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `vendorPrepayment`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendorPrepayment/{id}": {
      "get": {
        "operationId": "getVendorPrepayment",
        "summary": "Fetch one vendorPrepayment record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorPrepayment` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorPrepayment.grpc` → `getVendorPrepaymentById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "vendorPrepayment"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorPrepayment"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorPrepayment` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorPrepayment"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorPrepayment.grpc",
        "x-hellobooks-handler": "getVendorPrepaymentById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendorPrepaymentApplication/{id}": {
      "get": {
        "operationId": "getVendorPrepaymentApplication",
        "summary": "Fetch one vendorPrepaymentApplication record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorPrepaymentApplication` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorPrepaymentApplication.grpc` → `getVendorPrepaymentApplicationById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "vendorPrepaymentApplication"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorPrepaymentApplication"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorPrepaymentApplication` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorPrepaymentApplication"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorPrepaymentApplication.grpc",
        "x-hellobooks-handler": "getVendorPrepaymentApplicationById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendorPrepaymentRecurringLink": {
      "post": {
        "operationId": "createVendorPrepaymentRecurringLink",
        "summary": "Create vendorPrepaymentRecurringLink record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorPrepaymentRecurringLink` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorPrepaymentRecurringLink.grpc` → `createVendorPrepaymentRecurringLink`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "vendorPrepaymentRecurringLink"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorPrepaymentRecurringLink"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorPrepaymentRecurringLink` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorPrepaymentRecurringLink"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorPrepaymentRecurringLink.grpc",
        "x-hellobooks-handler": "createVendorPrepaymentRecurringLink",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AutoApplyPolicy": {
                    "type": "integer"
                  },
                  "CarryForward": {
                    "type": "integer"
                  },
                  "EffectiveFrom": {
                    "type": "string"
                  },
                  "EffectiveTo": {
                    "type": "string"
                  },
                  "FixedAmountPerCycle": {
                    "type": "number"
                  },
                  "MaxPerCycleCap": {
                    "type": "number"
                  },
                  "MinPerCycleFloor": {
                    "type": "number"
                  },
                  "PercentOfBill": {
                    "type": "number"
                  },
                  "PrepaymentId": {
                    "type": "string"
                  },
                  "Priority": {
                    "type": "integer"
                  },
                  "RecurringBillTemplateRefId": {
                    "type": "string"
                  },
                  "Rounding": {
                    "type": "integer"
                  },
                  "StopWhenFullyAdjusted": {
                    "type": "boolean"
                  }
                },
                "description": "Writable fields for `vendorPrepaymentRecurringLink`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateVendorPrepaymentRecurringLink",
        "summary": "Update vendorPrepaymentRecurringLink record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorPrepaymentRecurringLink` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorPrepaymentRecurringLink.grpc` → `updateVendorPrepaymentRecurringLink`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "vendorPrepaymentRecurringLink"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorPrepaymentRecurringLink"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorPrepaymentRecurringLink` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorPrepaymentRecurringLink"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorPrepaymentRecurringLink.grpc",
        "x-hellobooks-handler": "updateVendorPrepaymentRecurringLink",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AutoApplyPolicy": {
                    "type": "integer"
                  },
                  "CarryForward": {
                    "type": "integer"
                  },
                  "EffectiveFrom": {
                    "type": "string"
                  },
                  "EffectiveTo": {
                    "type": "string"
                  },
                  "FixedAmountPerCycle": {
                    "type": "number"
                  },
                  "MaxPerCycleCap": {
                    "type": "number"
                  },
                  "MinPerCycleFloor": {
                    "type": "number"
                  },
                  "PercentOfBill": {
                    "type": "number"
                  },
                  "PrepaymentId": {
                    "type": "string"
                  },
                  "Priority": {
                    "type": "integer"
                  },
                  "RecurringBillTemplateRefId": {
                    "type": "string"
                  },
                  "Rounding": {
                    "type": "integer"
                  },
                  "StopWhenFullyAdjusted": {
                    "type": "boolean"
                  }
                },
                "description": "Writable fields for `vendorPrepaymentRecurringLink`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteVendorPrepaymentRecurringLink",
        "summary": "Delete vendorPrepaymentRecurringLink record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorPrepaymentRecurringLink` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorPrepaymentRecurringLink.grpc` → `deleteVendorPrepaymentRecurringLink`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "vendorPrepaymentRecurringLink"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorPrepaymentRecurringLink"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorPrepaymentRecurringLink` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorPrepaymentRecurringLink"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorPrepaymentRecurringLink.grpc",
        "x-hellobooks-handler": "deleteVendorPrepaymentRecurringLink",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AutoApplyPolicy": {
                    "type": "integer"
                  },
                  "CarryForward": {
                    "type": "integer"
                  },
                  "EffectiveFrom": {
                    "type": "string"
                  },
                  "EffectiveTo": {
                    "type": "string"
                  },
                  "FixedAmountPerCycle": {
                    "type": "number"
                  },
                  "MaxPerCycleCap": {
                    "type": "number"
                  },
                  "MinPerCycleFloor": {
                    "type": "number"
                  },
                  "PercentOfBill": {
                    "type": "number"
                  },
                  "PrepaymentId": {
                    "type": "string"
                  },
                  "Priority": {
                    "type": "integer"
                  },
                  "RecurringBillTemplateRefId": {
                    "type": "string"
                  },
                  "Rounding": {
                    "type": "integer"
                  },
                  "StopWhenFullyAdjusted": {
                    "type": "boolean"
                  }
                },
                "description": "Writable fields for `vendorPrepaymentRecurringLink`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendorPrepaymentRecurringLink/{id}": {
      "get": {
        "operationId": "getVendorPrepaymentRecurringLink",
        "summary": "Fetch one vendorPrepaymentRecurringLink record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorPrepaymentRecurringLink` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorPrepaymentRecurringLink.grpc` → `getVendorPrepaymentRecurringLinkById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "vendorPrepaymentRecurringLink"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorPrepaymentRecurringLink"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorPrepaymentRecurringLink` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorPrepaymentRecurringLink"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorPrepaymentRecurringLink.grpc",
        "x-hellobooks-handler": "getVendorPrepaymentRecurringLinkById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendorPrepaymentRefund": {
      "post": {
        "operationId": "createVendorPrepaymentRefund",
        "summary": "Create vendorPrepaymentRefund record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorPrepaymentRefund` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorPrepaymentRefund.grpc` → `createVendorPrepaymentRefund`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "vendorPrepaymentRefund"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorPrepaymentRefund"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorPrepaymentRefund` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorPrepaymentRefund"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorPrepaymentRefund.grpc",
        "x-hellobooks-handler": "createVendorPrepaymentRefund",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "Amount": {
                    "type": "number"
                  },
                  "IdempotencyKey": {
                    "type": "string"
                  },
                  "JournalId": {
                    "type": "string"
                  },
                  "PaymentRefId": {
                    "type": "string"
                  },
                  "PrepaymentId": {
                    "type": "string"
                  },
                  "Reason": {
                    "type": "string"
                  },
                  "Status": {
                    "type": "string"
                  },
                  "TransactionRefId": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `vendorPrepaymentRefund`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendorPrepaymentRefund/{id}": {
      "get": {
        "operationId": "getVendorPrepaymentRefund",
        "summary": "Fetch one vendorPrepaymentRefund record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorPrepaymentRefund` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorPrepaymentRefund.grpc` → `getVendorPrepaymentRefundById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "vendorPrepaymentRefund"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorPrepaymentRefund"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorPrepaymentRefund` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorPrepaymentRefund"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorPrepaymentRefund.grpc",
        "x-hellobooks-handler": "getVendorPrepaymentRefundById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendorPrepaymentSchedule": {
      "post": {
        "operationId": "createVendorPrepaymentSchedule",
        "summary": "Create vendorPrepaymentSchedule record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorPrepaymentSchedule` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorPrepaymentSchedule.grpc` → `createVendorPrepaymentSchedule`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "vendorPrepaymentSchedule"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorPrepaymentSchedule"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorPrepaymentSchedule` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorPrepaymentSchedule"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorPrepaymentSchedule.grpc",
        "x-hellobooks-handler": "createVendorPrepaymentSchedule",
        "x-hellobooks-registry-verb": "create",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AppliedAmount": {
                    "type": "number"
                  },
                  "BillRefId": {
                    "type": "string"
                  },
                  "IsAdjusted": {
                    "type": "boolean"
                  },
                  "PaymentRefId": {
                    "type": "string"
                  },
                  "PeriodStart": {
                    "type": "string"
                  },
                  "PrepaymentId": {
                    "type": "string"
                  },
                  "ScheduledAmount": {
                    "type": "number"
                  },
                  "Status": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `vendorPrepaymentSchedule`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateVendorPrepaymentSchedule",
        "summary": "Update vendorPrepaymentSchedule record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorPrepaymentSchedule` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorPrepaymentSchedule.grpc` → `updateVendorPrepaymentSchedule`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "vendorPrepaymentSchedule"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorPrepaymentSchedule"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorPrepaymentSchedule` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorPrepaymentSchedule"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorPrepaymentSchedule.grpc",
        "x-hellobooks-handler": "updateVendorPrepaymentSchedule",
        "x-hellobooks-registry-verb": "update",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AppliedAmount": {
                    "type": "number"
                  },
                  "BillRefId": {
                    "type": "string"
                  },
                  "IsAdjusted": {
                    "type": "boolean"
                  },
                  "PaymentRefId": {
                    "type": "string"
                  },
                  "PeriodStart": {
                    "type": "string"
                  },
                  "PrepaymentId": {
                    "type": "string"
                  },
                  "ScheduledAmount": {
                    "type": "number"
                  },
                  "Status": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `vendorPrepaymentSchedule`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteVendorPrepaymentSchedule",
        "summary": "Delete vendorPrepaymentSchedule record(s)",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorPrepaymentSchedule` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorPrepaymentSchedule.grpc` → `deleteVendorPrepaymentSchedule`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:write\")`.",
        "tags": [
          "vendorPrepaymentSchedule"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorPrepaymentSchedule"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorPrepaymentSchedule` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorPrepaymentSchedule"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorPrepaymentSchedule.grpc",
        "x-hellobooks-handler": "deleteVendorPrepaymentSchedule",
        "x-hellobooks-registry-verb": "del",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:write"
        ],
        "x-hellobooks-scope-domain": "purchases",
        "requestBody": {
          "required": true,
          "description": "This DELETE carries a request body — the registry's delete handlers are body-based, not id-in-path. That is unusual and is described because it is what the route actually does.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "AppliedAmount": {
                    "type": "number"
                  },
                  "BillRefId": {
                    "type": "string"
                  },
                  "IsAdjusted": {
                    "type": "boolean"
                  },
                  "PaymentRefId": {
                    "type": "string"
                  },
                  "PeriodStart": {
                    "type": "string"
                  },
                  "PrepaymentId": {
                    "type": "string"
                  },
                  "ScheduledAmount": {
                    "type": "number"
                  },
                  "Status": {
                    "type": "string"
                  }
                },
                "description": "Writable fields for `vendorPrepaymentSchedule`, from the published field contract.",
                "x-hellobooks-field-contract": "published"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/vendorPrepaymentSchedule/{id}": {
      "get": {
        "operationId": "getVendorPrepaymentSchedule",
        "summary": "Fetch one vendorPrepaymentSchedule record by id",
        "description": "Mounted by the generic resource factory in `routes/publicApi.routes.js` from the registry row `vendorPrepaymentSchedule` in `routes/publicApi.resources.js`. The request is delegated to the SAME internal controller a signed-in user hits (`controllers/GRPC/Accounting/vendorPrepaymentSchedule.grpc` → `getVendorPrepaymentScheduleById`), so it inherits that controller's validation, server-side tax computation and audit trail. Guards applied, in order: bearer token (`marketplace_app` audience) → plan API-access entitlement → rate limit → AI-credit metering → permission context of the installing user → tenant path match → `requireScope(\"purchases:read\")`.",
        "tags": [
          "vendorPrepaymentSchedule"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "purchases:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/resourceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Note that these controllers return 200 with a failure message in some paths rather than a 4xx; check the body.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "description": "Present only on the controllers that use the `data` key. When present it holds the record.",
                          "$ref": "#/components/schemas/VendorPrepaymentSchedule"
                        }
                      }
                    }
                  ],
                  "description": "The payload is a single `VendorPrepaymentSchedule` records. It is returned under a resource-named top-level key chosen by the internal controller (`accounts`, `bills`, `transactions`, …), NOT reliably under a fixed envelope field — see SuccessEnvelope. Which key this particular controller uses is not yet described; that arrives with the field contract.",
                  "x-hellobooks-payload": {
                    "cardinality": "single",
                    "record": "#/components/schemas/VendorPrepaymentSchedule"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "factory",
        "x-hellobooks-controller": "controllers/GRPC/Accounting/vendorPrepaymentSchedule.grpc",
        "x-hellobooks-handler": "getVendorPrepaymentScheduleById",
        "x-hellobooks-registry-verb": "readOne",
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-required-scopes": [
          "purchases:read"
        ],
        "x-hellobooks-scope-domain": "purchases"
      }
    },
    "/orgs/{orgId}/entities/{entityId}/webhooks": {
      "post": {
        "operationId": "createWebhookSubscription",
        "summary": "Create a webhook subscription",
        "description": "Subscription CRUD is live. Delivery is currently dormant — a subscription created here is recorded and does not yet produce callbacks.\n\nDECLARED FIELD-CONTRACT GAP: this route is listed in `UNCONTRACTED_ROUTE_PREFIXES` in `middlewares/publicApiSerialize.middleware.js`. The response field allowlist does not apply to it; only the deny-key floor does. It is named here rather than omitted.\n\nLEGACY EXEMPTION. This endpoint shipped with no scope guard at all, so it is gated by `requireScopeOrLegacyGrant`: the scope above is required of any token that carries granular public-API scopes, and a token that carries NONE of them is admitted unchanged. That preserves access for every install issued before the vocabulary existed and for installs on unrelated scope vocabularies. The exemption is pinned to this exact set of endpoints, not to the scope — a NEW webhook route is a new capability and is gated by plain `requireScope`. It is not expressible as an OpenAPI security requirement, so it is recorded here and in `x-hellobooks-legacy-grandfathered`; a new client should request the scope in `security` and will always be authorized.",
        "tags": [
          "webhooks"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "webhooks:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Response shape is not published for this route. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
                  "x-hellobooks-field-contract": "unpublished"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "hand-written",
        "x-hellobooks-field-contract": "declared-gap",
        "x-hellobooks-tenant-guard": true,
        "x-hellobooks-required-scopes": [
          "webhooks:write"
        ],
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-legacy-grandfathered": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request shape is not published for this route. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listWebhookSubscriptions",
        "summary": "List this app's webhook subscriptions",
        "description": "See the POST for the delivery caveat.\n\nDECLARED FIELD-CONTRACT GAP: this route is listed in `UNCONTRACTED_ROUTE_PREFIXES` in `middlewares/publicApiSerialize.middleware.js`. The response field allowlist does not apply to it; only the deny-key floor does. It is named here rather than omitted.\n\nLEGACY EXEMPTION. This endpoint shipped with no scope guard at all, so it is gated by `requireScopeOrLegacyGrant`: the scope above is required of any token that carries granular public-API scopes, and a token that carries NONE of them is admitted unchanged. That preserves access for every install issued before the vocabulary existed and for installs on unrelated scope vocabularies. The exemption is pinned to this exact set of endpoints, not to the scope — a NEW webhook route is a new capability and is gated by plain `requireScope`. It is not expressible as an OpenAPI security requirement, so it is recorded here and in `x-hellobooks-legacy-grandfathered`; a new client should request the scope in `security` and will always be authorized.",
        "tags": [
          "webhooks"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "webhooks:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Response shape is not published for this route. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
                  "x-hellobooks-field-contract": "unpublished"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "hand-written",
        "x-hellobooks-field-contract": "declared-gap",
        "x-hellobooks-tenant-guard": true,
        "x-hellobooks-required-scopes": [
          "webhooks:read"
        ],
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-legacy-grandfathered": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ]
      }
    },
    "/orgs/{orgId}/entities/{entityId}/webhooks/deliveries": {
      "get": {
        "operationId": "listWebhookDeliveries",
        "summary": "List webhook delivery attempts",
        "description": "The delivery log for this install's subscriptions. Install-ownership is enforced in the data layer, so a caller only ever sees its own deliveries; the scope answers the separate question of whether the grant may act at all.\n\nDECLARED FIELD-CONTRACT GAP: this route is listed in `UNCONTRACTED_ROUTE_PREFIXES` in `middlewares/publicApiSerialize.middleware.js`. The response field allowlist does not apply to it; only the deny-key floor does. It is named here rather than omitted.",
        "tags": [
          "webhooks"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "webhooks:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Response shape is not published for this route. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
                  "x-hellobooks-field-contract": "unpublished"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "hand-written",
        "x-hellobooks-field-contract": "declared-gap",
        "x-hellobooks-tenant-guard": true,
        "x-hellobooks-required-scopes": [
          "webhooks:read"
        ],
        "x-hellobooks-scope-grain": "granular",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ]
      }
    },
    "/orgs/{orgId}/entities/{entityId}/webhooks/deliveries/purge": {
      "post": {
        "operationId": "purgePendingWebhookDeliveries",
        "summary": "Purge pending deliveries",
        "description": "Destroys queued deliveries that have not been sent. Write-scoped rather than read-scoped precisely because it destroys work: a read-only integration must not reach it even against its own endpoint.\n\nDECLARED FIELD-CONTRACT GAP: this route is listed in `UNCONTRACTED_ROUTE_PREFIXES` in `middlewares/publicApiSerialize.middleware.js`. The response field allowlist does not apply to it; only the deny-key floor does. It is named here rather than omitted.",
        "tags": [
          "webhooks"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "webhooks:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Response shape is not published for this route. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
                  "x-hellobooks-field-contract": "unpublished"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "hand-written",
        "x-hellobooks-field-contract": "declared-gap",
        "x-hellobooks-tenant-guard": true,
        "x-hellobooks-required-scopes": [
          "webhooks:write"
        ],
        "x-hellobooks-scope-grain": "granular",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request shape is not published for this route. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/webhooks/deliveries/{deliveryId}": {
      "get": {
        "operationId": "getWebhookDelivery",
        "summary": "Fetch one delivery attempt",
        "description": "Full detail for a single delivery, including the stored response snippet. Registered after the literal `deliveries` routes in the source so that segment cannot be captured as an id.\n\nDECLARED FIELD-CONTRACT GAP: this route is listed in `UNCONTRACTED_ROUTE_PREFIXES` in `middlewares/publicApiSerialize.middleware.js`. The response field allowlist does not apply to it; only the deny-key floor does. It is named here rather than omitted.",
        "tags": [
          "webhooks"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "webhooks:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Response shape is not published for this route. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
                  "x-hellobooks-field-contract": "unpublished"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "hand-written",
        "x-hellobooks-field-contract": "declared-gap",
        "x-hellobooks-tenant-guard": true,
        "x-hellobooks-required-scopes": [
          "webhooks:read"
        ],
        "x-hellobooks-scope-grain": "granular",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/deliveryId"
          }
        ]
      }
    },
    "/orgs/{orgId}/entities/{entityId}/webhooks/deliveries/{deliveryId}/replay": {
      "post": {
        "operationId": "replayWebhookDelivery",
        "summary": "Replay a delivery",
        "description": "Causes a real outbound POST from HelloBooks infrastructure to the subscription endpoint, which is why it requires the write scope.\n\nDECLARED FIELD-CONTRACT GAP: this route is listed in `UNCONTRACTED_ROUTE_PREFIXES` in `middlewares/publicApiSerialize.middleware.js`. The response field allowlist does not apply to it; only the deny-key floor does. It is named here rather than omitted.",
        "tags": [
          "webhooks"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "webhooks:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Response shape is not published for this route. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
                  "x-hellobooks-field-contract": "unpublished"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "hand-written",
        "x-hellobooks-field-contract": "declared-gap",
        "x-hellobooks-tenant-guard": true,
        "x-hellobooks-required-scopes": [
          "webhooks:write"
        ],
        "x-hellobooks-scope-grain": "granular",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/deliveryId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request shape is not published for this route. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/webhooks/topics": {
      "get": {
        "operationId": "listWebhookTopics",
        "summary": "List every subscribable topic",
        "description": "The catalogue registration validates against. Subscribing to a topic outside this list is rejected with a 400, so this is where the legal spelling comes from — the rejection can tell you a topic is wrong but not what is right.\n\nDerived from the same resource registry that mounts the write routes, so it cannot drift from what actually emits.\n\n`first_party_writes_emit` reports whether edits made INSIDE HelloBooks also emit on this deployment. It is a deployment switch, not a property of your app, and it is off by default — read it rather than assuming either answer.\n\nDECLARED FIELD-CONTRACT GAP: this route is listed in `UNCONTRACTED_ROUTE_PREFIXES` in `middlewares/publicApiSerialize.middleware.js`. The response field allowlist does not apply to it; only the deny-key floor does. It is named here rather than omitted.",
        "tags": [
          "webhooks"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "webhooks:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "topics": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "count": {
                      "type": "integer"
                    },
                    "by_resource": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "first_party_writes_emit": {
                      "type": "boolean"
                    },
                    "note": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "topics",
                    "count",
                    "by_resource",
                    "first_party_writes_emit"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "hand-written",
        "x-hellobooks-field-contract": "declared-gap",
        "x-hellobooks-tenant-guard": true,
        "x-hellobooks-required-scopes": [
          "webhooks:read"
        ],
        "x-hellobooks-scope-grain": "granular",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          }
        ]
      }
    },
    "/orgs/{orgId}/entities/{entityId}/webhooks/{id}": {
      "delete": {
        "operationId": "deleteWebhookSubscription",
        "summary": "Delete a webhook subscription",
        "description": "See the POST for the delivery caveat.\n\nDECLARED FIELD-CONTRACT GAP: this route is listed in `UNCONTRACTED_ROUTE_PREFIXES` in `middlewares/publicApiSerialize.middleware.js`. The response field allowlist does not apply to it; only the deny-key floor does. It is named here rather than omitted.\n\nLEGACY EXEMPTION. This endpoint shipped with no scope guard at all, so it is gated by `requireScopeOrLegacyGrant`: the scope above is required of any token that carries granular public-API scopes, and a token that carries NONE of them is admitted unchanged. That preserves access for every install issued before the vocabulary existed and for installs on unrelated scope vocabularies. The exemption is pinned to this exact set of endpoints, not to the scope — a NEW webhook route is a new capability and is gated by plain `requireScope`. It is not expressible as an OpenAPI security requirement, so it is recorded here and in `x-hellobooks-legacy-grandfathered`; a new client should request the scope in `security` and will always be authorized.",
        "tags": [
          "webhooks"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "webhooks:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Response shape is not published for this route. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
                  "x-hellobooks-field-contract": "unpublished"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "hand-written",
        "x-hellobooks-field-contract": "declared-gap",
        "x-hellobooks-tenant-guard": true,
        "x-hellobooks-required-scopes": [
          "webhooks:write"
        ],
        "x-hellobooks-scope-grain": "granular",
        "x-hellobooks-legacy-grandfathered": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/webhookSubscriptionId"
          }
        ]
      }
    },
    "/orgs/{orgId}/entities/{entityId}/webhooks/{id}/events": {
      "get": {
        "operationId": "listPullEvents",
        "summary": "Fetch events for a pull-mode subscription",
        "description": "Cursor-based and NON-CONSUMING. `after` is the last `delivery_id` you successfully handled; everything newer comes back, oldest first. Asking again with the same cursor returns the same events — which is the point: an app that crashes between fetching and handling has lost nothing, where a fetch-and-consume queue would have dropped that event silently.\n\nAt-least-once, with a stable `event_id` to de-duplicate on. That is the same contract push mode has.\n\nEach event carries the `headers` a push delivery would have carried, signed at THIS handover rather than when the event was recorded — an event that waited six minutes in the queue would otherwise arrive already outside the five-minute freshness window, and a correctly written receiver would reject its own first event. So verification code written against this endpoint is the code that runs in production.\n\n`next_cursor` is absent-as-unchanged on an empty page: a poller holds its existing cursor rather than resetting to the start of the queue.\n\n409 if the subscription is push mode — its events were POSTed to `target_url`, so read them from the delivery log instead. 404 if no such subscription belongs to this app.\n\nDECLARED FIELD-CONTRACT GAP: this route is listed in `UNCONTRACTED_ROUTE_PREFIXES` in `middlewares/publicApiSerialize.middleware.js`. The response field allowlist does not apply to it; only the deny-key floor does. It is named here rather than omitted.",
        "tags": [
          "webhooks"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "webhooks:read"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "delivery_id": {
                            "type": "string"
                          },
                          "event_id": {
                            "type": "string"
                          },
                          "topic": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "body_truncated": {
                            "type": "boolean"
                          },
                          "headers": {
                            "type": "object",
                            "additionalProperties": {
                              "type": "string"
                            }
                          },
                          "body": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "delivery_id",
                          "event_id",
                          "topic",
                          "headers",
                          "body"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_cursor": {
                      "type": "string",
                      "nullable": true
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "signature_scheme": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "events",
                    "has_more",
                    "signature_scheme"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "hand-written",
        "x-hellobooks-field-contract": "declared-gap",
        "x-hellobooks-tenant-guard": true,
        "x-hellobooks-required-scopes": [
          "webhooks:read"
        ],
        "x-hellobooks-scope-grain": "granular",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/webhookSubscriptionId"
          }
        ]
      }
    },
    "/orgs/{orgId}/entities/{entityId}/webhooks/{id}/test": {
      "post": {
        "operationId": "sendWebhookTestEvent",
        "summary": "Send a test event",
        "description": "Sends a synthetic event to the subscription endpoint — a real outbound POST, hence the write scope.\n\nDECLARED FIELD-CONTRACT GAP: this route is listed in `UNCONTRACTED_ROUTE_PREFIXES` in `middlewares/publicApiSerialize.middleware.js`. The response field allowlist does not apply to it; only the deny-key floor does. It is named here rather than omitted.",
        "tags": [
          "webhooks"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "webhooks:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Response shape is not published for this route. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
                  "x-hellobooks-field-contract": "unpublished"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "hand-written",
        "x-hellobooks-field-contract": "declared-gap",
        "x-hellobooks-tenant-guard": true,
        "x-hellobooks-required-scopes": [
          "webhooks:write"
        ],
        "x-hellobooks-scope-grain": "granular",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/webhookSubscriptionId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request shape is not published for this route. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      }
    },
    "/orgs/{orgId}/entities/{entityId}/webhooks/{id}/verify": {
      "post": {
        "operationId": "verifyWebhookSubscription",
        "summary": "Re-run the intent-to-receive handshake",
        "description": "Re-verifies that the subscription endpoint answers the intent-to-receive challenge. Write-scoped: it calls out to the endpoint.\n\nDECLARED FIELD-CONTRACT GAP: this route is listed in `UNCONTRACTED_ROUTE_PREFIXES` in `middlewares/publicApiSerialize.middleware.js`. The response field allowlist does not apply to it; only the deny-key floor does. It is named here rather than omitted.",
        "tags": [
          "webhooks"
        ],
        "security": [
          {
            "marketplaceOAuth2": [
              "webhooks:write"
            ]
          },
          {
            "marketplaceOAuth2": [
              "book:write"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit": {
                "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Response shape is not published for this route. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
                  "x-hellobooks-field-contract": "unpublished"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hellobooks-source": "hand-written",
        "x-hellobooks-field-contract": "declared-gap",
        "x-hellobooks-tenant-guard": true,
        "x-hellobooks-required-scopes": [
          "webhooks:write"
        ],
        "x-hellobooks-scope-grain": "granular",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgId"
          },
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/webhookSubscriptionId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Request shape is not published for this route. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
                "x-hellobooks-field-contract": "unpublished"
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "marketplaceOAuth2": {
        "type": "oauth2",
        "description": "Authorization-code OAuth 2.0 against the HelloBooks marketplace provider. The access token's audience is `marketplace_app`; it is bound to one AppInstall, and therefore to exactly one (org, entity) pair. Public clients use PKCE (`code_challenge` / `code_challenge_method` are accepted on /oauth/authorize).\n\nScopes are GRANULAR: 14 domains x {read, write} = 28 scopes, derived from the internal RBAC permission entity each of the 100 registry resources already gates on, folded onto the module axis of the RBAC v2 manifest. `book:read` and `book:write` are NOT deprecated and NOT removed — they remain first-class grantable BUNDLE scopes that expand to every granular read / write scope respectively, which is why every token issued before this vocabulary existed keeps working unchanged. Request the narrowest domains you need; ask for a bundle only if you genuinely need the whole surface.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://api.hellobooks.ai/oauth/authorize",
            "tokenUrl": "https://api.hellobooks.ai/oauth/token",
            "refreshUrl": "https://api.hellobooks.ai/oauth/token",
            "scopes": {
              "book:read": "Read all of your books data (legacy bundle — grants every read scope)",
              "book:write": "Create and update all of your books data (legacy bundle — grants every write scope)",
              "accounting:read": "Read: Chart of accounts, journals, ledger, classes, locations, budgets and tax rates",
              "accounting:write": "Create, update and delete: Chart of accounts, journals, ledger, classes, locations, budgets and tax rates",
              "banking:read": "Read: Bank transactions, transaction lines, categorisation, cashbook, transfers and reconciliation links",
              "banking:write": "Create, update and delete: Bank transactions, transaction lines, categorisation, cashbook, transfers and reconciliation links",
              "sales:read": "Read: Invoices, quotes, sales orders, credit notes, delivery challans, recurring invoices, customer advances and leads",
              "sales:write": "Create, update and delete: Invoices, quotes, sales orders, credit notes, delivery challans, recurring invoices, customer advances and leads",
              "purchases:read": "Read: Bills, purchase orders, purchase requests, RFQs, goods receipts, vendor prepayments and expenses",
              "purchases:write": "Create, update and delete: Bills, purchase orders, purchase requests, RFQs, goods receipts, vendor prepayments and expenses",
              "contacts:read": "Read: Customers, vendors, business owners, their addresses, contact people, groups and balances",
              "contacts:write": "Create, update and delete: Customers, vendors, business owners, their addresses, contact people, groups and balances",
              "payments:read": "Read: Payments received and made",
              "payments:write": "Create, update and delete: Payments received and made",
              "paymentmethods:read": "Read: Stored credit and debit card details for customers, vendors, employees and owners",
              "paymentmethods:write": "Create, update and delete: Stored credit and debit card details for customers, vendors, employees and owners",
              "inventory:read": "Read: Items and stock records",
              "inventory:write": "Create, update and delete: Items and stock records",
              "reports:read": "Read: Balance sheet, profit and loss, cash flow, gross profit and revenue-by-customer reports",
              "reports:write": "Create, update and delete: Balance sheet, profit and loss, cash flow, gross profit and revenue-by-customer reports",
              "fixedassets:read": "Read: Fixed assets, asset groups, disposals, surveys, transfers and depreciation timing",
              "fixedassets:write": "Create, update and delete: Fixed assets, asset groups, disposals, surveys, transfers and depreciation timing",
              "projects:read": "Read: Projects and job tracking",
              "projects:write": "Create, update and delete: Projects and job tracking",
              "payroll:read": "Read: Employee records and employee addresses",
              "payroll:write": "Create, update and delete: Employee records and employee addresses",
              "comments:read": "Read: Comments attached to documents",
              "comments:write": "Create, update and delete: Comments attached to documents",
              "webhooks:read": "Read: Your app's webhook subscriptions",
              "webhooks:write": "Create, update and delete: Your app's webhook subscriptions"
            }
          }
        },
        "x-hellobooks-scope-model": {
          "grain": "granular",
          "source": "utils/publicApiScopes.util.js",
          "domainCount": 14,
          "granularScopeCount": 28,
          "domains": [
            {
              "name": "accounting",
              "label": "Chart of accounts, journals, ledger, classes, locations, budgets and tax rates",
              "read": "accounting:read",
              "write": "accounting:write",
              "manifestModule": "accounting"
            },
            {
              "name": "banking",
              "label": "Bank transactions, transaction lines, categorisation, cashbook, transfers and reconciliation links",
              "read": "banking:read",
              "write": "banking:write",
              "manifestModule": "banking"
            },
            {
              "name": "sales",
              "label": "Invoices, quotes, sales orders, credit notes, delivery challans, recurring invoices, customer advances and leads",
              "read": "sales:read",
              "write": "sales:write",
              "manifestModule": "sales"
            },
            {
              "name": "purchases",
              "label": "Bills, purchase orders, purchase requests, RFQs, goods receipts, vendor prepayments and expenses",
              "read": "purchases:read",
              "write": "purchases:write",
              "manifestModule": "purchases"
            },
            {
              "name": "contacts",
              "label": "Customers, vendors, business owners, their addresses, contact people, groups and balances",
              "read": "contacts:read",
              "write": "contacts:write",
              "manifestModule": "contacts"
            },
            {
              "name": "payments",
              "label": "Payments received and made",
              "read": "payments:read",
              "write": "payments:write",
              "manifestModule": null,
              "manifestNote": "split out of banking — money movement, separate on the Intuit precedent"
            },
            {
              "name": "paymentmethods",
              "label": "Stored credit and debit card details for customers, vendors, employees and owners",
              "read": "paymentmethods:read",
              "write": "paymentmethods:write",
              "manifestModule": null,
              "manifestNote": "no manifest module; stored payment-instrument detail, isolated deliberately"
            },
            {
              "name": "inventory",
              "label": "Items and stock records",
              "read": "inventory:read",
              "write": "inventory:write",
              "manifestModule": "inventory"
            },
            {
              "name": "reports",
              "label": "Balance sheet, profit and loss, cash flow, gross profit and revenue-by-customer reports",
              "read": "reports:read",
              "write": "reports:write",
              "manifestModule": "reports"
            },
            {
              "name": "fixedassets",
              "label": "Fixed assets, asset groups, disposals, surveys, transfers and depreciation timing",
              "read": "fixedassets:read",
              "write": "fixedassets:write",
              "manifestModule": null,
              "manifestNote": "internal permission entities exist; no manifest v2 module yet"
            },
            {
              "name": "projects",
              "label": "Projects and job tracking",
              "read": "projects:read",
              "write": "projects:write",
              "manifestModule": null,
              "manifestNote": "internal `project:*` permission entity; no manifest v2 module yet"
            },
            {
              "name": "payroll",
              "label": "Employee records and employee addresses",
              "read": "payroll:read",
              "write": "payroll:write",
              "manifestModule": "payroll"
            },
            {
              "name": "comments",
              "label": "Comments attached to documents",
              "read": "comments:read",
              "write": "comments:write",
              "manifestModule": null,
              "manifestNote": "internal `comment:*` permission entity; cross-cutting annotations, no manifest module"
            },
            {
              "name": "webhooks",
              "label": "Your app's webhook subscriptions",
              "read": "webhooks:read",
              "write": "webhooks:write",
              "manifestModule": null,
              "manifestNote": "not a registry resource; the app's own webhook subscriptions"
            }
          ],
          "bundles": {
            "book:read": {
              "description": "Read all of your books data (legacy bundle — grants every read scope)",
              "expandsTo": [
                "accounting:read",
                "banking:read",
                "sales:read",
                "purchases:read",
                "contacts:read",
                "payments:read",
                "paymentmethods:read",
                "inventory:read",
                "reports:read",
                "fixedassets:read",
                "projects:read",
                "payroll:read",
                "comments:read",
                "webhooks:read"
              ]
            },
            "book:write": {
              "description": "Create and update all of your books data (legacy bundle — grants every write scope)",
              "expandsTo": [
                "accounting:write",
                "banking:write",
                "sales:write",
                "purchases:write",
                "contacts:write",
                "payments:write",
                "paymentmethods:write",
                "inventory:write",
                "reports:write",
                "fixedassets:write",
                "projects:write",
                "payroll:write",
                "comments:write",
                "webhooks:write"
              ]
            }
          },
          "compatibilityRules": [
            "`book:read` expands to every `<domain>:read`.",
            "`book:write` expands to every `<domain>:write`. It deliberately does NOT expand to reads — a write-only token cannot reach a read route today, and that stays true.",
            "Webhook subscription management was gated by nothing beyond a valid bearer token, so `webhooks:read` + `webhooks:write` are granted to any token carrying either bundle AND to any token carrying no granular public-API scope at all. That covers live installs on unrelated vocabularies. Only a NEW grant that opted into granular scopes is held to them."
          ],
          "expansionIsCheckedAtTheGuard": "middlewares/appAccessToken.middleware.js expands the granted list before requireScope() tests it, and never rewrites it: GET /me still reports exactly what was granted, not the expansion.",
          "coarseByDesign": [
            "POST /oauth/register (dynamic client registration) grants only the two bundles.",
            "The /books/drafts draft -> confirm -> commit routes require only the bundles.",
            "Both because AI-MCP-Hellobooks understands exactly four scope strings and ignores the rest, so a granular scope would grant its connector nothing."
          ],
          "notGrantableOnThisApi": {
            "scopes": [
              "owner:close",
              "audit:export"
            ],
            "reason": "Part of the marketplace catalog and enforced by AI-MCP-Hellobooks, but checked by no /public/v1 route. Listing them among this API's scopes would imply they grant something here. They do not."
          }
        }
      }
    },
    "parameters": {
      "orgId": {
        "name": "orgId",
        "in": "path",
        "required": true,
        "description": "The organisation the call targets. MUST equal the OrgRefId the access token's AppInstall is bound to — `requireTenantParamMatch` returns 403 `tenant_scope_violation` otherwise. There is no cross-tenant form of this API.",
        "schema": {
          "type": "string"
        }
      },
      "entityId": {
        "name": "entityId",
        "in": "path",
        "required": true,
        "description": "The entity (book) within the organisation. MUST equal the install's EntityRefId; see `orgId`.",
        "schema": {
          "type": "string"
        }
      },
      "resourceId": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "Identifier of the record.",
        "schema": {
          "type": "string"
        }
      },
      "webhookSubscriptionId": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "Identifier of a webhook subscription, as returned by POST /webhooks. A 24-character hex ObjectId -- these records live in Mongo, unlike the accounting resources whose ids are UUIDs.\n\nThe pattern is not decoration: `deliveries` and `topics` are reserved sub-collections under /webhooks, and it is what makes `/webhooks/{id}/…` provably unable to capture them.",
        "schema": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{24}$"
        }
      },
      "deliveryId": {
        "name": "deliveryId",
        "in": "path",
        "required": true,
        "description": "Identifier of a webhook delivery attempt, as returned by the delivery log.",
        "schema": {
          "type": "string"
        }
      },
      "draftId": {
        "name": "draftId",
        "in": "path",
        "required": true,
        "description": "Bookkeeping draft identifier returned by the draft create call.",
        "schema": {
          "type": "string"
        }
      },
      "isArchived": {
        "name": "isArchived",
        "in": "query",
        "required": false,
        "description": "Return archived records instead of active ones. The gateway compares the raw query value against the literal string `true`; every other value, `1` and `TRUE` included, is treated as false.",
        "schema": {
          "type": "string",
          "enum": [
            "true",
            "false"
          ]
        }
      }
    },
    "schemas": {
      "GatewayError": {
        "type": "object",
        "description": "The error shape emitted by the /public/v1 gateway middlewares (authentication, tenant match, scope, rate limit, controller binding).",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Stable machine-readable code."
          },
          "message": {
            "type": "string"
          },
          "required": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Present on `insufficient_scope`: the scopes that were missing."
          },
          "resource": {
            "type": "string",
            "description": "Present on `controller_load_failed` / `handler_missing`: the registry `seg`."
          },
          "handler": {
            "type": "string",
            "description": "Present on `handler_missing`: the controller export that was absent."
          },
          "detail": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "EntitlementError": {
        "type": "object",
        "description": "A SECOND, DIFFERENT error shape. Plan-entitlement denials (`requireApiAccessFeature`) do not use the gateway shape above — they return the first-party subscription-guard payload, in which `error` is an OBJECT rather than a string. A client that reads `body.error` as a string will get `[object Object]` here. This divergence is real and is described rather than smoothed over.",
        "required": [
          "success",
          "error"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "const": false
          },
          "error": {
            "type": "object",
            "required": [
              "code"
            ],
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "FEATURE_NOT_IN_PLAN",
                  "LIMIT_EXCEEDED"
                ]
              },
              "plan": {
                "type": "string"
              },
              "upgradeTo": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "upgradeUrl": {
                "type": "string"
              },
              "feature": {
                "type": "string"
              },
              "limitKey": {
                "type": "string"
              },
              "limit": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "current": {
                "type": [
                  "number",
                  "null"
                ]
              }
            },
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      },
      "AiCreditsError": {
        "type": "object",
        "description": "AI-credit metering refusal. Every /public/v1 request except /health, /me and the books draft→commit flow is charged against the install's tenant AI-credit wallet before any tenant work happens.",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "enum": [
              "INSUFFICIENT_AI_CREDITS",
              "AI_CREDITS_CHECK_UNAVAILABLE",
              "MISSING_ORG_OR_ENTITY"
            ]
          },
          "feature": {
            "type": "string"
          },
          "requiredUSD": {
            "type": "number"
          },
          "balanceUSD": {
            "type": "number"
          },
          "creditBalance": {
            "type": "number"
          },
          "requiredCredits": {
            "type": "number"
          },
          "topUpUrl": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "SuccessEnvelope": {
        "type": "object",
        "description": "A /public/v1 success body. THERE IS NO SINGLE ENVELOPE — this was measured, not assumed: across the Accounting controllers these routes delegate to, top-level success keys are `success` (219 sites), `message` (322), `data` (18), plus 146 distinct resource-named keys such as `accounts`, `bills`, `transactions`, `items`, `groups`. Any rule of the form 'the payload lives under .data' would be wrong most of the time. The properties below are therefore the keys that MAY appear, none of them required, and the payload itself sits under a resource-named key this description cannot yet name per resource.",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "data": {}
        },
        "additionalProperties": true,
        "x-hellobooks-envelope": "heterogeneous"
      },
      "Account": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `account` record, from the published field contract (model `ChartOfAccount`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AccountNumber": {
            "type": "string"
          },
          "AccountSubType": {
            "type": "string"
          },
          "AccountType": {
            "type": "string"
          },
          "ArrayAccountId": {
            "type": "string"
          },
          "ArrayLinkId": {
            "type": "string"
          },
          "BankName": {
            "type": "string"
          },
          "CashFlowCategory": {
            "type": "string"
          },
          "Classification": {
            "type": "string"
          },
          "Code": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CurrencyRef": {
            "type": "string"
          },
          "Description": {
            "type": "string"
          },
          "EquityPurpose": {
            "type": "string"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "FxSource": {
            "type": "string"
          },
          "HboId": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "IsArrayAccount": {
            "type": "boolean"
          },
          "IsAutoGenerated": {
            "type": "boolean"
          },
          "IsDiscontinued": {
            "type": "boolean"
          },
          "IsFavorite": {
            "type": "boolean"
          },
          "IsInternalTrf": {
            "type": "boolean"
          },
          "IsParentAccount": {
            "type": "boolean"
          },
          "IsPlaidAccount": {
            "type": "boolean"
          },
          "IsSystemDefined": {
            "type": "boolean"
          },
          "LastEditedSystem": {
            "type": "string"
          },
          "MigrationBatchId": {
            "type": "string"
          },
          "Name": {
            "type": "string"
          },
          "OdooId": {
            "type": "integer"
          },
          "OdooLinkedAt": {
            "type": "string"
          },
          "OdooModel": {
            "type": "string"
          },
          "OdooWriteDate": {
            "type": "string"
          },
          "OriginId": {
            "type": "string"
          },
          "OriginSystem": {
            "type": "string"
          },
          "ParentAccountRefId": {
            "type": "string"
          },
          "PlaidAccountId": {
            "type": "string"
          },
          "PlaidAvailableBalance": {
            "type": "number"
          },
          "PlaidBalanceAsOf": {
            "type": "string"
          },
          "PlaidBalanceCurrency": {
            "type": "string"
          },
          "PlaidCurrentBalance": {
            "type": "number"
          },
          "PlaidItemId": {
            "type": "string"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "StatutoryGroup": {
            "type": "string"
          },
          "SyncVersion": {
            "type": "integer"
          },
          "SystemRole": {
            "type": "string"
          },
          "TallyClosingBalance": {
            "type": "number"
          },
          "TallyDepth": {
            "type": "integer"
          },
          "TallyExtras": {
            "type": "object"
          },
          "TallyGroupPath": {
            "type": "string"
          },
          "TallyGuid": {
            "type": "string"
          },
          "TallyLedgerName": {
            "type": "string"
          },
          "TallyOpeningBalance": {
            "type": "number"
          },
          "TallyParentGroup": {
            "type": "string"
          },
          "TallyPrimaryGroup": {
            "type": "string"
          },
          "TaxComponentRefId": {
            "type": "string"
          },
          "TaxComponentType": {
            "type": "string"
          },
          "TaxDirection": {
            "type": "string"
          },
          "TaxRef": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "WaveBusinessId": {
            "type": "string"
          },
          "WaveId": {
            "type": "string"
          },
          "WaveLinkedAt": {
            "type": "string"
          },
          "XeroId": {
            "type": "string"
          },
          "XeroLinkedAt": {
            "type": "string"
          },
          "XeroTenantId": {
            "type": "string"
          },
          "XeroUpdatedDateUTC": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "AccountsByPayee": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `accountsByPayee` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "AgedPayables": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `agedPayables` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "AgedPayablesSummary": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `agedPayablesSummary` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "AgedReceivables": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `agedReceivables` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "AgedReceivablesSummary": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `agedReceivablesSummary` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "ApprovalRule": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `approvalRule` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "AssetAttachment": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `assetAttachment` record, from the published field contract (model `AssetAttachment`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "Description": {
            "type": "string"
          },
          "FileName": {
            "type": "string"
          },
          "FileSize": {
            "type": "integer"
          },
          "FileType": {
            "type": "string"
          },
          "FileUrl": {
            "type": "string"
          },
          "FixedAssetId": {
            "type": "string"
          },
          "UploadedAt": {
            "type": "string",
            "readOnly": true
          },
          "UploadedBy": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "AssetDisposal": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `assetDisposal` record, from the published field contract (model `AssetDisposal`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "BookValue": {
            "type": "number"
          },
          "BuyerName": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CreatedBy": {
            "type": "string"
          },
          "DisposalCosts": {
            "type": "number"
          },
          "DisposalDate": {
            "type": "string"
          },
          "DisposalType": {
            "type": "string"
          },
          "FixedAssetId": {
            "type": "string"
          },
          "GainLoss": {
            "type": "number"
          },
          "IsJournalized": {
            "type": "boolean"
          },
          "JournalEntryId": {
            "type": "string"
          },
          "NetProceeds": {
            "type": "number"
          },
          "Reason": {
            "type": "string"
          },
          "Rule43GSTOnSaleValue": {
            "type": "number"
          },
          "Rule43IsAutoComputed": {
            "type": "boolean"
          },
          "Rule43MonthsRemaining": {
            "type": "integer"
          },
          "Rule43MonthsUsed": {
            "type": "integer"
          },
          "Rule43OriginalITC": {
            "type": "number"
          },
          "Rule43ProportionalITC": {
            "type": "number"
          },
          "Rule43ReversalAmount": {
            "type": "number"
          },
          "Rule43ReversalBasis": {
            "type": "string"
          },
          "SaleProceeds": {
            "type": "number"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "AssetGroup": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `assetGroup` record, from the published field contract (model `AssetGroup`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AccumulatedDepreciationAccountId": {
            "type": "string"
          },
          "Code": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "DepreciationExpenseAccountId": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "IsBuilding": {
            "type": "boolean"
          },
          "Name": {
            "type": "string"
          },
          "ParentId": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "AssetSurvey": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `assetSurvey` record, from the published field contract (model `AssetSurvey`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "CompletedBy": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CreatedBy": {
            "type": "string"
          },
          "Department": {
            "type": "string"
          },
          "EndDate": {
            "type": "string"
          },
          "LocationId": {
            "type": "string"
          },
          "StartDate": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "SurveyName": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "AssetTimingDifference": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `assetTimingDifference` record, from the published field contract (model `AssetTimingDifference`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "BookDepreciation": {
            "type": "number"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "DeferredTaxAmount": {
            "type": "number"
          },
          "DeferredTaxRate": {
            "type": "number"
          },
          "FixedAssetId": {
            "type": "string"
          },
          "IsJournalized": {
            "type": "boolean"
          },
          "JournalDate": {
            "type": "string"
          },
          "JournalEntryId": {
            "type": "string"
          },
          "Period": {
            "type": "string"
          },
          "TaxDepreciation": {
            "type": "number"
          },
          "TimingDifference": {
            "type": "number"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "AssetTransfer": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `assetTransfer` record, from the published field contract (model `AssetTransfer`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "ApprovedBy": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CreatedBy": {
            "type": "string"
          },
          "FixedAssetId": {
            "type": "string"
          },
          "FromDepartment": {
            "type": "string"
          },
          "FromLocationId": {
            "type": "string"
          },
          "Reason": {
            "type": "string"
          },
          "ToDepartment": {
            "type": "string"
          },
          "ToLocationId": {
            "type": "string"
          },
          "TransferDate": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "BalanceSheet": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `balanceSheet` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "Bill": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `bill` record, from the published field contract (model `Bill`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AISuggesstion": {
            "type": "object"
          },
          "AiIterationCount": {
            "type": "integer"
          },
          "AiTotalIterCachedTokens": {
            "type": "integer"
          },
          "AiTotalIterInputTokens": {
            "type": "integer"
          },
          "AiTotalIterOutputTokens": {
            "type": "integer"
          },
          "AiTotalIterTotalINR": {
            "type": "number"
          },
          "AiTotalIterTotalUSD": {
            "type": "number"
          },
          "ApprovalComment": {
            "type": "string"
          },
          "ApprovalStatus": {
            "type": "string"
          },
          "ApprovedAt": {
            "type": "string"
          },
          "ApprovedBy": {
            "type": "string"
          },
          "Attachments": {
            "type": "object"
          },
          "BauabzugBaseAmount": {
            "type": "number"
          },
          "BauabzugFreistellungNumberSnapshot": {
            "type": "string"
          },
          "BauabzugRate": {
            "type": "number"
          },
          "BauabzugWithheldAmount": {
            "type": "number"
          },
          "BauabzugWithholding": {
            "type": "boolean"
          },
          "BillMatchingAnalysis": {
            "type": "object"
          },
          "BillNumber": {
            "type": "string"
          },
          "BrandingThemeId": {
            "type": "string"
          },
          "CapitalGoodCommonUse": {
            "type": "boolean"
          },
          "ClassRef": {
            "type": "string"
          },
          "Comment": {
            "type": "object"
          },
          "ConfidencePercentage": {
            "type": "string"
          },
          "ContractRefId": {
            "type": "string"
          },
          "CounterpartyEntityRefId": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CreatedBy": {
            "type": "string"
          },
          "CreatedById": {
            "type": "string"
          },
          "CurrencyRef": {
            "type": "string"
          },
          "CustomFields": {
            "type": "object"
          },
          "CustomsDutyAmount": {
            "type": "number"
          },
          "DifferentialPercent": {
            "type": "number"
          },
          "DueDate": {
            "type": "string"
          },
          "EstimatedPaymentDate": {
            "type": "string"
          },
          "EwayBillRequired": {
            "type": "boolean"
          },
          "EwbGeneratedAt": {
            "type": "string"
          },
          "EwbNo": {
            "type": "string"
          },
          "EwbRefId": {
            "type": "string"
          },
          "EwbStatus": {
            "type": "string"
          },
          "EwbValidUpto": {
            "type": "string"
          },
          "EwtAtcCode": {
            "type": "string"
          },
          "EwtBaseAmount": {
            "type": "number"
          },
          "EwtExemptCertSnapshot": {
            "type": "string"
          },
          "EwtRate": {
            "type": "number"
          },
          "EwtReason": {
            "type": "string"
          },
          "EwtWithheldAmount": {
            "type": "number"
          },
          "EwtWithholding": {
            "type": "boolean"
          },
          "ExchangeGainLoss": {
            "type": "number"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "ExcludeFromEwb": {
            "type": "boolean"
          },
          "FRRetenueBaseAmount": {
            "type": "number"
          },
          "FRRetenueBucket": {
            "type": "string"
          },
          "FRRetenueDttCertNoSnapshot": {
            "type": "string"
          },
          "FRRetenueRate": {
            "type": "number"
          },
          "FRRetenueWithheldAmount": {
            "type": "number"
          },
          "FRRetenueWithholding": {
            "type": "boolean"
          },
          "FinancialYear": {
            "type": "string"
          },
          "FunctionalTotalPayableAmount": {
            "type": "number"
          },
          "FxRateDate": {
            "type": "string"
          },
          "FxSource": {
            "type": "string"
          },
          "GSTCategory": {
            "type": "string"
          },
          "GoodsReceiptNoteRef": {
            "type": "string"
          },
          "HasGoodsReceipt": {
            "type": "boolean"
          },
          "ITCReclaimedAmount": {
            "type": "number"
          },
          "ITCReclaimedAt": {
            "type": "string"
          },
          "ITCReversedAmount": {
            "type": "number"
          },
          "ITCReversedAt": {
            "type": "string"
          },
          "IrpfBaseAmount": {
            "type": "number"
          },
          "IrpfRate": {
            "type": "number"
          },
          "IrpfSection": {
            "type": "string"
          },
          "IrpfWithheldAmount": {
            "type": "number"
          },
          "IrpfWithholding": {
            "type": "boolean"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "IsCapitalGood": {
            "type": "boolean"
          },
          "IsCommonUse": {
            "type": "boolean"
          },
          "IsConversion": {
            "type": "boolean"
          },
          "IsEcGoodsMovement": {
            "type": "boolean"
          },
          "IsGstTdsApplicable": {
            "type": "boolean"
          },
          "IsITCEligible": {
            "type": "boolean"
          },
          "IsInterCompany": {
            "type": "boolean"
          },
          "IsPartyGSTRegistered": {
            "type": "boolean"
          },
          "IsPublishedToQbo": {
            "type": "boolean"
          },
          "IsReverseCharge": {
            "type": "boolean"
          },
          "IssuedDate": {
            "type": "string",
            "readOnly": true
          },
          "JpConsumptionTaxAmount": {
            "type": "number"
          },
          "JpConsumptionTaxBaseAmount": {
            "type": "number"
          },
          "JpConsumptionTaxRate": {
            "type": "number"
          },
          "JpGensenChoshuApplicable": {
            "type": "boolean"
          },
          "JpGensenChoshuBaseAmount": {
            "type": "number"
          },
          "JpGensenChoshuHighAmount": {
            "type": "number"
          },
          "JpGensenChoshuLowAmount": {
            "type": "number"
          },
          "JpGensenChoshuSection": {
            "type": "string"
          },
          "JpGensenChoshuWithheldAmount": {
            "type": "number"
          },
          "JpIsReducedRate": {
            "type": "boolean"
          },
          "JpItcLossAmount": {
            "type": "number"
          },
          "JpItcPhaseCreditPct": {
            "type": "number"
          },
          "JpQualifiedInvoiceApplicable": {
            "type": "boolean"
          },
          "LastEditedSystem": {
            "type": "string"
          },
          "LocationRef": {
            "type": "string"
          },
          "MigrationBatchId": {
            "type": "string"
          },
          "NeedsReview": {
            "type": "boolean"
          },
          "OdooId": {
            "type": "integer"
          },
          "OdooLinkedAt": {
            "type": "string"
          },
          "OdooModel": {
            "type": "string"
          },
          "OdooWriteDate": {
            "type": "string"
          },
          "OriginId": {
            "type": "string"
          },
          "OriginSystem": {
            "type": "string"
          },
          "OriginalTotals": {
            "type": "object"
          },
          "PartyGSTIN": {
            "type": "string"
          },
          "PartyStateCode": {
            "type": "string"
          },
          "PayeeAddresses": {
            "type": "array"
          },
          "PayeeRef": {
            "type": "string"
          },
          "PayeeType": {
            "type": "string"
          },
          "PaygBaseAmount": {
            "type": "number"
          },
          "PaygRate": {
            "type": "number"
          },
          "PaygSection": {
            "type": "string"
          },
          "PaygWithheldAmount": {
            "type": "number"
          },
          "PaygWithholding": {
            "type": "boolean"
          },
          "PlaceOfSupply": {
            "type": "string"
          },
          "PphArticle": {
            "type": "string"
          },
          "PphBaseAmount": {
            "type": "number"
          },
          "PphBasis": {
            "type": "string"
          },
          "PphNoNpwpDoubled": {
            "type": "boolean"
          },
          "PphRate": {
            "type": "number"
          },
          "PphReason": {
            "type": "string"
          },
          "PphResolutionBasis": {
            "type": "string"
          },
          "PphWithheldAmount": {
            "type": "number"
          },
          "PphWithholding": {
            "type": "boolean"
          },
          "ProjectRef": {
            "type": "string"
          },
          "PurchaseOrderRef": {
            "type": "string"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "RCMCategory": {
            "type": "string"
          },
          "ReferenceNumber": {
            "type": "string"
          },
          "Reg105BaseAmount": {
            "type": "number"
          },
          "Reg105FederalRate": {
            "type": "number"
          },
          "Reg105FederalWithheld": {
            "type": "number"
          },
          "Reg105QcRate": {
            "type": "number"
          },
          "Reg105QcWithheld": {
            "type": "number"
          },
          "Reg105WaiverApplied": {
            "type": "boolean"
          },
          "Reg105WaiverCertNoSnapshot": {
            "type": "string"
          },
          "Reg105Withholding": {
            "type": "boolean"
          },
          "ReviewReason": {
            "type": "string"
          },
          "RitenutaBaseAmount": {
            "type": "number"
          },
          "RitenutaBaseBasis": {
            "type": "string"
          },
          "RitenutaCausale": {
            "type": "string"
          },
          "RitenutaRate": {
            "type": "number"
          },
          "RitenutaTaxableBase": {
            "type": "number"
          },
          "RitenutaWithheldAmount": {
            "type": "number"
          },
          "RitenutaWithholding": {
            "type": "boolean"
          },
          "SchedularActivityCode": {
            "type": "string"
          },
          "SchedularBaseAmount": {
            "type": "number"
          },
          "SchedularRate": {
            "type": "number"
          },
          "SchedularWithheldAmount": {
            "type": "number"
          },
          "SchedularWithholding": {
            "type": "boolean"
          },
          "SelfInvoiceRefId": {
            "type": "string"
          },
          "SellerGSTIN": {
            "type": "string"
          },
          "ServicesPerformedInQc": {
            "type": "boolean"
          },
          "Source": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "SupplyType": {
            "type": "string"
          },
          "SyncVersion": {
            "type": "integer"
          },
          "SyncedTo": {
            "type": "string"
          },
          "SyncedToTally": {
            "type": "boolean"
          },
          "TallyExtras": {
            "type": "object"
          },
          "TallyGuid": {
            "type": "string"
          },
          "TallyNumber": {
            "type": "string"
          },
          "TallyVoucherSeries": {
            "type": "string"
          },
          "TallyVoucherType": {
            "type": "string"
          },
          "TaxMappingMessage": {
            "type": "string"
          },
          "TaxRef": {
            "type": "string"
          },
          "TaxType": {
            "type": "string"
          },
          "TcsAmount": {
            "type": "number"
          },
          "TcsBaseAmount": {
            "type": "number"
          },
          "TcsRate": {
            "type": "number"
          },
          "TcsRefId": {
            "type": "string"
          },
          "TdsAmount": {
            "type": "number"
          },
          "TdsBaseAmount": {
            "type": "number"
          },
          "TdsRate": {
            "type": "number"
          },
          "TdsRefId": {
            "type": "string"
          },
          "TermsAndConditions": {
            "type": "object"
          },
          "TotalCGST": {
            "type": "number"
          },
          "TotalCess": {
            "type": "number"
          },
          "TotalCessNonAdvalorem": {
            "type": "number"
          },
          "TotalDiscountAmount": {
            "type": "number"
          },
          "TotalIGST": {
            "type": "number"
          },
          "TotalLabourAmount": {
            "type": "number"
          },
          "TotalPayableAmount": {
            "type": "number"
          },
          "TotalSGST": {
            "type": "number"
          },
          "TotalSupplyAmount": {
            "type": "number"
          },
          "TotalTaxAmount": {
            "type": "number"
          },
          "TotalTaxableAmount": {
            "type": "number"
          },
          "TotalUTGST": {
            "type": "number"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "VendorInvoiceDate": {
            "type": "string"
          },
          "VendorInvoiceNo": {
            "type": "string"
          },
          "VendorPrepaymentRefId": {
            "type": "string"
          },
          "VoidReason": {
            "type": "string"
          },
          "VoidedAt": {
            "type": "string"
          },
          "VoidedBy": {
            "type": "string"
          },
          "WaveBusinessId": {
            "type": "string"
          },
          "WaveId": {
            "type": "string"
          },
          "WaveLinkedAt": {
            "type": "string"
          },
          "WhtArticle": {
            "type": "string"
          },
          "WhtBaseAmount": {
            "type": "number"
          },
          "WhtBasis": {
            "type": "string"
          },
          "WhtCategory": {
            "type": "string"
          },
          "WhtGlCode": {
            "type": "string"
          },
          "WhtRate": {
            "type": "number"
          },
          "WhtReason": {
            "type": "string"
          },
          "WhtWithheldAmount": {
            "type": "number"
          },
          "WhtWithholding": {
            "type": "boolean"
          },
          "XeroId": {
            "type": "string"
          },
          "XeroLinkedAt": {
            "type": "string"
          },
          "XeroTenantId": {
            "type": "string"
          },
          "XeroUpdatedDateUTC": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "BillAddress": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `billAddress` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "BillLine": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `billLine` record, from the published field contract (model `BillLine`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AccountHeadRef": {
            "type": "string"
          },
          "Amount": {
            "type": "number"
          },
          "BillId": {
            "type": "string"
          },
          "BrandRefId": {
            "type": "string"
          },
          "CGSTAmount": {
            "type": "number"
          },
          "CGSTRate": {
            "type": "number"
          },
          "CessAmount": {
            "type": "number"
          },
          "CessNonAdvaloremAmount": {
            "type": "number"
          },
          "CessNonAdvaloremRate": {
            "type": "number"
          },
          "CessRate": {
            "type": "number"
          },
          "ClassComponentRef1": {
            "type": "string"
          },
          "ClassComponentRef2": {
            "type": "string"
          },
          "ClassComponentRef3": {
            "type": "string"
          },
          "ClassComponentRef4": {
            "type": "string"
          },
          "ClassRef1": {
            "type": "string"
          },
          "ClassRef2": {
            "type": "string"
          },
          "ClassRef3": {
            "type": "string"
          },
          "ClassRef4": {
            "type": "string"
          },
          "CostCodeRefId": {
            "type": "string"
          },
          "Currency": {
            "type": "string"
          },
          "CustomerRefId": {
            "type": "string"
          },
          "DepartmentRefId": {
            "type": "string"
          },
          "DerivedTaxRate": {
            "type": "number"
          },
          "Description": {
            "type": "string"
          },
          "DiscountAmount": {
            "type": "number"
          },
          "DiscountPercentage": {
            "type": "number"
          },
          "FunctionalAmount": {
            "type": "number"
          },
          "GSTRate": {
            "type": "number"
          },
          "HSNCode": {
            "type": "string"
          },
          "HSN_SAC": {
            "type": "string"
          },
          "IGSTAmount": {
            "type": "number"
          },
          "IGSTRate": {
            "type": "number"
          },
          "IsDiscountBeforeTax": {
            "type": "boolean"
          },
          "IsITCEligible": {
            "type": "boolean"
          },
          "IsInventoryableItem": {
            "type": "boolean"
          },
          "ItemRef": {
            "type": "string"
          },
          "LabourAccountHeadRef": {
            "type": "string"
          },
          "LabourAmount": {
            "type": "number"
          },
          "LabourHSN_SAC": {
            "type": "string"
          },
          "LabourRate": {
            "type": "number"
          },
          "LabourTaxAmount": {
            "type": "number"
          },
          "LabourTaxRate": {
            "type": "number"
          },
          "LabourTaxRefId": {
            "type": "string"
          },
          "LineExchangeRate": {
            "type": "number"
          },
          "LocationRef": {
            "type": "string"
          },
          "MappedAccountSource": {
            "type": "string"
          },
          "MappedItemId": {
            "type": "string"
          },
          "MappedItemName": {
            "type": "string"
          },
          "MappedItemSource": {
            "type": "string"
          },
          "MarginValue": {
            "type": "number"
          },
          "NCCDAmount": {
            "type": "number"
          },
          "NCCDRate": {
            "type": "number"
          },
          "OcrCreateVendorDescriptionMapping": {
            "type": "boolean"
          },
          "PayeeRef": {
            "type": "string"
          },
          "PayeeType": {
            "type": "string"
          },
          "ProjectRef": {
            "type": "string"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "Quantity": {
            "type": "number"
          },
          "Rate": {
            "type": "number"
          },
          "ReverseCharge": {
            "type": "boolean"
          },
          "SGSTAmount": {
            "type": "number"
          },
          "SGSTRate": {
            "type": "number"
          },
          "StateCessAmount": {
            "type": "number"
          },
          "StateCessNonAdvaloremAmount": {
            "type": "number"
          },
          "StateCessNonAdvaloremRate": {
            "type": "number"
          },
          "StateCessRate": {
            "type": "number"
          },
          "SupplyAmount": {
            "type": "number"
          },
          "TaxAmount": {
            "type": "number"
          },
          "TaxClassification": {
            "type": "string"
          },
          "TaxConfidence": {
            "type": "number"
          },
          "TaxMessage": {
            "type": "string"
          },
          "TaxRefId": {
            "type": "string"
          },
          "TaxUnconfirmed": {
            "type": "boolean"
          },
          "TaxableAmount": {
            "type": "number"
          },
          "UTGSTAmount": {
            "type": "number"
          },
          "UTGSTRate": {
            "type": "number"
          },
          "UnitPrice": {
            "type": "number"
          },
          "UnitRefId": {
            "type": "string"
          },
          "VendorDescriptionMappingRef": {
            "type": "string"
          },
          "XeroLineItemId": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "Budget": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `budget` record, from the published field contract (model `Budget`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "ApprovalStatus": {
            "type": "string"
          },
          "ApprovedAt": {
            "type": "string"
          },
          "ApprovedBy": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "IsActive": {
            "type": "boolean"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "Name": {
            "type": "string"
          },
          "PeriodMonths": {
            "type": "integer"
          },
          "RejectedReason": {
            "type": "string"
          },
          "ScenarioName": {
            "type": "string"
          },
          "StartMonth": {
            "type": "string"
          },
          "SubmittedAt": {
            "type": "string"
          },
          "SubmittedBy": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "BusinessOwner": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `businessOwner` record, from the published field contract (model `BusinessOwner`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "ChartOfAccountRefs": {
            "type": "array"
          },
          "CompanyName": {
            "type": "string"
          },
          "ContactDetails": {
            "type": "object"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "DefaultCapitalAccountRef": {
            "type": "string"
          },
          "DisplayName": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "OwnershipPercentage": {
            "type": "number"
          },
          "Tags": {
            "type": "array"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "UsePersonalCCForBusiness": {
            "type": "boolean"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "CashFlow": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `cashFlow` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "Cashbook": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `cashbook` record, from the published field contract (model `Cashbook`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CreatedBy": {
            "type": "string"
          },
          "CurrentBalance": {
            "type": "number"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "LastBalanceDate": {
            "type": "string",
            "readOnly": true
          },
          "Name": {
            "type": "string"
          },
          "TodayBalance": {
            "type": "number"
          },
          "Type": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "UpdatedBy": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "Class": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `class` record, from the published field contract (model `Class`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "ClassTrackingCategory": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "IsArchived": {
            "type": "boolean"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "TrackingSlot": {
            "type": "integer"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "WaveBusinessId": {
            "type": "string"
          },
          "WaveId": {
            "type": "string"
          },
          "WaveLinkedAt": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "Comment": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `comment` record, from the published field contract (model `Comment`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "ArchivedAt": {
            "type": "string"
          },
          "ArchivedBy": {
            "type": "string"
          },
          "Attachments": {
            "type": "object"
          },
          "Content": {
            "type": "string"
          },
          "ContentPlain": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CreatedByAvatar": {
            "type": "string"
          },
          "CreatedByEmail": {
            "type": "string"
          },
          "CreatedByName": {
            "type": "string"
          },
          "CreatedByUserId": {
            "type": "string"
          },
          "DocumentRefId": {
            "type": "string"
          },
          "DocumentType": {
            "type": "string"
          },
          "EditedAt": {
            "type": "string"
          },
          "ExpenseClaimRefId": {
            "type": "string"
          },
          "ExpenseReceiptRefId": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "IsEdited": {
            "type": "boolean"
          },
          "IsResolved": {
            "type": "boolean"
          },
          "Kind": {
            "type": "string"
          },
          "MentionedUserIds": {
            "type": "array"
          },
          "ParentCommentId": {
            "type": "string"
          },
          "PeriodEnd": {
            "type": "string"
          },
          "PeriodStart": {
            "type": "string"
          },
          "QuestionPriority": {
            "type": "string"
          },
          "QuestionStatus": {
            "type": "string"
          },
          "ReportRowKey": {
            "type": "string"
          },
          "ReportType": {
            "type": "string"
          },
          "ResolvedAt": {
            "type": "string"
          },
          "ResolvedByUserId": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "Customer": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `customer` record, from the published field contract (model `Customer`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "Attachments": {
            "type": "object"
          },
          "CategorizationRule": {
            "type": "string"
          },
          "Comment": {
            "type": "string"
          },
          "CompanyName": {
            "type": "string"
          },
          "ContactDetails": {
            "type": "object"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "Currency": {
            "type": "string"
          },
          "CustomFields": {
            "type": "object"
          },
          "CustomPaymentDays": {
            "type": "string"
          },
          "CustomerChartOfAccount": {
            "type": "array"
          },
          "CustomerClass": {
            "type": "array"
          },
          "CustomerLocation": {
            "type": "array"
          },
          "CustomerProject": {
            "type": "array"
          },
          "CustomerType": {
            "type": "string"
          },
          "DefaultDiscountSequence": {
            "type": "array"
          },
          "DefaultDiscountType": {
            "type": "string"
          },
          "DefaultDiscountValue": {
            "type": "number"
          },
          "DefaultExpenseAccountRef": {
            "type": "string"
          },
          "DefaultPaymentTerm": {
            "type": "string"
          },
          "DefaultSalesRepRefId": {
            "type": "string"
          },
          "DefaultTaxRef": {
            "type": "string"
          },
          "DefaultTcsRefId": {
            "type": "string"
          },
          "DefaultTdsRefId": {
            "type": "string"
          },
          "DisplayName": {
            "type": "string"
          },
          "Dnd": {
            "type": "boolean"
          },
          "DndSetAt": {
            "type": "string"
          },
          "DndSource": {
            "type": "string"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "FxSource": {
            "type": "string"
          },
          "GroupRef": {
            "type": "array"
          },
          "HboId": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "IsRedacted": {
            "type": "boolean"
          },
          "LastEditedSystem": {
            "type": "string"
          },
          "MigrationBatchId": {
            "type": "string"
          },
          "OdooId": {
            "type": "integer"
          },
          "OdooLinkedAt": {
            "type": "string"
          },
          "OdooModel": {
            "type": "string"
          },
          "OdooWriteDate": {
            "type": "string"
          },
          "OriginId": {
            "type": "string"
          },
          "OriginSystem": {
            "type": "string"
          },
          "PaymentNotes": {
            "type": "string"
          },
          "PreferredPaymentMethod": {
            "type": "string"
          },
          "PriceListRefId": {
            "type": "string"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "RedactedAt": {
            "type": "string"
          },
          "ShopifyCompanyId": {
            "type": "string"
          },
          "ShopifyCustomerId": {
            "type": "string"
          },
          "ShopifyLinkedAt": {
            "type": "string"
          },
          "ShopifyShop": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "SyncVersion": {
            "type": "integer"
          },
          "TallyDepth": {
            "type": "integer"
          },
          "TallyExtras": {
            "type": "object"
          },
          "TallyGroupPath": {
            "type": "string"
          },
          "TallyGuid": {
            "type": "string"
          },
          "TallyLedgerName": {
            "type": "string"
          },
          "TallyParentGroup": {
            "type": "string"
          },
          "TallyPrimaryGroup": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "WaveBusinessId": {
            "type": "string"
          },
          "WaveId": {
            "type": "string"
          },
          "WaveLinkedAt": {
            "type": "string"
          },
          "XeroId": {
            "type": "string"
          },
          "XeroLinkedAt": {
            "type": "string"
          },
          "XeroTenantId": {
            "type": "string"
          },
          "XeroUpdatedDateUTC": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "CustomerAddress": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `customerAddress` record, from the published field contract (model `CustomerAddress`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AddressType": {
            "type": "string"
          },
          "City": {
            "type": "string"
          },
          "Country": {
            "type": "string"
          },
          "CustomerId": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "LineOne": {
            "type": "string"
          },
          "LineTwo": {
            "type": "string"
          },
          "Province": {
            "type": "string"
          },
          "ZipCode": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "CustomerAdvance": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `customerAdvance` record, from the published field contract (model `CustomerAdvance`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AdvanceNumber": {
            "type": "string"
          },
          "AppliedAmount": {
            "type": "number"
          },
          "ApprovalRemarks": {
            "type": "string"
          },
          "ApprovalRequired": {
            "type": "boolean"
          },
          "ApprovedAt": {
            "type": "string"
          },
          "ApprovedBy": {
            "type": "string"
          },
          "Attachments": {
            "type": "object"
          },
          "BankAccountRefId": {
            "type": "string"
          },
          "ChequeDate": {
            "type": "string"
          },
          "ChequeNumber": {
            "type": "string"
          },
          "ClassComponentRef": {
            "type": "string"
          },
          "ClassRef": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CurrencyRef": {
            "type": "string"
          },
          "CustomerRefId": {
            "type": "string"
          },
          "DifferentialPercent": {
            "type": "number"
          },
          "EcommerceGSTIN": {
            "type": "string"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "FunctionalTotalAmount": {
            "type": "number"
          },
          "FxRateDate": {
            "type": "string"
          },
          "FxSource": {
            "type": "string"
          },
          "GSTCategory": {
            "type": "string"
          },
          "GSTTreatment": {
            "type": "string"
          },
          "IdempotencyKey": {
            "type": "string"
          },
          "InstrumentDate": {
            "type": "string"
          },
          "InstrumentNumber": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "IsTaxInclusive": {
            "type": "boolean"
          },
          "LiabilityAccountRefId": {
            "type": "string"
          },
          "LocationRef": {
            "type": "string"
          },
          "Memo": {
            "type": "string"
          },
          "Notes": {
            "type": "string"
          },
          "PartyGSTIN": {
            "type": "string"
          },
          "PartyStateCode": {
            "type": "string"
          },
          "PaymentRefId": {
            "type": "string"
          },
          "PlaceOfSupply": {
            "type": "string"
          },
          "PostedAt": {
            "type": "string"
          },
          "PostedBy": {
            "type": "string"
          },
          "PostingDate": {
            "type": "string"
          },
          "PrevYearCarryFwd": {
            "type": "number"
          },
          "ProjectRefId": {
            "type": "string"
          },
          "QuoteRefId": {
            "type": "string"
          },
          "ReceiptMethod": {
            "type": "string"
          },
          "ReceiptVoucherNumber": {
            "type": "string"
          },
          "ReceivedDate": {
            "type": "string",
            "readOnly": true
          },
          "RecurringInvoiceTemplateRefId": {
            "type": "string"
          },
          "Reference": {
            "type": "string"
          },
          "SalesOrderRefId": {
            "type": "string"
          },
          "ScheduleType": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "SubmittedAt": {
            "type": "string"
          },
          "SubmittedBy": {
            "type": "string"
          },
          "SupplyType": {
            "type": "string"
          },
          "TCSAmount": {
            "type": "number"
          },
          "TCSApplicable": {
            "type": "boolean"
          },
          "TCSRate": {
            "type": "number"
          },
          "TaxAmount": {
            "type": "number"
          },
          "TaxRefId": {
            "type": "string"
          },
          "TaxType": {
            "type": "string"
          },
          "TaxableAmount": {
            "type": "number"
          },
          "TdsAmount": {
            "type": "number"
          },
          "TdsBaseAmount": {
            "type": "number"
          },
          "TdsRate": {
            "type": "number"
          },
          "TdsRefId": {
            "type": "string"
          },
          "TotalAmount": {
            "type": "number"
          },
          "TransactionRefId": {
            "type": "string"
          },
          "UnappliedAmount": {
            "type": "number"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "CustomerAdvanceApplication": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `customerAdvanceApplication` record, from the published field contract (model `CustomerAdvanceApplication`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AdvanceId": {
            "type": "string"
          },
          "Amount": {
            "type": "number"
          },
          "ApplicationExchangeRate": {
            "type": "number"
          },
          "AppliedDate": {
            "type": "string",
            "readOnly": true
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "FxGainLossAmount": {
            "type": "number"
          },
          "FxGainLossJournalId": {
            "type": "string"
          },
          "IdempotencyKey": {
            "type": "string"
          },
          "InvoiceRefId": {
            "type": "string"
          },
          "JournalId": {
            "type": "string"
          },
          "PaymentRefId": {
            "type": "string"
          },
          "ScheduleId": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "CustomerAdvanceRecurringLink": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `customerAdvanceRecurringLink` record, from the published field contract (model `CustomerAdvanceRecurringLink`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AdvanceId": {
            "type": "string"
          },
          "AutoApplyPolicy": {
            "type": "integer"
          },
          "CarryForward": {
            "type": "integer"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "EffectiveFrom": {
            "type": "string"
          },
          "EffectiveTo": {
            "type": "string"
          },
          "FixedAmountPerCycle": {
            "type": "number"
          },
          "MaxPerCycleCap": {
            "type": "number"
          },
          "MinPerCycleFloor": {
            "type": "number"
          },
          "PercentOfInvoice": {
            "type": "number"
          },
          "Priority": {
            "type": "integer"
          },
          "RecurringInvoiceTemplateRefId": {
            "type": "string"
          },
          "Rounding": {
            "type": "integer"
          },
          "StopWhenFullyAdjusted": {
            "type": "boolean"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "CustomerAdvanceRefund": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `customerAdvanceRefund` record, from the published field contract (model `CustomerAdvanceRefund`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AdvanceId": {
            "type": "string"
          },
          "Amount": {
            "type": "number"
          },
          "CGSTReversal": {
            "type": "number"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "GSTReversalAmount": {
            "type": "number"
          },
          "IGSTReversal": {
            "type": "number"
          },
          "IdempotencyKey": {
            "type": "string"
          },
          "JournalId": {
            "type": "string"
          },
          "PaymentRefId": {
            "type": "string"
          },
          "Reason": {
            "type": "string"
          },
          "RefundDate": {
            "type": "string",
            "readOnly": true
          },
          "RefundVoucherNumber": {
            "type": "string"
          },
          "SGSTReversal": {
            "type": "number"
          },
          "Status": {
            "type": "string"
          },
          "TransactionRefId": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "CustomerAdvanceSchedule": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `customerAdvanceSchedule` record, from the published field contract (model `CustomerAdvanceSchedule`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AdvanceId": {
            "type": "string"
          },
          "AppliedAmount": {
            "type": "number"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "InvoiceRefId": {
            "type": "string"
          },
          "IsAdjusted": {
            "type": "boolean"
          },
          "MilestoneRefId": {
            "type": "string"
          },
          "PaymentRefId": {
            "type": "string"
          },
          "PeriodStart": {
            "type": "string"
          },
          "ScheduledAmount": {
            "type": "number"
          },
          "Status": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "CustomerBalance": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `customerBalance` record, from the published field contract (model `CustomerBalance`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "Amount": {
            "type": "number"
          },
          "AsOfDate": {
            "type": "string"
          },
          "CurrencyRef": {
            "type": "string"
          },
          "CustomerId": {
            "type": "string"
          },
          "FunctionalAmount": {
            "type": "number"
          },
          "Type": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "CustomerContactPersons": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `customerContactPersons` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "CustomerCreditCard": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `customerCreditCard` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "CustomerDebitCard": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `customerDebitCard` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "CustomerGroup": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `customerGroup` record, from the published field contract (model `CustomerGroup`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "IsArchived": {
            "type": "boolean"
          },
          "Name": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "DeliveryChallan": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `deliveryChallan` record, from the published field contract (model `DeliveryChallan`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AWBNumber": {
            "type": "string"
          },
          "Attachments": {
            "type": "object"
          },
          "BackorderStatus": {
            "type": "string"
          },
          "CODAmount": {
            "type": "number"
          },
          "ChallanNumber": {
            "type": "string"
          },
          "Comment": {
            "type": "string"
          },
          "ConsigneeGSTIN": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CrossDockOrderRefId": {
            "type": "string"
          },
          "Currency": {
            "type": "string"
          },
          "CustomerRef": {
            "type": "string"
          },
          "DeliveryDate": {
            "type": "string"
          },
          "DeliveryStatus": {
            "type": "string"
          },
          "DeliveryType": {
            "type": "string"
          },
          "DispatchMethod": {
            "type": "string"
          },
          "EwayBillRequired": {
            "type": "boolean"
          },
          "EwbGeneratedAt": {
            "type": "string"
          },
          "EwbNo": {
            "type": "string"
          },
          "EwbRefId": {
            "type": "string"
          },
          "EwbStatus": {
            "type": "string"
          },
          "EwbValidUpto": {
            "type": "string"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "ExcludeFromEwb": {
            "type": "boolean"
          },
          "ExpectedDeliveryDate": {
            "type": "string"
          },
          "FinancialYear": {
            "type": "string"
          },
          "FxSource": {
            "type": "string"
          },
          "InvoiceRefId": {
            "type": "string"
          },
          "InvoicingStatus": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "IssuedDate": {
            "type": "string",
            "readOnly": true
          },
          "LabelUrl": {
            "type": "string"
          },
          "LocationRefId": {
            "type": "string"
          },
          "MasterDiscountRef": {
            "type": "string"
          },
          "PackageBreadthCm": {
            "type": "number"
          },
          "PackageHeightCm": {
            "type": "number"
          },
          "PackageLengthCm": {
            "type": "number"
          },
          "PackageWeightKg": {
            "type": "number"
          },
          "PackingOrderRefId": {
            "type": "string"
          },
          "PickupScheduledDate": {
            "type": "string"
          },
          "PrintStatus": {
            "type": "string"
          },
          "Priority": {
            "type": "string"
          },
          "QuantityShipped": {
            "type": "number"
          },
          "QuoteRefId": {
            "type": "string"
          },
          "Reference": {
            "type": "string"
          },
          "SalesOrderRefId": {
            "type": "string"
          },
          "ScheduledDate": {
            "type": "string"
          },
          "SellerGSTIN": {
            "type": "string"
          },
          "ShiprocketOrderId": {
            "type": "string"
          },
          "ShiprocketShipmentId": {
            "type": "string"
          },
          "ShiprocketShipmentRefId": {
            "type": "string"
          },
          "ShopifyFulfillmentId": {
            "type": "string"
          },
          "ShopifyLinkedAt": {
            "type": "string"
          },
          "ShopifyShop": {
            "type": "string"
          },
          "SrCourierId": {
            "type": "string"
          },
          "StateOfOrigin": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "TallyGuid": {
            "type": "string"
          },
          "TaxType": {
            "type": "string"
          },
          "TermsAndConditions": {
            "type": "object"
          },
          "TotalInvoicedAmount": {
            "type": "number"
          },
          "TotalPayableAmount": {
            "type": "number"
          },
          "TotalQuantity": {
            "type": "number"
          },
          "TotalTaxAmount": {
            "type": "number"
          },
          "TotalTaxableAmount": {
            "type": "number"
          },
          "TrackingNumber": {
            "type": "string"
          },
          "TransportMode": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "VehicleNumber": {
            "type": "string"
          },
          "VehicleType": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "DeliveryChallanAddress": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `deliveryChallanAddress` record, from the published field contract (model `DeliveryChallanAddress`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "City": {
            "type": "string"
          },
          "DeliveryChallanId": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "LineOne": {
            "type": "string"
          },
          "LineTwo": {
            "type": "string"
          },
          "Province": {
            "type": "string"
          },
          "Type": {
            "type": "string"
          },
          "ZipCode": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "DeliveryChallanLine": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `deliveryChallanLine` record, from the published field contract (model `DeliveryChallanLine`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AccountHeadRef": {
            "type": "string"
          },
          "Amount": {
            "type": "number"
          },
          "BatchNumber": {
            "type": "string"
          },
          "DeliveryChallanId": {
            "type": "string"
          },
          "Description": {
            "type": "string"
          },
          "DiscountAmount": {
            "type": "number"
          },
          "DiscountD2Amount": {
            "type": "number"
          },
          "DiscountD2Percentage": {
            "type": "number"
          },
          "DiscountD3Amount": {
            "type": "number"
          },
          "DiscountD3Percentage": {
            "type": "number"
          },
          "DiscountPercentage": {
            "type": "number"
          },
          "FEFOLotAssignments": {
            "type": "object"
          },
          "FunctionalAmount": {
            "type": "number"
          },
          "HSN_SAC": {
            "type": "string"
          },
          "IsDiscountBeforeTax": {
            "type": "boolean"
          },
          "ItemRef": {
            "type": "string"
          },
          "Quantity": {
            "type": "number"
          },
          "Rate": {
            "type": "number"
          },
          "ShopifyFulfillmentLineId": {
            "type": "string"
          },
          "TaxAmount": {
            "type": "number"
          },
          "TaxRefId": {
            "type": "string"
          },
          "TaxableAmount": {
            "type": "number"
          },
          "UnitRefId": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "Employee": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `employee` record, from the published field contract (model `Employee`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AdvanceAccountId": {
            "type": "string"
          },
          "ArchivedAt": {
            "type": "string"
          },
          "BankDetails": {
            "type": "object"
          },
          "BaseSalary": {
            "type": "number"
          },
          "ContactDetails": {
            "type": "object"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CreatedById": {
            "type": "string"
          },
          "DepartmentId": {
            "type": "string"
          },
          "DesignationId": {
            "type": "string"
          },
          "DisplayName": {
            "type": "string"
          },
          "EmployeeStatus": {
            "type": "string"
          },
          "EmploymentType": {
            "type": "string"
          },
          "ExpenseLimit": {
            "type": "number"
          },
          "FirstName": {
            "type": "string"
          },
          "GustoCompanyId": {
            "type": "string"
          },
          "GustoEmployeeId": {
            "type": "string"
          },
          "GustoLinkedAt": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "IsExcludedEmployee": {
            "type": "boolean"
          },
          "IsPayrollEnabled": {
            "type": "boolean"
          },
          "IsPersonWithDisability": {
            "type": "boolean"
          },
          "IsReimbursementEligible": {
            "type": "boolean"
          },
          "JoiningDate": {
            "type": "string"
          },
          "LastName": {
            "type": "string"
          },
          "MiddleName": {
            "type": "string"
          },
          "PayFrequency": {
            "type": "string"
          },
          "PayrollExpenseAccountId": {
            "type": "string"
          },
          "PayrollPayableAccountId": {
            "type": "string"
          },
          "PersonalNote": {
            "type": "string"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "ReimbursementAccountId": {
            "type": "string"
          },
          "SalaryCurrency": {
            "type": "string"
          },
          "TaxDetails": {
            "type": "object"
          },
          "TerminationDate": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "UpdatedById": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "EmployeeAddress": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `employeeAddress` record, from the published field contract (model `EmployeeAddress`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AddressType": {
            "type": "string"
          },
          "City": {
            "type": "string"
          },
          "Country": {
            "type": "string"
          },
          "EmployeeId": {
            "type": "string"
          },
          "LineOne": {
            "type": "string"
          },
          "LineTwo": {
            "type": "string"
          },
          "Province": {
            "type": "string"
          },
          "ZipCode": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "EmployeeCreditCard": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `employeeCreditCard` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "EmployeeDebitCard": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `employeeDebitCard` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "ExpenseClaim": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `expenseClaim` record, from the published field contract (model `ExpenseClaim`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AppliedWorkflowId": {
            "type": "string"
          },
          "ApprovedAmount": {
            "type": "number"
          },
          "ApprovedAt": {
            "type": "string"
          },
          "ApprovedByRefId": {
            "type": "string"
          },
          "ApprovedReceiptCount": {
            "type": "integer"
          },
          "AttachmentsCount": {
            "type": "integer"
          },
          "ClaimName": {
            "type": "string"
          },
          "ClaimNo": {
            "type": "string"
          },
          "ClaimType": {
            "type": "string"
          },
          "CompanyMoneyAmount": {
            "type": "number"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CurrencyRef": {
            "type": "string"
          },
          "Description": {
            "type": "string"
          },
          "DirectExpenseAmount": {
            "type": "number"
          },
          "EmployeeRefId": {
            "type": "string"
          },
          "EndDate": {
            "type": "string"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "FxRateDate": {
            "type": "string"
          },
          "FxSource": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "Notes": {
            "type": "string"
          },
          "OriginalTotals": {
            "type": "object"
          },
          "PaidAmount": {
            "type": "number"
          },
          "PaidAt": {
            "type": "string"
          },
          "PaidByRefId": {
            "type": "string"
          },
          "PaymentMethod": {
            "type": "string"
          },
          "PendingReceiptCount": {
            "type": "integer"
          },
          "PersonalMoneyAmount": {
            "type": "number"
          },
          "PublishedAt": {
            "type": "string"
          },
          "ReimbursableAmount": {
            "type": "number"
          },
          "RejectedAmount": {
            "type": "number"
          },
          "RejectedReceiptCount": {
            "type": "integer"
          },
          "StartDate": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "Subtotal": {
            "type": "number"
          },
          "TotalAmount": {
            "type": "number"
          },
          "TotalCGST": {
            "type": "number"
          },
          "TotalCess": {
            "type": "number"
          },
          "TotalCessNonAdvalorem": {
            "type": "number"
          },
          "TotalDiscount": {
            "type": "number"
          },
          "TotalIGST": {
            "type": "number"
          },
          "TotalSGST": {
            "type": "number"
          },
          "TotalTax": {
            "type": "number"
          },
          "TotalUTGST": {
            "type": "number"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "VoidReason": {
            "type": "string"
          },
          "VoidedAt": {
            "type": "string"
          },
          "VoidedBy": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "ExpenseReceipt": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `expenseReceipt` record, from the published field contract (model `ExpenseReceipt`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AccountHeadRef": {
            "type": "string"
          },
          "Amount": {
            "type": "number"
          },
          "ApprovalStatus": {
            "type": "string"
          },
          "ApprovedAmount": {
            "type": "number"
          },
          "ApprovedAt": {
            "type": "string"
          },
          "ApprovedBy": {
            "type": "string"
          },
          "AttachmentUrls": {
            "type": "object"
          },
          "CGSTAmount": {
            "type": "number"
          },
          "CGSTRate": {
            "type": "number"
          },
          "Category": {
            "type": "string"
          },
          "CessAmount": {
            "type": "number"
          },
          "CessNonAdvaloremAmount": {
            "type": "number"
          },
          "ClaimId": {
            "type": "string"
          },
          "ClassComponentRef1": {
            "type": "string"
          },
          "ClassComponentRef2": {
            "type": "string"
          },
          "ClassComponentRef3": {
            "type": "string"
          },
          "ClassComponentRef4": {
            "type": "string"
          },
          "ClassRef1": {
            "type": "string"
          },
          "ClassRef2": {
            "type": "string"
          },
          "ClassRef3": {
            "type": "string"
          },
          "ClassRef4": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CurrencyRefId": {
            "type": "string"
          },
          "CustomerRefId": {
            "type": "string"
          },
          "CustomerType": {
            "type": "string"
          },
          "Date": {
            "type": "string"
          },
          "Description": {
            "type": "string"
          },
          "DetailsVersion": {
            "type": "integer"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "ExpenseDetails": {
            "type": "object"
          },
          "ExpenseNumber": {
            "type": "string"
          },
          "ExpenseType": {
            "type": "string"
          },
          "FxSource": {
            "type": "string"
          },
          "GSTCategory": {
            "type": "string"
          },
          "GSTRate": {
            "type": "number"
          },
          "HSNCode": {
            "type": "string"
          },
          "IGSTAmount": {
            "type": "number"
          },
          "IGSTRate": {
            "type": "number"
          },
          "InvoiceRefId": {
            "type": "string"
          },
          "InvoicedOn": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "IsClaimed": {
            "type": "boolean"
          },
          "IsITCEligible": {
            "type": "boolean"
          },
          "IsPartyGSTRegistered": {
            "type": "boolean"
          },
          "IsReverseCharge": {
            "type": "boolean"
          },
          "Label": {
            "type": "string"
          },
          "LocationRef": {
            "type": "string"
          },
          "Notes": {
            "type": "string"
          },
          "PaidAt": {
            "type": "string"
          },
          "PartyGSTIN": {
            "type": "string"
          },
          "PartyStateCode": {
            "type": "string"
          },
          "PayeeRef": {
            "type": "string"
          },
          "PayeeType": {
            "type": "string"
          },
          "PaymentAccountRef": {
            "type": "string"
          },
          "PaymentType": {
            "type": "string"
          },
          "PlaceOfSupply": {
            "type": "string"
          },
          "ProjectRef": {
            "type": "string"
          },
          "RejectedAt": {
            "type": "string"
          },
          "RejectionReason": {
            "type": "string"
          },
          "SGSTAmount": {
            "type": "number"
          },
          "SGSTRate": {
            "type": "number"
          },
          "Source": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "SubmittedBy": {
            "type": "string"
          },
          "SupplyType": {
            "type": "string"
          },
          "TaxAmount": {
            "type": "number"
          },
          "TaxClassification": {
            "type": "string"
          },
          "TaxRefId": {
            "type": "string"
          },
          "TaxType": {
            "type": "string"
          },
          "UTGSTAmount": {
            "type": "number"
          },
          "UTGSTRate": {
            "type": "number"
          },
          "UnitAmount": {
            "type": "number"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "FixedAsset": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `fixedAsset` record, from the published field contract (model `FixedAsset`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AssetAccountId": {
            "type": "string"
          },
          "AssetCode": {
            "type": "string"
          },
          "AssetGroupId": {
            "type": "string"
          },
          "BarcodeId": {
            "type": "string"
          },
          "BookAccumulatedDepreciation": {
            "type": "number"
          },
          "BookDepreciationFrequency": {
            "type": "string"
          },
          "BookDepreciationMethod": {
            "type": "string"
          },
          "BookNetValue": {
            "type": "number"
          },
          "CapitalizationDate": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CreatedBy": {
            "type": "string"
          },
          "CurrencyRef": {
            "type": "string"
          },
          "DepreciationStartDate": {
            "type": "string"
          },
          "Description": {
            "type": "string"
          },
          "DisposalDate": {
            "type": "string"
          },
          "InsuranceExpiryDate": {
            "type": "string"
          },
          "InsurancePolicyNumber": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "LastDepreciationDate": {
            "type": "string"
          },
          "LastDepreciationPeriod": {
            "type": "string"
          },
          "LastDepreciationStatus": {
            "type": "string"
          },
          "LastPostedPeriod": {
            "type": "string"
          },
          "LastScannedDate": {
            "type": "string"
          },
          "LocationId": {
            "type": "string"
          },
          "Name": {
            "type": "string"
          },
          "NextDepreciationDue": {
            "type": "string"
          },
          "Notes": {
            "type": "string"
          },
          "PurchaseCost": {
            "type": "number"
          },
          "PurchaseDate": {
            "type": "string"
          },
          "QRCodeId": {
            "type": "string"
          },
          "ResidualValue": {
            "type": "number"
          },
          "Status": {
            "type": "string"
          },
          "TaxAccumulatedDepreciation": {
            "type": "number"
          },
          "TaxDepreciationFrequency": {
            "type": "string"
          },
          "TaxDepreciationMethod": {
            "type": "string"
          },
          "TaxNetValue": {
            "type": "number"
          },
          "TotalPeriodsCalculated": {
            "type": "integer"
          },
          "TotalPeriodsPosted": {
            "type": "integer"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "UpdatedBy": {
            "type": "string"
          },
          "UsefulLifeMonths": {
            "type": "integer"
          },
          "VendorId": {
            "type": "string"
          },
          "WarrantyExpiryDate": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "GeneralLedger": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `generalLedger` record, from the published field contract (model `GeneralLedger`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AccountName": {
            "type": "string"
          },
          "AccountRef": {
            "type": "string"
          },
          "Count": {
            "type": "integer"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "ImportedFrom": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "Name": {
            "type": "string"
          },
          "PayeeRef": {
            "type": "string"
          },
          "PayeeType": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "GoodReceiptNoteLine": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `goodReceiptNoteLine` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "GoodReceiptNotes": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `goodReceiptNotes` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "GrossProfit": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `grossProfit` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "Invoice": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `invoice` record, from the published field contract (model `Invoice`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "ArchivedAt": {
            "type": "string"
          },
          "ArchivedBy": {
            "type": "string"
          },
          "Attachments": {
            "type": "object"
          },
          "BrandingThemeId": {
            "type": "string"
          },
          "ClassRefId": {
            "type": "string"
          },
          "Comment": {
            "type": "string"
          },
          "CounterpartyEntityRefId": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "Currency": {
            "type": "string"
          },
          "CustomFields": {
            "type": "object"
          },
          "DeliveryChallanRefId": {
            "type": "string"
          },
          "DifferentialPercent": {
            "type": "number"
          },
          "DueDate": {
            "type": "string"
          },
          "EInvoiceCancelledAt": {
            "type": "string"
          },
          "EInvoiceGeneratedAt": {
            "type": "string"
          },
          "EInvoiceIRN": {
            "type": "string"
          },
          "EInvoiceId": {
            "type": "string"
          },
          "EInvoiceStatus": {
            "type": "string"
          },
          "EcommerceGSTIN": {
            "type": "string"
          },
          "EfakturEmittedAt": {
            "type": "string"
          },
          "EfakturFgPengganti": {
            "type": "string"
          },
          "EfakturKdJenisTransaksi": {
            "type": "string"
          },
          "EfakturNsfp": {
            "type": "string"
          },
          "EfakturReplacedNsfp": {
            "type": "string"
          },
          "EfakturSubmissionStatus": {
            "type": "string"
          },
          "EwayBillRequired": {
            "type": "boolean"
          },
          "EwbGeneratedAt": {
            "type": "string"
          },
          "EwbNo": {
            "type": "string"
          },
          "EwbRefId": {
            "type": "string"
          },
          "EwbStatus": {
            "type": "string"
          },
          "EwbValidUpto": {
            "type": "string"
          },
          "ExchangeGainLoss": {
            "type": "number"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "ExcludeFromEwb": {
            "type": "boolean"
          },
          "ExpectedPaymentDate": {
            "type": "string"
          },
          "FinancialYear": {
            "type": "string"
          },
          "FirstViewedAt": {
            "type": "string"
          },
          "FunctionalTotalPayableAmount": {
            "type": "number"
          },
          "FxRateDate": {
            "type": "string"
          },
          "FxSource": {
            "type": "string"
          },
          "GSTCategory": {
            "type": "string"
          },
          "InvoiceClass": {
            "type": "string"
          },
          "InvoiceNumber": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "IsConversion": {
            "type": "boolean"
          },
          "IsEcGoodsMovement": {
            "type": "boolean"
          },
          "IsInterCompany": {
            "type": "boolean"
          },
          "IsPartyGSTRegistered": {
            "type": "boolean"
          },
          "IsReverseCharge": {
            "type": "boolean"
          },
          "IsShippingSameAsBilling": {
            "type": "boolean"
          },
          "IssuedDate": {
            "type": "string",
            "readOnly": true
          },
          "LastEditedSystem": {
            "type": "string"
          },
          "LastViewedAt": {
            "type": "string"
          },
          "LocationRefId": {
            "type": "string"
          },
          "MarketplaceFacilitator": {
            "type": "boolean"
          },
          "MasterDiscountRef": {
            "type": "string"
          },
          "MerchantOfRecord": {
            "type": "boolean"
          },
          "MigrationBatchId": {
            "type": "string"
          },
          "OdooId": {
            "type": "integer"
          },
          "OdooLinkedAt": {
            "type": "string"
          },
          "OdooModel": {
            "type": "string"
          },
          "OdooWriteDate": {
            "type": "string"
          },
          "OriginId": {
            "type": "string"
          },
          "OriginSystem": {
            "type": "string"
          },
          "OriginalTotals": {
            "type": "object"
          },
          "PartyGSTIN": {
            "type": "string"
          },
          "PartyStateCode": {
            "type": "string"
          },
          "PayeeRef": {
            "type": "string"
          },
          "PayeeType": {
            "type": "string"
          },
          "PlaceOfSupply": {
            "type": "string"
          },
          "PortCode": {
            "type": "string"
          },
          "ProjectRefId": {
            "type": "string"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "QuoteRefId": {
            "type": "string"
          },
          "RecognitionMethod": {
            "type": "string"
          },
          "ReferenceNumber": {
            "type": "string"
          },
          "RestoredAt": {
            "type": "string"
          },
          "RestoredBy": {
            "type": "string"
          },
          "RoundOff": {
            "type": "number"
          },
          "SalesOrderRefId": {
            "type": "string"
          },
          "SalesRepName": {
            "type": "string"
          },
          "SalesRepRefId": {
            "type": "string"
          },
          "SelectedBillingAddressId": {
            "type": "string"
          },
          "SelectedShippingAddressId": {
            "type": "string"
          },
          "SellerGSTIN": {
            "type": "string"
          },
          "Sent": {
            "type": "boolean"
          },
          "ServiceEndDate": {
            "type": "string"
          },
          "ServiceStartDate": {
            "type": "string"
          },
          "ShipToRedacted": {
            "type": "boolean"
          },
          "ShipToRedactedAt": {
            "type": "string"
          },
          "ShippingBillDate": {
            "type": "string"
          },
          "ShippingBillNo": {
            "type": "string"
          },
          "ShopifyLinkedAt": {
            "type": "string"
          },
          "ShopifyOrderId": {
            "type": "string"
          },
          "ShopifyOrderName": {
            "type": "string"
          },
          "ShopifyShop": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "SupplyType": {
            "type": "string"
          },
          "SyncVersion": {
            "type": "integer"
          },
          "SyncedTo": {
            "type": "string"
          },
          "SyncedToTally": {
            "type": "boolean"
          },
          "TallyExtras": {
            "type": "object"
          },
          "TallyGuid": {
            "type": "string"
          },
          "TallyNumber": {
            "type": "string"
          },
          "TallyVoucherSeries": {
            "type": "string"
          },
          "TallyVoucherType": {
            "type": "string"
          },
          "TaxRef": {
            "type": "string"
          },
          "TaxType": {
            "type": "string"
          },
          "TcsAmount": {
            "type": "number"
          },
          "TcsBaseAmount": {
            "type": "number"
          },
          "TcsRate": {
            "type": "number"
          },
          "TcsRefId": {
            "type": "string"
          },
          "TdsAmount": {
            "type": "number"
          },
          "TdsBaseAmount": {
            "type": "number"
          },
          "TdsRate": {
            "type": "number"
          },
          "TdsRefId": {
            "type": "string"
          },
          "TermsAndConditions": {
            "type": "object"
          },
          "TotalCGST": {
            "type": "number"
          },
          "TotalCess": {
            "type": "number"
          },
          "TotalCessNonAdvalorem": {
            "type": "number"
          },
          "TotalDiscountAmount": {
            "type": "number"
          },
          "TotalIGST": {
            "type": "number"
          },
          "TotalLabourAmount": {
            "type": "number"
          },
          "TotalPayableAmount": {
            "type": "number"
          },
          "TotalSGST": {
            "type": "number"
          },
          "TotalSupplyAmount": {
            "type": "number"
          },
          "TotalTaxAmount": {
            "type": "number"
          },
          "TotalTaxableAmount": {
            "type": "number"
          },
          "TotalUTGST": {
            "type": "number"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "ViewCount": {
            "type": "integer"
          },
          "VoidReason": {
            "type": "string"
          },
          "VoidedAt": {
            "type": "string"
          },
          "VoidedBy": {
            "type": "string"
          },
          "WaveBusinessId": {
            "type": "string"
          },
          "WaveId": {
            "type": "string"
          },
          "WaveLinkedAt": {
            "type": "string"
          },
          "XeroId": {
            "type": "string"
          },
          "XeroLinkedAt": {
            "type": "string"
          },
          "XeroTenantId": {
            "type": "string"
          },
          "XeroUpdatedDateUTC": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "InvoiceAddress": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `invoiceAddress` record, from the published field contract (model `InvoiceAddress`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "City": {
            "type": "string"
          },
          "InvoiceId": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "LineOne": {
            "type": "string"
          },
          "LineTwo": {
            "type": "string"
          },
          "Province": {
            "type": "string"
          },
          "Type": {
            "type": "string"
          },
          "ZipCode": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "InvoiceLine": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `invoiceLine` record, from the published field contract (model `InvoiceLine`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AccountHeadRef": {
            "type": "string"
          },
          "Amount": {
            "type": "number"
          },
          "BatchNumber": {
            "type": "string"
          },
          "BrandRefId": {
            "type": "string"
          },
          "CGSTAmount": {
            "type": "number"
          },
          "CGSTRate": {
            "type": "number"
          },
          "CessAmount": {
            "type": "number"
          },
          "CessNonAdvaloremAmount": {
            "type": "number"
          },
          "CessNonAdvaloremRate": {
            "type": "number"
          },
          "CessRate": {
            "type": "number"
          },
          "ClassComponentRef1": {
            "type": "string"
          },
          "ClassComponentRef2": {
            "type": "string"
          },
          "ClassComponentRef3": {
            "type": "string"
          },
          "ClassComponentRef4": {
            "type": "string"
          },
          "ClassRef1": {
            "type": "string"
          },
          "ClassRef2": {
            "type": "string"
          },
          "ClassRef3": {
            "type": "string"
          },
          "ClassRef4": {
            "type": "string"
          },
          "CostCodeRefId": {
            "type": "string"
          },
          "Currency": {
            "type": "string"
          },
          "DepartmentRefId": {
            "type": "string"
          },
          "Description": {
            "type": "string"
          },
          "DiscountAmount": {
            "type": "number"
          },
          "DiscountD2Amount": {
            "type": "number"
          },
          "DiscountD2Percentage": {
            "type": "number"
          },
          "DiscountD3Amount": {
            "type": "number"
          },
          "DiscountD3Percentage": {
            "type": "number"
          },
          "DiscountPercentage": {
            "type": "number"
          },
          "ExpiryDate": {
            "type": "string"
          },
          "FreeQuantity": {
            "type": "number"
          },
          "FunctionalAmount": {
            "type": "number"
          },
          "GSTRate": {
            "type": "number"
          },
          "HSNCode": {
            "type": "string"
          },
          "HSN_SAC": {
            "type": "string"
          },
          "IGSTAmount": {
            "type": "number"
          },
          "IGSTRate": {
            "type": "number"
          },
          "InvoiceId": {
            "type": "string"
          },
          "IsDiscountBeforeTax": {
            "type": "boolean"
          },
          "ItemRef": {
            "type": "string"
          },
          "LabourAccountHeadRef": {
            "type": "string"
          },
          "LabourAmount": {
            "type": "number"
          },
          "LabourHSN_SAC": {
            "type": "string"
          },
          "LabourRate": {
            "type": "number"
          },
          "LabourTaxAmount": {
            "type": "number"
          },
          "LabourTaxRate": {
            "type": "number"
          },
          "LabourTaxRefId": {
            "type": "string"
          },
          "LineExchangeRate": {
            "type": "number"
          },
          "LocationRefId": {
            "type": "string"
          },
          "LotNumber": {
            "type": "string"
          },
          "ManufacturingDate": {
            "type": "string"
          },
          "MappedAccountSource": {
            "type": "string"
          },
          "MappedItemId": {
            "type": "string"
          },
          "MappedItemName": {
            "type": "string"
          },
          "MappedItemSource": {
            "type": "string"
          },
          "MarginValue": {
            "type": "number"
          },
          "NCCDAmount": {
            "type": "number"
          },
          "NCCDRate": {
            "type": "number"
          },
          "OcrCreateVendorDescriptionMapping": {
            "type": "boolean"
          },
          "PayeeRef": {
            "type": "string"
          },
          "PayeeType": {
            "type": "string"
          },
          "ProjectRefId": {
            "type": "string"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "Quantity": {
            "type": "number"
          },
          "Rate": {
            "type": "number"
          },
          "ReverseCharge": {
            "type": "boolean"
          },
          "SGSTAmount": {
            "type": "number"
          },
          "SGSTRate": {
            "type": "number"
          },
          "SerialNumbers": {
            "type": "array"
          },
          "ShopifyLineId": {
            "type": "string"
          },
          "ShopifyVariantId": {
            "type": "string"
          },
          "SourceDeliveryChallanId": {
            "type": "string"
          },
          "SourceDeliveryChallanLineId": {
            "type": "string"
          },
          "SourceDeliveryChallanNumber": {
            "type": "string"
          },
          "SourceSalesOrderLineId": {
            "type": "string"
          },
          "StateCessAmount": {
            "type": "number"
          },
          "StateCessNonAdvaloremAmount": {
            "type": "number"
          },
          "StateCessNonAdvaloremRate": {
            "type": "number"
          },
          "StateCessRate": {
            "type": "number"
          },
          "SupplyAmount": {
            "type": "number"
          },
          "TaxAmount": {
            "type": "number"
          },
          "TaxClassification": {
            "type": "string"
          },
          "TaxRate": {
            "type": "number"
          },
          "TaxRefId": {
            "type": "string"
          },
          "TaxUnconfirmed": {
            "type": "boolean"
          },
          "TaxableAmount": {
            "type": "number"
          },
          "UTGSTAmount": {
            "type": "number"
          },
          "UTGSTRate": {
            "type": "number"
          },
          "UnitRefId": {
            "type": "string"
          },
          "VendorDescriptionMappingRef": {
            "type": "string"
          },
          "XeroLineItemId": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "InvoiceLinkedBill": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `invoiceLinkedBill` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "Item": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `item` record, from the published field contract (model `Item`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AllergenFlags": {
            "type": "array"
          },
          "AssetAccountRefId": {
            "type": "string"
          },
          "Attachments": {
            "type": "object"
          },
          "AverageUnitCost": {
            "type": "number"
          },
          "Barcode": {
            "type": "string"
          },
          "BaseUnitRefId": {
            "type": "string"
          },
          "BrandRefId": {
            "type": "string"
          },
          "Category": {
            "type": "string"
          },
          "ContainsAllergens": {
            "type": "boolean"
          },
          "ConversionFactor": {
            "type": "number"
          },
          "CountryOfOrigin": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CurrencyRef": {
            "type": "string"
          },
          "CurrentStock": {
            "type": "number"
          },
          "CustomFields": {
            "type": "object"
          },
          "DefaultDropShipVendorId": {
            "type": "string"
          },
          "DefaultPurchaseTaxRefId": {
            "type": "string"
          },
          "DefaultSalesTaxRefId": {
            "type": "string"
          },
          "Description": {
            "type": "string"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "ExpenseAccountRefId": {
            "type": "string"
          },
          "FoodType": {
            "type": "string"
          },
          "FxSource": {
            "type": "string"
          },
          "Group": {
            "type": "string"
          },
          "HSN_SAC": {
            "type": "string"
          },
          "HasExpiry": {
            "type": "boolean"
          },
          "HazardClass": {
            "type": "array"
          },
          "HazardPictograms": {
            "type": "array"
          },
          "ImageUrl": {
            "type": "string"
          },
          "IncomeAccountRefId": {
            "type": "string"
          },
          "InvStartDate": {
            "type": "string"
          },
          "IsActive": {
            "type": "boolean"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "IsDropShipAllowed": {
            "type": "boolean"
          },
          "IsFavorite": {
            "type": "boolean"
          },
          "ItemCode": {
            "type": "string"
          },
          "ItemSubType": {
            "type": "string"
          },
          "KotStation": {
            "type": "string"
          },
          "LastEditedSystem": {
            "type": "string"
          },
          "LeadTimeDays": {
            "type": "integer"
          },
          "LocationRefId": {
            "type": "string"
          },
          "MSDSAttachmentRefId": {
            "type": "string"
          },
          "MSDSValidUntil": {
            "type": "string"
          },
          "MSDSVersion": {
            "type": "string"
          },
          "MarketplaceId": {
            "type": "string"
          },
          "MaxOverridePct": {
            "type": "number"
          },
          "MfgLeadTimeDays": {
            "type": "integer"
          },
          "MigrationBatchId": {
            "type": "string"
          },
          "MinOrderQty": {
            "type": "number"
          },
          "MinSellPrice": {
            "type": "number"
          },
          "Name": {
            "type": "string"
          },
          "OdooId": {
            "type": "integer"
          },
          "OdooLinkedAt": {
            "type": "string"
          },
          "OdooModel": {
            "type": "string"
          },
          "OdooWriteDate": {
            "type": "string"
          },
          "OriginId": {
            "type": "string"
          },
          "OriginSystem": {
            "type": "string"
          },
          "POSReferenceId": {
            "type": "string"
          },
          "PackagingUnit": {
            "type": "string"
          },
          "PreferredVendorRefId": {
            "type": "string"
          },
          "ProcurementType": {
            "type": "string"
          },
          "PurchasePrice": {
            "type": "number"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "RegulatoryNotes": {
            "type": "string"
          },
          "ReorderLevel": {
            "type": "integer"
          },
          "RequiresColdChain": {
            "type": "boolean"
          },
          "ScrapPercentage": {
            "type": "number"
          },
          "SellingPrice": {
            "type": "number"
          },
          "ShelfLifeMonths": {
            "type": "integer"
          },
          "ShopifyInventoryItemId": {
            "type": "string"
          },
          "ShopifyLinkedAt": {
            "type": "string"
          },
          "ShopifyProductId": {
            "type": "string"
          },
          "ShopifyShop": {
            "type": "string"
          },
          "SignalWord": {
            "type": "string"
          },
          "StandardCost": {
            "type": "number"
          },
          "Status": {
            "type": "string"
          },
          "StorageTempMax": {
            "type": "number"
          },
          "StorageTempMin": {
            "type": "number"
          },
          "SyncVersion": {
            "type": "integer"
          },
          "Tags": {
            "type": "array"
          },
          "TallyExtras": {
            "type": "object"
          },
          "TaxRefId": {
            "type": "string"
          },
          "TaxType": {
            "type": "string"
          },
          "TrackBatch": {
            "type": "boolean"
          },
          "TrackInventory": {
            "type": "boolean"
          },
          "TrackLot": {
            "type": "boolean"
          },
          "TrackSerial": {
            "type": "boolean"
          },
          "Type": {
            "type": "string"
          },
          "Uom": {
            "type": "string"
          },
          "UomHierarchy": {
            "type": "object"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "ValuationMethod": {
            "type": "string"
          },
          "WaveBusinessId": {
            "type": "string"
          },
          "WaveId": {
            "type": "string"
          },
          "WaveLinkedAt": {
            "type": "string"
          },
          "XeroId": {
            "type": "string"
          },
          "XeroLinkedAt": {
            "type": "string"
          },
          "XeroTenantId": {
            "type": "string"
          },
          "XeroUpdatedDateUTC": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "Journal": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `journal` record, from the published field contract (model `Journal`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "Attachments": {
            "type": "object"
          },
          "AutoReverseOn": {
            "type": "string"
          },
          "Category": {
            "type": "string"
          },
          "CounterpartyEntityRefId": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CurrencyRef": {
            "type": "string"
          },
          "CustomFields": {
            "type": "object"
          },
          "Description": {
            "type": "string"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "FxSource": {
            "type": "string"
          },
          "HideFromReports": {
            "type": "boolean"
          },
          "IsAccrual": {
            "type": "boolean"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "IsInterCompany": {
            "type": "boolean"
          },
          "JournalNumber": {
            "type": "string"
          },
          "JournalType": {
            "type": "string"
          },
          "LastEditedSystem": {
            "type": "string"
          },
          "LinkedTxnId": {
            "type": "string"
          },
          "LinkedTxnType": {
            "type": "string"
          },
          "MigrationBatchId": {
            "type": "string"
          },
          "Narration": {
            "type": "string"
          },
          "OdooId": {
            "type": "integer"
          },
          "OdooLinkedAt": {
            "type": "string"
          },
          "OdooModel": {
            "type": "string"
          },
          "OdooWriteDate": {
            "type": "string"
          },
          "OriginId": {
            "type": "string"
          },
          "OriginSystem": {
            "type": "string"
          },
          "PostedAt": {
            "type": "string"
          },
          "PostedBy": {
            "type": "string"
          },
          "PostedByUserName": {
            "type": "string"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "Reference": {
            "type": "string"
          },
          "ReversalMode": {
            "type": "string"
          },
          "ReversalNote": {
            "type": "string"
          },
          "ReversalOf": {
            "type": "string"
          },
          "ReversalReason": {
            "type": "string"
          },
          "ReversedAt": {
            "type": "string"
          },
          "ReversedBy": {
            "type": "string"
          },
          "ReversedByUserId": {
            "type": "string"
          },
          "ReversedByUserName": {
            "type": "string"
          },
          "ShowOnCashBasis": {
            "type": "boolean"
          },
          "SourceApp": {
            "type": "string"
          },
          "SourceRefId": {
            "type": "string"
          },
          "SourceUrl": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "SyncVersion": {
            "type": "integer"
          },
          "TaxType": {
            "type": "string"
          },
          "TotalCredit": {
            "type": "number"
          },
          "TotalDebit": {
            "type": "number"
          },
          "TotalTaxAmount": {
            "type": "number"
          },
          "TxnDate": {
            "type": "string",
            "readOnly": true
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "Lead": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `lead` record, from the published field contract (model `Lead`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AttributionId": {
            "type": "string"
          },
          "City": {
            "type": "string"
          },
          "Comment": {
            "type": "string"
          },
          "CompanyName": {
            "type": "string"
          },
          "ContactName": {
            "type": "string"
          },
          "ContactTitle": {
            "type": "string"
          },
          "ConvertedAt": {
            "type": "string"
          },
          "ConvertedBy": {
            "type": "string"
          },
          "ConvertedCustomerId": {
            "type": "string"
          },
          "ConvertedOpportunityId": {
            "type": "string"
          },
          "Country": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CreatedBy": {
            "type": "string"
          },
          "Currency": {
            "type": "string"
          },
          "DefaultPaymentTerm": {
            "type": "string"
          },
          "DefaultTaxRef": {
            "type": "string"
          },
          "DisplayName": {
            "type": "string"
          },
          "Email": {
            "type": "string"
          },
          "ExpectedCloseDate": {
            "type": "string"
          },
          "ExpectedValue": {
            "type": "number"
          },
          "Industry": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "IsConvertedToCustomer": {
            "type": "boolean"
          },
          "LastActivityAt": {
            "type": "string"
          },
          "LastMessageAt": {
            "type": "string"
          },
          "LastStageAt": {
            "type": "string"
          },
          "LeadPriority": {
            "type": "string"
          },
          "LeadSource": {
            "type": "string"
          },
          "LeadStatus": {
            "type": "string"
          },
          "LostAt": {
            "type": "string"
          },
          "LostReason": {
            "type": "string"
          },
          "LostReasonId": {
            "type": "string"
          },
          "LostReasonNotes": {
            "type": "string"
          },
          "LostToCompetitor": {
            "type": "string"
          },
          "Mobile": {
            "type": "string"
          },
          "Notes": {
            "type": "string"
          },
          "OwnerId": {
            "type": "string"
          },
          "Phone": {
            "type": "string"
          },
          "PreferredPaymentMethod": {
            "type": "string"
          },
          "RequirementNotes": {
            "type": "string"
          },
          "Score": {
            "type": "integer"
          },
          "Source": {
            "type": "string"
          },
          "StageId": {
            "type": "string"
          },
          "State": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "TeamId": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "Website": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "LinkedSalesCreditNoteInvoice": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `linkedSalesCreditNoteInvoice` record, from the published field contract (model `LinkedSalesCreditNoteInvoice`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AppliedAmount": {
            "type": "number"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "InvoiceRefId": {
            "type": "string"
          },
          "SalesCreditNoteId": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "LinkedTransaction": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `linkedTransaction` record, from the published field contract (model `LinkedTransaction`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "IsLinked": {
            "type": "boolean"
          },
          "LinkOrigin": {
            "type": "string"
          },
          "PostsJournal": {
            "type": "boolean"
          },
          "TransactionLineId": {
            "type": "string"
          },
          "TransactionRefId": {
            "type": "string"
          },
          "TxnType": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "Location": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `location` record, from the published field contract (model `Location`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AttachmentUrl": {
            "type": "string"
          },
          "City": {
            "type": "string"
          },
          "Code": {
            "type": "string"
          },
          "Comment": {
            "type": "string"
          },
          "Country": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "IsActive": {
            "type": "boolean"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "Latitude": {
            "type": "string"
          },
          "Longitude": {
            "type": "string"
          },
          "Name": {
            "type": "string"
          },
          "PostalCode": {
            "type": "string"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "State": {
            "type": "string"
          },
          "Street": {
            "type": "string"
          },
          "SubName": {
            "type": "string"
          },
          "TallyGodownName": {
            "type": "string"
          },
          "TallyParentGodown": {
            "type": "string"
          },
          "TallySyncError": {
            "type": "string"
          },
          "TallySyncStatus": {
            "type": "string"
          },
          "TallySyncedAt": {
            "type": "string"
          },
          "TimeZone": {
            "type": "string"
          },
          "TrackingUsage": {
            "type": "array"
          },
          "Type": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "OwnerAddress": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `ownerAddress` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "OwnerCreditCard": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `ownerCreditCard` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "OwnerDebitCard": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `ownerDebitCard` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "OwnerLoanAccounts": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `ownerLoanAccounts` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "Payment": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `payment` record, from the published field contract (model `Payment`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AccountRef": {
            "type": "string"
          },
          "AdjustmentAmount": {
            "type": "number"
          },
          "AdjustmentDebitCredit": {
            "type": "string"
          },
          "AdjustmentDescription": {
            "type": "string"
          },
          "AdjustmentType": {
            "type": "string"
          },
          "Amount": {
            "type": "string"
          },
          "AmountApplied": {
            "type": "number"
          },
          "Attachments": {
            "type": "object"
          },
          "BillRefId": {
            "type": "string"
          },
          "CheckStockType": {
            "type": "string"
          },
          "ChequeBank": {
            "type": "string"
          },
          "ChequeDate": {
            "type": "string"
          },
          "ChequeNumber": {
            "type": "string"
          },
          "Comment": {
            "type": "string"
          },
          "CounterpartyEntityRefId": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CreatedBy": {
            "type": "string"
          },
          "CreatedByMatchId": {
            "type": "string"
          },
          "CurrencyRef": {
            "type": "string"
          },
          "CustomFields": {
            "type": "object"
          },
          "DocumentCurrencyRef": {
            "type": "string"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "ExpenseClaimRefId": {
            "type": "string"
          },
          "FunctionalAmount": {
            "type": "number"
          },
          "FxRateDate": {
            "type": "string"
          },
          "FxSource": {
            "type": "string"
          },
          "GatewayMethodCategory": {
            "type": "string"
          },
          "GatewayMethodCode": {
            "type": "string"
          },
          "GatewayMethodSubtype": {
            "type": "string"
          },
          "GatewayProvider": {
            "type": "string"
          },
          "IdempotencyKey": {
            "type": "string"
          },
          "InvoiceRefId": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "IsCheque": {
            "type": "boolean"
          },
          "IsInterCompany": {
            "type": "boolean"
          },
          "IsReconciled": {
            "type": "boolean"
          },
          "LastEditedSystem": {
            "type": "string"
          },
          "MigrationBatchId": {
            "type": "string"
          },
          "OdooId": {
            "type": "integer"
          },
          "OdooLinkedAt": {
            "type": "string"
          },
          "OdooModel": {
            "type": "string"
          },
          "OdooWriteDate": {
            "type": "string"
          },
          "OriginId": {
            "type": "string"
          },
          "OriginSystem": {
            "type": "string"
          },
          "PayeeRef": {
            "type": "string"
          },
          "PayeeType": {
            "type": "string"
          },
          "PaymentDate": {
            "type": "string",
            "readOnly": true
          },
          "PaymentMethod": {
            "type": "string"
          },
          "PrintBatchRef": {
            "type": "string"
          },
          "PrintStatus": {
            "type": "string"
          },
          "PrintedAt": {
            "type": "string"
          },
          "PrintedBy": {
            "type": "string"
          },
          "PurchaseCreditNoteRefId": {
            "type": "string"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "ReconciledAt": {
            "type": "string"
          },
          "ReconciledBy": {
            "type": "string"
          },
          "Reference": {
            "type": "string"
          },
          "SalesCreditNoteRefId": {
            "type": "string"
          },
          "ShopifyLinkedAt": {
            "type": "string"
          },
          "ShopifyOrderId": {
            "type": "string"
          },
          "ShopifyShop": {
            "type": "string"
          },
          "ShopifyTransactionId": {
            "type": "string"
          },
          "SourceModule": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "SyncVersion": {
            "type": "integer"
          },
          "TallyNumber": {
            "type": "string"
          },
          "TallyVoucherType": {
            "type": "string"
          },
          "TransactionLineRefId": {
            "type": "string"
          },
          "TransactionRefId": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "UpdatedBy": {
            "type": "string"
          },
          "VoidReason": {
            "type": "string"
          },
          "VoidedAt": {
            "type": "string"
          },
          "VoidedBy": {
            "type": "string"
          },
          "XeroId": {
            "type": "string"
          },
          "XeroLinkedAt": {
            "type": "string"
          },
          "XeroTenantId": {
            "type": "string"
          },
          "XeroUpdatedDateUTC": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "ProfitLoss": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `profitLoss` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "Project": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `project` record, from the published field contract (model `Project`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "Attachment": {
            "type": "string"
          },
          "Billable": {
            "type": "boolean"
          },
          "BoardData": {
            "type": "string"
          },
          "Budget": {
            "type": "number"
          },
          "Category": {
            "type": "string"
          },
          "Client": {
            "type": "array"
          },
          "ContactId": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "Currency": {
            "type": "string"
          },
          "Description": {
            "type": "string"
          },
          "DueDate": {
            "type": "string"
          },
          "EndDate": {
            "type": "string"
          },
          "Group": {
            "type": "array"
          },
          "HourlyRate": {
            "type": "number"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "IsBoard": {
            "type": "boolean"
          },
          "MilestoneDue": {
            "type": "string"
          },
          "Name": {
            "type": "string"
          },
          "NextMilestone": {
            "type": "string"
          },
          "Notes": {
            "type": "object"
          },
          "Priority": {
            "type": "string"
          },
          "Progress": {
            "type": "integer"
          },
          "ProjectHealth": {
            "type": "string"
          },
          "Risks": {
            "type": "integer"
          },
          "Spent": {
            "type": "number"
          },
          "StartDate": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "Tags": {
            "type": "array"
          },
          "Team": {
            "type": "array"
          },
          "TimeEstimated": {
            "type": "number"
          },
          "TimeTracked": {
            "type": "number"
          },
          "TotalExpenses": {
            "type": "number"
          },
          "TotalIncome": {
            "type": "number"
          },
          "UnbilledExpenses": {
            "type": "number"
          },
          "UnbilledTime": {
            "type": "number"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "PurchaseCreditNote": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `purchaseCreditNote` record, from the published field contract (model `PurchaseCreditNote`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AmountApplied": {
            "type": "number"
          },
          "AmountRefunded": {
            "type": "number"
          },
          "Attachments": {
            "type": "object"
          },
          "BillRef": {
            "type": "string"
          },
          "Branding": {
            "type": "string"
          },
          "ClassRef": {
            "type": "string"
          },
          "Comment": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "Currency": {
            "type": "string"
          },
          "DifferentialPercent": {
            "type": "number"
          },
          "EwbGeneratedAt": {
            "type": "string"
          },
          "EwbNo": {
            "type": "string"
          },
          "EwbRefId": {
            "type": "string"
          },
          "EwbStatus": {
            "type": "string"
          },
          "EwbValidUpto": {
            "type": "string"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "ExcludeFromEwb": {
            "type": "boolean"
          },
          "FinancialYear": {
            "type": "string"
          },
          "FunctionalTotalAmount": {
            "type": "number"
          },
          "FxRateDate": {
            "type": "string"
          },
          "FxSource": {
            "type": "string"
          },
          "GSTCategory": {
            "type": "string"
          },
          "GoodsReceiptNoteRefId": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "IsITCReversal": {
            "type": "boolean"
          },
          "IsPartyGSTRegistered": {
            "type": "boolean"
          },
          "IsReverseCharge": {
            "type": "boolean"
          },
          "LocationRef": {
            "type": "string"
          },
          "MigrationBatchId": {
            "type": "string"
          },
          "OriginalBillDate": {
            "type": "string"
          },
          "OriginalBillNo": {
            "type": "string"
          },
          "PartyGSTIN": {
            "type": "string"
          },
          "PartyStateCode": {
            "type": "string"
          },
          "PlaceOfSupply": {
            "type": "string"
          },
          "ProjectRef": {
            "type": "string"
          },
          "PurchaseCreditNoteNumber": {
            "type": "string"
          },
          "PurchaseCreditNoteType": {
            "type": "string"
          },
          "Purpose": {
            "type": "string"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "Reference": {
            "type": "string"
          },
          "RemainingAmount": {
            "type": "number"
          },
          "ReturnReason": {
            "type": "string"
          },
          "SellerGSTIN": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "SupplyType": {
            "type": "string"
          },
          "TallyGuid": {
            "type": "string"
          },
          "TallyNumber": {
            "type": "string"
          },
          "TallyVoucherSeries": {
            "type": "string"
          },
          "TallyVoucherType": {
            "type": "string"
          },
          "TaxType": {
            "type": "string"
          },
          "TotalAmount": {
            "type": "number"
          },
          "TotalCGST": {
            "type": "number"
          },
          "TotalCess": {
            "type": "number"
          },
          "TotalCessNonAdvalorem": {
            "type": "number"
          },
          "TotalIGST": {
            "type": "number"
          },
          "TotalLabourAmount": {
            "type": "number"
          },
          "TotalSGST": {
            "type": "number"
          },
          "TotalSupplyAmount": {
            "type": "number"
          },
          "TotalTaxAmount": {
            "type": "number"
          },
          "TotalTaxableAmount": {
            "type": "number"
          },
          "TxnDate": {
            "type": "string",
            "readOnly": true
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "VendorCreditNoteDate": {
            "type": "string"
          },
          "VendorCreditNoteNo": {
            "type": "string"
          },
          "VendorRef": {
            "type": "string"
          },
          "XeroId": {
            "type": "string"
          },
          "XeroLinkedAt": {
            "type": "string"
          },
          "XeroTenantId": {
            "type": "string"
          },
          "XeroUpdatedDateUTC": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "PurchaseCreditNoteLine": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `purchaseCreditNoteLine` record, from the published field contract (model `PurchaseCreditNoteLine`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AccountHeadRef": {
            "type": "string"
          },
          "Amount": {
            "type": "number"
          },
          "CGSTAmount": {
            "type": "number"
          },
          "CGSTRate": {
            "type": "number"
          },
          "CessAmount": {
            "type": "number"
          },
          "CessNonAdvaloremAmount": {
            "type": "number"
          },
          "CessNonAdvaloremRate": {
            "type": "number"
          },
          "CessRate": {
            "type": "number"
          },
          "ClassComponentRef1": {
            "type": "string"
          },
          "ClassComponentRef2": {
            "type": "string"
          },
          "ClassComponentRef3": {
            "type": "string"
          },
          "ClassComponentRef4": {
            "type": "string"
          },
          "ClassRef1": {
            "type": "string"
          },
          "ClassRef2": {
            "type": "string"
          },
          "ClassRef3": {
            "type": "string"
          },
          "ClassRef4": {
            "type": "string"
          },
          "Currency": {
            "type": "string"
          },
          "Description": {
            "type": "string"
          },
          "FunctionalAmount": {
            "type": "number"
          },
          "GSTRate": {
            "type": "number"
          },
          "HSNCode": {
            "type": "string"
          },
          "HSN_SAC": {
            "type": "string"
          },
          "IGSTAmount": {
            "type": "number"
          },
          "IGSTRate": {
            "type": "number"
          },
          "ItemRef": {
            "type": "string"
          },
          "LabourAccountHeadRef": {
            "type": "string"
          },
          "LabourAmount": {
            "type": "number"
          },
          "LabourHSN_SAC": {
            "type": "string"
          },
          "LabourRate": {
            "type": "number"
          },
          "LabourTaxAmount": {
            "type": "number"
          },
          "LabourTaxRate": {
            "type": "number"
          },
          "LabourTaxRefId": {
            "type": "string"
          },
          "LineExchangeRate": {
            "type": "number"
          },
          "LocationRefId": {
            "type": "string"
          },
          "MarginValue": {
            "type": "number"
          },
          "NCCDAmount": {
            "type": "number"
          },
          "NCCDRate": {
            "type": "number"
          },
          "ProjectRefId": {
            "type": "string"
          },
          "PurchaseCreditNoteId": {
            "type": "string"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "Quantity": {
            "type": "number"
          },
          "Rate": {
            "type": "number"
          },
          "SGSTAmount": {
            "type": "number"
          },
          "SGSTRate": {
            "type": "number"
          },
          "SupplyAmount": {
            "type": "number"
          },
          "TaxAmount": {
            "type": "number"
          },
          "TaxClassification": {
            "type": "string"
          },
          "TaxRefId": {
            "type": "string"
          },
          "TaxableAmount": {
            "type": "number"
          },
          "UTGSTAmount": {
            "type": "number"
          },
          "UTGSTRate": {
            "type": "number"
          },
          "UnitRefId": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "PurchaseOrder": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `purchaseOrder` record, from the published field contract (model `PurchaseOrder`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AcceptedByVendorAt": {
            "type": "string"
          },
          "Addresses": {
            "type": "array"
          },
          "ApprovalComment": {
            "type": "string"
          },
          "ApprovalStatus": {
            "type": "string"
          },
          "ApprovedAt": {
            "type": "string"
          },
          "ApprovedBy": {
            "type": "string"
          },
          "Attachments": {
            "type": "object"
          },
          "BrandingThemeId": {
            "type": "string"
          },
          "ClassRef": {
            "type": "string"
          },
          "Comment": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CreatedBy": {
            "type": "string"
          },
          "CreatedByName": {
            "type": "string"
          },
          "Currency": {
            "type": "string"
          },
          "DeclinedByVendorAt": {
            "type": "string"
          },
          "DeclinedReason": {
            "type": "string"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "ExpectedDeliveryDate": {
            "type": "string"
          },
          "FinancialYear": {
            "type": "string"
          },
          "FunctionalTotalPayableAmount": {
            "type": "number"
          },
          "FxRateDate": {
            "type": "string"
          },
          "FxSource": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "LocationRef": {
            "type": "string"
          },
          "PayeeRef": {
            "type": "string"
          },
          "PayeeType": {
            "type": "string"
          },
          "PlaceOfSupply": {
            "type": "string"
          },
          "ProjectRef": {
            "type": "string"
          },
          "PurchaseOrderDate": {
            "type": "string",
            "readOnly": true
          },
          "PurchaseOrderNumber": {
            "type": "string"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "ReceiptStatus": {
            "type": "string"
          },
          "ReferenceNumber": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "TallyGuid": {
            "type": "string"
          },
          "TallyVoucherType": {
            "type": "string"
          },
          "TaxType": {
            "type": "string"
          },
          "TermsAndConditions": {
            "type": "object"
          },
          "TotalLabourAmount": {
            "type": "number"
          },
          "TotalPayableAmount": {
            "type": "number"
          },
          "TotalSupplyAmount": {
            "type": "number"
          },
          "TotalTaxAmount": {
            "type": "number"
          },
          "TotalTaxableAmount": {
            "type": "number"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "XeroId": {
            "type": "string"
          },
          "XeroLinkedAt": {
            "type": "string"
          },
          "XeroTenantId": {
            "type": "string"
          },
          "XeroUpdatedDateUTC": {
            "type": "string"
          },
          "chartOfAccountId": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "PurchaseOrderAddress": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `purchaseOrderAddress` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "PurchaseOrderLine": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `purchaseOrderLine` record, from the published field contract (model `PurchaseOrderLine`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AccountRef": {
            "type": "string"
          },
          "Amount": {
            "type": "number"
          },
          "BrandRefId": {
            "type": "string"
          },
          "ClassComponentRef1": {
            "type": "string"
          },
          "ClassComponentRef2": {
            "type": "string"
          },
          "ClassComponentRef3": {
            "type": "string"
          },
          "ClassComponentRef4": {
            "type": "string"
          },
          "ClassRef1": {
            "type": "string"
          },
          "ClassRef2": {
            "type": "string"
          },
          "ClassRef3": {
            "type": "string"
          },
          "ClassRef4": {
            "type": "string"
          },
          "CostCodeRefId": {
            "type": "string"
          },
          "Currency": {
            "type": "string"
          },
          "Description": {
            "type": "string"
          },
          "DiscountAmount": {
            "type": "number"
          },
          "DiscountPercentage": {
            "type": "number"
          },
          "FunctionalAmount": {
            "type": "number"
          },
          "HSN_SAC": {
            "type": "string"
          },
          "IsDiscountBeforeTax": {
            "type": "boolean"
          },
          "ItemRef": {
            "type": "string"
          },
          "LabourAccountHeadRef": {
            "type": "string"
          },
          "LabourAmount": {
            "type": "number"
          },
          "LabourHSN_SAC": {
            "type": "string"
          },
          "LabourRate": {
            "type": "number"
          },
          "LabourTaxAmount": {
            "type": "number"
          },
          "LabourTaxRate": {
            "type": "number"
          },
          "LabourTaxRefId": {
            "type": "string"
          },
          "LineExchangeRate": {
            "type": "number"
          },
          "LocationRef": {
            "type": "string"
          },
          "ProjectRef": {
            "type": "string"
          },
          "PurchaseOrderId": {
            "type": "string"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "Quantity": {
            "type": "number"
          },
          "Rate": {
            "type": "number"
          },
          "SupplyAmount": {
            "type": "number"
          },
          "TaxAmount": {
            "type": "number"
          },
          "TaxRefId": {
            "type": "string"
          },
          "TaxableAmount": {
            "type": "number"
          },
          "UnitRefId": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "PurchaseRequest": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `purchaseRequest` record, from the published field contract (model `PurchaseRequest`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "Addresses": {
            "type": "array"
          },
          "ApprovalComment": {
            "type": "string"
          },
          "ApprovalStatus": {
            "type": "string"
          },
          "ApprovedAt": {
            "type": "string"
          },
          "ApprovedBy": {
            "type": "string"
          },
          "Attachments": {
            "type": "object"
          },
          "ClassRef": {
            "type": "string"
          },
          "Comment": {
            "type": "string"
          },
          "ConvertedToPORef": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "Currency": {
            "type": "string"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "ExpectedDeliveryDate": {
            "type": "string"
          },
          "FinancialYear": {
            "type": "string"
          },
          "FunctionalTotalPayableAmount": {
            "type": "number"
          },
          "FxRateDate": {
            "type": "string"
          },
          "FxSource": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "LocationRef": {
            "type": "string"
          },
          "MRPRunRefId": {
            "type": "string"
          },
          "Notes": {
            "type": "string"
          },
          "PayeeRef": {
            "type": "string"
          },
          "PayeeType": {
            "type": "string"
          },
          "ProjectRef": {
            "type": "string"
          },
          "PurchaseRequestDate": {
            "type": "string",
            "readOnly": true
          },
          "PurchaseRequestNumber": {
            "type": "string"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "ReferenceNumber": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "TaxType": {
            "type": "string"
          },
          "TermsAndConditions": {
            "type": "object"
          },
          "TotalPayableAmount": {
            "type": "number"
          },
          "TotalTaxAmount": {
            "type": "number"
          },
          "TotalTaxableAmount": {
            "type": "number"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "chartOfAccountId": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "PurchaseRequestLine": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `purchaseRequestLine` record, from the published field contract (model `PurchaseRequestLine`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AccountRef": {
            "type": "string"
          },
          "Amount": {
            "type": "number"
          },
          "ClassComponentRef1": {
            "type": "string"
          },
          "ClassComponentRef2": {
            "type": "string"
          },
          "ClassComponentRef3": {
            "type": "string"
          },
          "ClassComponentRef4": {
            "type": "string"
          },
          "ClassRef1": {
            "type": "string"
          },
          "ClassRef2": {
            "type": "string"
          },
          "ClassRef3": {
            "type": "string"
          },
          "ClassRef4": {
            "type": "string"
          },
          "Description": {
            "type": "string"
          },
          "DiscountAmount": {
            "type": "number"
          },
          "DiscountPercentage": {
            "type": "number"
          },
          "FunctionalAmount": {
            "type": "number"
          },
          "HSN_SAC": {
            "type": "string"
          },
          "IsDiscountBeforeTax": {
            "type": "boolean"
          },
          "ItemRef": {
            "type": "string"
          },
          "LocationRef": {
            "type": "string"
          },
          "ProjectRef": {
            "type": "string"
          },
          "PurchaseRequestId": {
            "type": "string"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "Quantity": {
            "type": "number"
          },
          "Rate": {
            "type": "number"
          },
          "TaxAmount": {
            "type": "number"
          },
          "TaxRefId": {
            "type": "string"
          },
          "TaxableAmount": {
            "type": "number"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "Quote": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `quote` record, from the published field contract (model `Quote`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AdvanceReceived": {
            "type": "string"
          },
          "ApprovalNote": {
            "type": "string"
          },
          "Attachments": {
            "type": "object"
          },
          "BrandingThemeId": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "Currency": {
            "type": "string"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "ExpiryDate": {
            "type": "string"
          },
          "FinancialYear": {
            "type": "string"
          },
          "ForceApproved": {
            "type": "boolean"
          },
          "FunctionalTotalPayableAmount": {
            "type": "number"
          },
          "FxRateDate": {
            "type": "string"
          },
          "FxSource": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "IsShippingSameAsBilling": {
            "type": "boolean"
          },
          "IssueDate": {
            "type": "string"
          },
          "MasterDiscountRef": {
            "type": "string"
          },
          "Notes": {
            "type": "string"
          },
          "PayeeRef": {
            "type": "string"
          },
          "PayeeType": {
            "type": "string"
          },
          "PlaceOfSupply": {
            "type": "string"
          },
          "ProjectRef": {
            "type": "string"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "QuoteNumber": {
            "type": "string"
          },
          "QuoteType": {
            "type": "string"
          },
          "ReferenceNumber": {
            "type": "string"
          },
          "SalesPerson": {
            "type": "string"
          },
          "SalesPersonId": {
            "type": "string"
          },
          "SelectedBillingAddressId": {
            "type": "string"
          },
          "SelectedShippingAddressId": {
            "type": "string"
          },
          "ShopifyDraftOrderId": {
            "type": "string"
          },
          "ShopifyLinkedAt": {
            "type": "string"
          },
          "ShopifyShop": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "SyncedTo": {
            "type": "string"
          },
          "TaxType": {
            "type": "string"
          },
          "Terms": {
            "type": "object"
          },
          "TermsAndConditions": {
            "type": "object"
          },
          "TotalLabourAmount": {
            "type": "number"
          },
          "TotalPayableAmount": {
            "type": "number"
          },
          "TotalSupplyAmount": {
            "type": "number"
          },
          "TotalTaxAmount": {
            "type": "number"
          },
          "TotalTaxableAmount": {
            "type": "number"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "XeroId": {
            "type": "string"
          },
          "XeroLinkedAt": {
            "type": "string"
          },
          "XeroTenantId": {
            "type": "string"
          },
          "XeroUpdatedDateUTC": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "QuoteLine": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `quoteLine` record, from the published field contract (model `QuoteLine`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AccountHeadRef": {
            "type": "string"
          },
          "Amount": {
            "type": "number"
          },
          "ClassComponentRef1": {
            "type": "string"
          },
          "ClassComponentRef2": {
            "type": "string"
          },
          "ClassComponentRef3": {
            "type": "string"
          },
          "ClassComponentRef4": {
            "type": "string"
          },
          "ClassRef1": {
            "type": "string"
          },
          "ClassRef2": {
            "type": "string"
          },
          "ClassRef3": {
            "type": "string"
          },
          "ClassRef4": {
            "type": "string"
          },
          "Currency": {
            "type": "string"
          },
          "Description": {
            "type": "string"
          },
          "DiscountAmount": {
            "type": "number"
          },
          "DiscountD2Amount": {
            "type": "number"
          },
          "DiscountD2Percentage": {
            "type": "number"
          },
          "DiscountD3Amount": {
            "type": "number"
          },
          "DiscountD3Percentage": {
            "type": "number"
          },
          "DiscountPercentage": {
            "type": "number"
          },
          "FunctionalAmount": {
            "type": "number"
          },
          "HSN_SAC": {
            "type": "string"
          },
          "ItemRef": {
            "type": "string"
          },
          "LabourAccountHeadRef": {
            "type": "string"
          },
          "LabourAmount": {
            "type": "number"
          },
          "LabourHSN_SAC": {
            "type": "string"
          },
          "LabourRate": {
            "type": "number"
          },
          "LabourTaxAmount": {
            "type": "number"
          },
          "LabourTaxRate": {
            "type": "number"
          },
          "LabourTaxRefId": {
            "type": "string"
          },
          "LineExchangeRate": {
            "type": "number"
          },
          "Quantity": {
            "type": "number"
          },
          "QuoteId": {
            "type": "string"
          },
          "Rate": {
            "type": "number"
          },
          "SupplyAmount": {
            "type": "number"
          },
          "TaxAmount": {
            "type": "number"
          },
          "TaxRef": {
            "type": "string"
          },
          "TaxableAmount": {
            "type": "number"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "Reconcile_period": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `reconcile-period` record, from the published field contract (model `ReconcilePeriod`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AccountRefId": {
            "type": "string"
          },
          "Amount": {
            "type": "number"
          },
          "AmountSign": {
            "type": "string"
          },
          "Attachments": {
            "type": "object"
          },
          "ClosedAt": {
            "type": "string"
          },
          "ClosedByName": {
            "type": "string"
          },
          "ClosedByUserId": {
            "type": "string"
          },
          "ClosingBalance": {
            "type": "number"
          },
          "ClosingCurrencyRef": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CreatedByName": {
            "type": "string"
          },
          "CreatedByUserId": {
            "type": "string"
          },
          "CurrencyRef": {
            "type": "string"
          },
          "IdempotencyKey": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "LastReportGeneratedAt": {
            "type": "string"
          },
          "LastReportGeneratedBy": {
            "type": "string"
          },
          "OpeningBalance": {
            "type": "number"
          },
          "OpeningCurrencyRef": {
            "type": "string"
          },
          "PeriodEnd": {
            "type": "string"
          },
          "PeriodStart": {
            "type": "string"
          },
          "SourceDocumentUrl": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "RecurringBill": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `recurringBill` record, from the published field contract (model `RecurringBillTemplate`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "Addresses": {
            "type": "array"
          },
          "AutoGenerate": {
            "type": "boolean"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CreatedBy": {
            "type": "string"
          },
          "CreatedById": {
            "type": "string"
          },
          "CurrencyMismatchWarning": {
            "type": "boolean"
          },
          "CurrencyRefId": {
            "type": "string"
          },
          "DueDateType": {
            "type": "string"
          },
          "DueOffsetDays": {
            "type": "integer"
          },
          "EmailVendorOnGenerate": {
            "type": "boolean"
          },
          "EnablePlaceholderParse": {
            "type": "boolean"
          },
          "EndDate": {
            "type": "string"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "FxSource": {
            "type": "string"
          },
          "GoodsReceiptNoteRefId": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "LastGeneratedDate": {
            "type": "string"
          },
          "MasterDiscountRef": {
            "type": "string"
          },
          "NextScheduledDate": {
            "type": "string"
          },
          "Notes": {
            "type": "string"
          },
          "NotifyInternalEmails": {
            "type": "array"
          },
          "PayeeRef": {
            "type": "string"
          },
          "PayeeType": {
            "type": "string"
          },
          "Placeholder": {
            "type": "string"
          },
          "PlannedPaymentDate": {
            "type": "string"
          },
          "PurchaseOrderRefId": {
            "type": "string"
          },
          "RecurringBillApprovalStatus": {
            "type": "string"
          },
          "ReferenceNumber": {
            "type": "string"
          },
          "RequireApproval": {
            "type": "boolean"
          },
          "ScheduleArn": {
            "type": "string"
          },
          "ScheduleTimezone": {
            "type": "string"
          },
          "SkipIfMissed": {
            "type": "boolean"
          },
          "StartDate": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "TaxType": {
            "type": "string"
          },
          "TemplateName": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "UpdatedBy": {
            "type": "string"
          },
          "UpdatedById": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "RecurringInvoice": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `recurringInvoice` record, from the published field contract (model `RecurringInvoiceTemplate`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "Addresses": {
            "type": "array"
          },
          "AutoGenerate": {
            "type": "boolean"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CreatedBy": {
            "type": "string"
          },
          "CurrencyMismatchWarning": {
            "type": "boolean"
          },
          "CurrencyRefId": {
            "type": "string"
          },
          "DueDateType": {
            "type": "string"
          },
          "DueOffsetDays": {
            "type": "integer"
          },
          "EmailCustomerOnGenerate": {
            "type": "boolean"
          },
          "EnablePlaceholderParse": {
            "type": "boolean"
          },
          "EndDate": {
            "type": "string"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "FxSource": {
            "type": "string"
          },
          "GoodsReceiptNoteRefId": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "IsShippingSameAsBilling": {
            "type": "boolean"
          },
          "LastGeneratedDate": {
            "type": "string"
          },
          "MasterDiscountRef": {
            "type": "string"
          },
          "NextScheduledDate": {
            "type": "string"
          },
          "Notes": {
            "type": "string"
          },
          "NotifyInternalEmails": {
            "type": "array"
          },
          "PayeeRef": {
            "type": "string"
          },
          "PayeeType": {
            "type": "string"
          },
          "PlaceOfSupply": {
            "type": "string"
          },
          "Placeholder": {
            "type": "string"
          },
          "PlannedPaymentDate": {
            "type": "string"
          },
          "RecurringInvoiceApprovalStatus": {
            "type": "string"
          },
          "ReferenceNumber": {
            "type": "string"
          },
          "RequireApproval": {
            "type": "boolean"
          },
          "SalesOrderRefId": {
            "type": "string"
          },
          "ScheduleArn": {
            "type": "string"
          },
          "ScheduleTimezone": {
            "type": "string"
          },
          "SelectedBillingAddressId": {
            "type": "string"
          },
          "SelectedShippingAddressId": {
            "type": "string"
          },
          "SkipIfMissed": {
            "type": "boolean"
          },
          "StartDate": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "TCS": {
            "type": "boolean"
          },
          "TDS": {
            "type": "boolean"
          },
          "TaxRef": {
            "type": "string"
          },
          "TaxType": {
            "type": "string"
          },
          "TemplateName": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "RecurringInvoiceAttachment": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `recurringInvoiceAttachment` record, from the published field contract (model `RecurringInvoiceAttachment`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "FileName": {
            "type": "string"
          },
          "FileUrl": {
            "type": "string"
          },
          "TemplateId": {
            "type": "string"
          },
          "UploadedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "RecurringInvoiceLineItem": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `recurringInvoiceLineItem` record, from the published field contract (model `RecurringInvoiceLineItem`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AccountHeadRef": {
            "type": "string"
          },
          "Amount": {
            "type": "number"
          },
          "ClassComponentRef1": {
            "type": "string"
          },
          "ClassComponentRef2": {
            "type": "string"
          },
          "ClassComponentRef3": {
            "type": "string"
          },
          "ClassComponentRef4": {
            "type": "string"
          },
          "ClassRef1": {
            "type": "string"
          },
          "ClassRef2": {
            "type": "string"
          },
          "ClassRef3": {
            "type": "string"
          },
          "ClassRef4": {
            "type": "string"
          },
          "Description": {
            "type": "string"
          },
          "DiscountAmount": {
            "type": "number"
          },
          "DiscountD2Amount": {
            "type": "number"
          },
          "DiscountD2Percentage": {
            "type": "number"
          },
          "DiscountD3Amount": {
            "type": "number"
          },
          "DiscountD3Percentage": {
            "type": "number"
          },
          "DiscountPercent": {
            "type": "number"
          },
          "HSN_SAC": {
            "type": "string"
          },
          "IsDiscountBeforeTax": {
            "type": "boolean"
          },
          "ItemRef": {
            "type": "string"
          },
          "LocationRefId": {
            "type": "string"
          },
          "PayeeRef": {
            "type": "string"
          },
          "PayeeType": {
            "type": "string"
          },
          "ProjectRefId": {
            "type": "string"
          },
          "Quantity": {
            "type": "number"
          },
          "Rate": {
            "type": "number"
          },
          "TaxAmount": {
            "type": "number"
          },
          "TaxRefId": {
            "type": "string"
          },
          "TemplateId": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "RecurringInvoiceLog": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `recurringInvoiceLog` record, from the published field contract (model `RecurringInvoiceLog`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "GeneratedOn": {
            "type": "string"
          },
          "InvoiceRefId": {
            "type": "string"
          },
          "Reason": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "TemplateId": {
            "type": "string"
          },
          "TriggeredBy": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "RevenueByCustomer": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `revenueByCustomer` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "Rfq": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `rfq` record, from the published field contract (model `RequestForQuote`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "Attachments": {
            "type": "object"
          },
          "AwardedAt": {
            "type": "string"
          },
          "CancellationReason": {
            "type": "string"
          },
          "CancelledAt": {
            "type": "string"
          },
          "ClosedAt": {
            "type": "string"
          },
          "Comment": {
            "type": "string"
          },
          "ConvertedPORefId": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "Currency": {
            "type": "string"
          },
          "DeliveryAddress": {
            "type": "object"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "ExpectedDeliveryDate": {
            "type": "string"
          },
          "FxSource": {
            "type": "string"
          },
          "Incoterm": {
            "type": "string"
          },
          "InternalNotes": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "PaymentTerms": {
            "type": "string"
          },
          "RFQNumber": {
            "type": "string"
          },
          "RequestDate": {
            "type": "string"
          },
          "ResponseDueDate": {
            "type": "string"
          },
          "SentAt": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "TaxType": {
            "type": "string"
          },
          "Title": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "VendorRef": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "SalesCreditNote": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `salesCreditNote` record, from the published field contract (model `SalesCreditNote`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AmountApplied": {
            "type": "number"
          },
          "AmountRefunded": {
            "type": "number"
          },
          "Attachments": {
            "type": "object"
          },
          "Branding": {
            "type": "string"
          },
          "ClassRef": {
            "type": "string"
          },
          "Comment": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "Currency": {
            "type": "string"
          },
          "CustomerRef": {
            "type": "string"
          },
          "DifferentialPercent": {
            "type": "number"
          },
          "EInvoiceCancelledAt": {
            "type": "string"
          },
          "EInvoiceGeneratedAt": {
            "type": "string"
          },
          "EInvoiceIRN": {
            "type": "string"
          },
          "EInvoiceId": {
            "type": "string"
          },
          "EInvoiceStatus": {
            "type": "string"
          },
          "EcommerceGSTIN": {
            "type": "string"
          },
          "EwbGeneratedAt": {
            "type": "string"
          },
          "EwbNo": {
            "type": "string"
          },
          "EwbRefId": {
            "type": "string"
          },
          "EwbStatus": {
            "type": "string"
          },
          "EwbValidUpto": {
            "type": "string"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "ExcludeFromEwb": {
            "type": "boolean"
          },
          "FinancialYear": {
            "type": "string"
          },
          "FunctionalTotalAmount": {
            "type": "number"
          },
          "FxRateDate": {
            "type": "string"
          },
          "FxSource": {
            "type": "string"
          },
          "GSTCategory": {
            "type": "string"
          },
          "InvoiceClass": {
            "type": "string"
          },
          "InvoiceRef": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "IsPartyGSTRegistered": {
            "type": "boolean"
          },
          "IsReverseCharge": {
            "type": "boolean"
          },
          "LocationRef": {
            "type": "string"
          },
          "MigrationBatchId": {
            "type": "string"
          },
          "NoteType": {
            "type": "string"
          },
          "OriginalInvoiceDate": {
            "type": "string"
          },
          "OriginalInvoiceNo": {
            "type": "string"
          },
          "PartyGSTIN": {
            "type": "string"
          },
          "PartyStateCode": {
            "type": "string"
          },
          "PlaceOfSupply": {
            "type": "string"
          },
          "ProjectRef": {
            "type": "string"
          },
          "Purpose": {
            "type": "string"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "Reference": {
            "type": "string"
          },
          "RemainingAmount": {
            "type": "number"
          },
          "SalesCreditNoteNumber": {
            "type": "string"
          },
          "SalesCreditNoteType": {
            "type": "string"
          },
          "SellerGSTIN": {
            "type": "string"
          },
          "ShopifyLinkedAt": {
            "type": "string"
          },
          "ShopifyOrderId": {
            "type": "string"
          },
          "ShopifyRefundId": {
            "type": "string"
          },
          "ShopifyShop": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "SupplyType": {
            "type": "string"
          },
          "TallyGuid": {
            "type": "string"
          },
          "TallyNumber": {
            "type": "string"
          },
          "TallyVoucherSeries": {
            "type": "string"
          },
          "TallyVoucherType": {
            "type": "string"
          },
          "TaxType": {
            "type": "string"
          },
          "TotalAmount": {
            "type": "number"
          },
          "TotalCGST": {
            "type": "number"
          },
          "TotalCess": {
            "type": "number"
          },
          "TotalCessNonAdvalorem": {
            "type": "number"
          },
          "TotalIGST": {
            "type": "number"
          },
          "TotalLabourAmount": {
            "type": "number"
          },
          "TotalSGST": {
            "type": "number"
          },
          "TotalSupplyAmount": {
            "type": "number"
          },
          "TotalTaxAmount": {
            "type": "number"
          },
          "TotalTaxableAmount": {
            "type": "number"
          },
          "TxnDate": {
            "type": "string",
            "readOnly": true
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "XeroId": {
            "type": "string"
          },
          "XeroLinkedAt": {
            "type": "string"
          },
          "XeroTenantId": {
            "type": "string"
          },
          "XeroUpdatedDateUTC": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "SalesCreditNoteLine": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `salesCreditNoteLine` record, from the published field contract (model `SalesCreditNoteLine`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AccountHeadRef": {
            "type": "string"
          },
          "Amount": {
            "type": "number"
          },
          "CGSTAmount": {
            "type": "number"
          },
          "CGSTRate": {
            "type": "number"
          },
          "CessAmount": {
            "type": "number"
          },
          "CessNonAdvaloremAmount": {
            "type": "number"
          },
          "CessNonAdvaloremRate": {
            "type": "number"
          },
          "CessRate": {
            "type": "number"
          },
          "ClassComponentRef1": {
            "type": "string"
          },
          "ClassComponentRef2": {
            "type": "string"
          },
          "ClassComponentRef3": {
            "type": "string"
          },
          "ClassComponentRef4": {
            "type": "string"
          },
          "ClassRef1": {
            "type": "string"
          },
          "ClassRef2": {
            "type": "string"
          },
          "ClassRef3": {
            "type": "string"
          },
          "ClassRef4": {
            "type": "string"
          },
          "Currency": {
            "type": "string"
          },
          "Description": {
            "type": "string"
          },
          "FreeQuantity": {
            "type": "number"
          },
          "FunctionalAmount": {
            "type": "number"
          },
          "GSTRate": {
            "type": "number"
          },
          "HSNCode": {
            "type": "string"
          },
          "HSN_SAC": {
            "type": "string"
          },
          "IGSTAmount": {
            "type": "number"
          },
          "IGSTRate": {
            "type": "number"
          },
          "ItemRef": {
            "type": "string"
          },
          "LabourAccountHeadRef": {
            "type": "string"
          },
          "LabourAmount": {
            "type": "number"
          },
          "LabourHSN_SAC": {
            "type": "string"
          },
          "LabourRate": {
            "type": "number"
          },
          "LabourTaxAmount": {
            "type": "number"
          },
          "LabourTaxRate": {
            "type": "number"
          },
          "LabourTaxRefId": {
            "type": "string"
          },
          "LineExchangeRate": {
            "type": "number"
          },
          "LocationRefId": {
            "type": "string"
          },
          "MarginValue": {
            "type": "number"
          },
          "NCCDAmount": {
            "type": "number"
          },
          "NCCDRate": {
            "type": "number"
          },
          "ProjectRefId": {
            "type": "string"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "Quantity": {
            "type": "number"
          },
          "Rate": {
            "type": "number"
          },
          "SGSTAmount": {
            "type": "number"
          },
          "SGSTRate": {
            "type": "number"
          },
          "SalesCreditNoteId": {
            "type": "string"
          },
          "SerialNumbers": {
            "type": "array"
          },
          "ShopifyRefundLineId": {
            "type": "string"
          },
          "StateCessAmount": {
            "type": "number"
          },
          "StateCessNonAdvaloremAmount": {
            "type": "number"
          },
          "StateCessNonAdvaloremRate": {
            "type": "number"
          },
          "StateCessRate": {
            "type": "number"
          },
          "SupplyAmount": {
            "type": "number"
          },
          "TaxAmount": {
            "type": "number"
          },
          "TaxClassification": {
            "type": "string"
          },
          "TaxRefId": {
            "type": "string"
          },
          "TaxableAmount": {
            "type": "number"
          },
          "UTGSTAmount": {
            "type": "number"
          },
          "UTGSTRate": {
            "type": "number"
          },
          "UnitRefId": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "SalesOrder": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `salesOrder` record, from the published field contract (model `SalesOrder`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "Addresses": {
            "type": "array"
          },
          "Attachments": {
            "type": "object"
          },
          "BrandingThemeId": {
            "type": "string"
          },
          "ClassRef": {
            "type": "string"
          },
          "ConvertedToInvoiceRef": {
            "type": "string"
          },
          "CounterpartyEntityRefId": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "Currency": {
            "type": "string"
          },
          "DueDate": {
            "type": "string"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "FinancialYear": {
            "type": "string"
          },
          "FunctionalTotalPayableAmount": {
            "type": "number"
          },
          "FxRateDate": {
            "type": "string"
          },
          "FxSource": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "IsInterCompany": {
            "type": "boolean"
          },
          "IsShippingSameAsBilling": {
            "type": "boolean"
          },
          "LocationRef": {
            "type": "string"
          },
          "MasterDiscountRef": {
            "type": "string"
          },
          "Notes": {
            "type": "string"
          },
          "OrderDate": {
            "type": "string",
            "readOnly": true
          },
          "OrderNumber": {
            "type": "string"
          },
          "PayeeRef": {
            "type": "string"
          },
          "PayeeType": {
            "type": "string"
          },
          "ProjectRef": {
            "type": "string"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "QuoteRef": {
            "type": "string"
          },
          "SelectedBillingAddressId": {
            "type": "string"
          },
          "SelectedShippingAddressId": {
            "type": "string"
          },
          "ShopifyLinkedAt": {
            "type": "string"
          },
          "ShopifyOrderId": {
            "type": "string"
          },
          "ShopifyOrderName": {
            "type": "string"
          },
          "ShopifyShop": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "SyncedToTally": {
            "type": "boolean"
          },
          "TallyGuid": {
            "type": "string"
          },
          "TallyVoucherType": {
            "type": "string"
          },
          "TaxType": {
            "type": "string"
          },
          "Terms": {
            "type": "object"
          },
          "TermsAndConditions": {
            "type": "object"
          },
          "TotalLabourAmount": {
            "type": "number"
          },
          "TotalPayableAmount": {
            "type": "number"
          },
          "TotalSupplyAmount": {
            "type": "number"
          },
          "TotalTaxAmount": {
            "type": "number"
          },
          "TotalTaxableAmount": {
            "type": "number"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "SalesOrderLine": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `salesOrderLine` record, from the published field contract (model `SalesOrderLine`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AccountHeadRef": {
            "type": "string"
          },
          "Amount": {
            "type": "number"
          },
          "BrandRefId": {
            "type": "string"
          },
          "ClassComponentRef1": {
            "type": "string"
          },
          "ClassComponentRef2": {
            "type": "string"
          },
          "ClassComponentRef3": {
            "type": "string"
          },
          "ClassComponentRef4": {
            "type": "string"
          },
          "ClassRef1": {
            "type": "string"
          },
          "ClassRef2": {
            "type": "string"
          },
          "ClassRef3": {
            "type": "string"
          },
          "ClassRef4": {
            "type": "string"
          },
          "Currency": {
            "type": "string"
          },
          "DeliveredQuantity": {
            "type": "number"
          },
          "Description": {
            "type": "string"
          },
          "DiscountAmount": {
            "type": "number"
          },
          "DiscountD2Amount": {
            "type": "number"
          },
          "DiscountD2Percentage": {
            "type": "number"
          },
          "DiscountD3Amount": {
            "type": "number"
          },
          "DiscountD3Percentage": {
            "type": "number"
          },
          "DiscountPercentage": {
            "type": "number"
          },
          "FunctionalAmount": {
            "type": "number"
          },
          "HSN_SAC": {
            "type": "string"
          },
          "InventoryQtyCommitted": {
            "type": "number"
          },
          "ItemRef": {
            "type": "string"
          },
          "LabourAccountHeadRef": {
            "type": "string"
          },
          "LabourAmount": {
            "type": "number"
          },
          "LabourHSN_SAC": {
            "type": "string"
          },
          "LabourRate": {
            "type": "number"
          },
          "LabourTaxAmount": {
            "type": "number"
          },
          "LabourTaxRate": {
            "type": "number"
          },
          "LabourTaxRefId": {
            "type": "string"
          },
          "LineExchangeRate": {
            "type": "number"
          },
          "LocationRef": {
            "type": "string"
          },
          "ProjectRef": {
            "type": "string"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "Quantity": {
            "type": "number"
          },
          "Rate": {
            "type": "number"
          },
          "SalesOrderId": {
            "type": "string"
          },
          "ShopifyLineId": {
            "type": "string"
          },
          "ShopifyVariantId": {
            "type": "string"
          },
          "SupplyAmount": {
            "type": "number"
          },
          "TaxAmount": {
            "type": "number"
          },
          "TaxRefId": {
            "type": "string"
          },
          "TaxableAmount": {
            "type": "number"
          },
          "UnitRefId": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "Taxation": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `taxation` record, from the published field contract (model `Taxation`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "CalculationMethod": {
            "type": "string"
          },
          "CountryRef": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CurrencyRef": {
            "type": "string"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "FxSource": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "IsSystemDefined": {
            "type": "boolean"
          },
          "Name": {
            "type": "string"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "TallyDepth": {
            "type": "integer"
          },
          "TallyExtras": {
            "type": "object"
          },
          "TallyGroupPath": {
            "type": "string"
          },
          "TallyGuid": {
            "type": "string"
          },
          "TallyLedgerName": {
            "type": "string"
          },
          "TallyParentGroup": {
            "type": "string"
          },
          "TallyPrimaryGroup": {
            "type": "string"
          },
          "TaxType": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "WaveBusinessId": {
            "type": "string"
          },
          "WaveId": {
            "type": "string"
          },
          "WaveLinkedAt": {
            "type": "string"
          },
          "XeroId": {
            "type": "string"
          },
          "XeroLinkedAt": {
            "type": "string"
          },
          "XeroTenantId": {
            "type": "string"
          },
          "XeroUpdatedDateUTC": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "Transaction": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `transaction` record, from the published field contract (model `Transaction`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AnomalyDetectedAt": {
            "type": "string"
          },
          "AnomalyDismissReason": {
            "type": "string"
          },
          "AnomalyDismissedAt": {
            "type": "string"
          },
          "AnomalyDismissedBy": {
            "type": "string"
          },
          "AnomalyLLMReason": {
            "type": "string"
          },
          "AnomalyReason": {
            "type": "array"
          },
          "AnomalyScore": {
            "type": "number"
          },
          "Attachments": {
            "type": "object"
          },
          "CategorizedStatus": {
            "type": "string"
          },
          "CategoryConfidence": {
            "type": "integer"
          },
          "CleanDescription": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CurrencyRef": {
            "type": "string"
          },
          "Description": {
            "type": "string"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "ExtractedPayeeName": {
            "type": "string"
          },
          "FromAccountRef": {
            "type": "string"
          },
          "FunctionalAmount": {
            "type": "number"
          },
          "FxRateDate": {
            "type": "string"
          },
          "FxSource": {
            "type": "string"
          },
          "GSTCategory": {
            "type": "string"
          },
          "HideFromReports": {
            "type": "boolean"
          },
          "IdempotencyKey": {
            "type": "string"
          },
          "InProcess": {
            "type": "boolean"
          },
          "IsAnomalous": {
            "type": "boolean"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "IsImported": {
            "type": "boolean"
          },
          "IsPartyGSTRegistered": {
            "type": "boolean"
          },
          "IsPending": {
            "type": "boolean"
          },
          "IsPublishedToQbo": {
            "type": "boolean"
          },
          "IsPublishedToWave": {
            "type": "boolean"
          },
          "IsReconciledWithClosingPeriod": {
            "type": "boolean"
          },
          "IsReconciliationAdjustment": {
            "type": "boolean"
          },
          "IsReverseCharge": {
            "type": "boolean"
          },
          "IsSplit": {
            "type": "boolean"
          },
          "IterationCount": {
            "type": "integer"
          },
          "LastCategorizedAt": {
            "type": "string"
          },
          "LastSourceUpgradeAt": {
            "type": "string"
          },
          "MatchCandidateCount": {
            "type": "integer"
          },
          "MatchCreatedPaymentIds": {
            "type": "array"
          },
          "MatchDocConfidence": {
            "type": "integer"
          },
          "MatchDocRef": {
            "type": "string"
          },
          "MatchDocType": {
            "type": "string"
          },
          "MatchMethod": {
            "type": "string"
          },
          "MatchReconciledPaymentIds": {
            "type": "array"
          },
          "Notes": {
            "type": "string"
          },
          "PartyGSTIN": {
            "type": "string"
          },
          "PartyStateCode": {
            "type": "string"
          },
          "PayeeConfidence": {
            "type": "integer"
          },
          "PayeeRef": {
            "type": "string"
          },
          "PayeeType": {
            "type": "string"
          },
          "PaymentAs": {
            "type": "string"
          },
          "PlaceOfSupply": {
            "type": "string"
          },
          "PlaidPendingTransactionId": {
            "type": "string"
          },
          "PostedByActionId": {
            "type": "string"
          },
          "PostsJournal": {
            "type": "boolean"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "Reason": {
            "type": "string"
          },
          "ReconcilePeriodRefId": {
            "type": "string"
          },
          "ReconciledAt": {
            "type": "string"
          },
          "ReconciliationMode": {
            "type": "string"
          },
          "Reference": {
            "type": "string"
          },
          "SecondarySourcesCount": {
            "type": "integer"
          },
          "ShopifyLinkedAt": {
            "type": "string"
          },
          "ShopifyPayoutId": {
            "type": "string"
          },
          "ShopifyShop": {
            "type": "string"
          },
          "Source": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "SuggestedPayeeRef": {
            "type": "string"
          },
          "SuggestedPayeeType": {
            "type": "string"
          },
          "SupplyType": {
            "type": "string"
          },
          "Tags": {
            "type": "object"
          },
          "TallyGuid": {
            "type": "string"
          },
          "TaxIntelligenceJson": {
            "type": "string"
          },
          "TaxType": {
            "type": "string"
          },
          "TotalAmount": {
            "type": "number"
          },
          "TotalCGST": {
            "type": "number"
          },
          "TotalCess": {
            "type": "number"
          },
          "TotalCessNonAdvalorem": {
            "type": "number"
          },
          "TotalIGST": {
            "type": "number"
          },
          "TotalIterCachedTokens": {
            "type": "integer"
          },
          "TotalIterInputTokens": {
            "type": "integer"
          },
          "TotalIterOutputTokens": {
            "type": "integer"
          },
          "TotalIterTotalINR": {
            "type": "number"
          },
          "TotalIterTotalUSD": {
            "type": "number"
          },
          "TotalSGST": {
            "type": "number"
          },
          "TotalUTGST": {
            "type": "number"
          },
          "TxnDate": {
            "type": "string"
          },
          "TxnMode": {
            "type": "string"
          },
          "TxnType": {
            "type": "string"
          },
          "Type": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string"
          },
          "WaveBusinessId": {
            "type": "string"
          },
          "WaveId": {
            "type": "string"
          },
          "WaveLinkedAt": {
            "type": "string"
          },
          "aiConfidence": {
            "type": "integer"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "TransactionCategorizationIteration": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `transactionCategorizationIteration` record, from the published field contract (model `TransactionCategorizationIteration`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "Breakdown": {
            "type": "object"
          },
          "CategoryCachedTokens": {
            "type": "integer"
          },
          "CategoryInputTokens": {
            "type": "integer"
          },
          "CategoryOutputTokens": {
            "type": "integer"
          },
          "CategoryTotalINR": {
            "type": "number"
          },
          "CategoryTotalUSD": {
            "type": "number"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "EndedAt": {
            "type": "string"
          },
          "IsFallback": {
            "type": "boolean"
          },
          "IterationNumber": {
            "type": "integer"
          },
          "Model": {
            "type": "string"
          },
          "ModelTier": {
            "type": "string"
          },
          "Notes": {
            "type": "object"
          },
          "PayeeCachedTokens": {
            "type": "integer"
          },
          "PayeeInputTokens": {
            "type": "integer"
          },
          "PayeeOutputTokens": {
            "type": "integer"
          },
          "PayeeTotalINR": {
            "type": "number"
          },
          "PayeeTotalUSD": {
            "type": "number"
          },
          "PricingContext": {
            "type": "object"
          },
          "Provider": {
            "type": "string"
          },
          "TransactionId": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "TransactionLine": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `transactionLine` record, from the published field contract (model `TransactionLine`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AIConfidence": {
            "type": "number"
          },
          "AIReasoning": {
            "type": "string"
          },
          "AISuggested": {
            "type": "boolean"
          },
          "Amount": {
            "type": "number"
          },
          "ClassComponentRef1": {
            "type": "string"
          },
          "ClassComponentRef2": {
            "type": "string"
          },
          "ClassComponentRef3": {
            "type": "string"
          },
          "ClassComponentRef4": {
            "type": "string"
          },
          "ClassRef1": {
            "type": "string"
          },
          "ClassRef2": {
            "type": "string"
          },
          "ClassRef3": {
            "type": "string"
          },
          "ClassRef4": {
            "type": "string"
          },
          "CleanDescription": {
            "type": "string"
          },
          "Currency": {
            "type": "string"
          },
          "CustomerRefId": {
            "type": "string"
          },
          "DepartmentRefId": {
            "type": "string"
          },
          "Description": {
            "type": "string"
          },
          "HSN_SAC": {
            "type": "string"
          },
          "ItemRef": {
            "type": "string"
          },
          "JobCostRef": {
            "type": "string"
          },
          "LocationRef": {
            "type": "string"
          },
          "ProjectRef": {
            "type": "string"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "Quantity": {
            "type": "string"
          },
          "SuggestedClassRef": {
            "type": "string"
          },
          "SuggestedJobCostRef": {
            "type": "string"
          },
          "SuggestedLocationRef": {
            "type": "string"
          },
          "SuggestedProjectRef": {
            "type": "string"
          },
          "SuggestedToAccountRef": {
            "type": "string"
          },
          "TaxAmount": {
            "type": "number"
          },
          "TaxRefId": {
            "type": "string"
          },
          "ToAccountRef": {
            "type": "string"
          },
          "TransactionId": {
            "type": "string"
          },
          "UnitPrice": {
            "type": "number"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "Transfer": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `transfer` record, from the published field contract (model `Transfer`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "Amount": {
            "type": "number"
          },
          "Attachments": {
            "type": "object"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CurrencyRef": {
            "type": "string"
          },
          "Description": {
            "type": "string"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "FromAccountRef": {
            "type": "string"
          },
          "FromAmount": {
            "type": "number"
          },
          "FromCurrencyRef": {
            "type": "string"
          },
          "FxRateDate": {
            "type": "string"
          },
          "FxSource": {
            "type": "string"
          },
          "IdempotencyKey": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "Reference": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "ToAccountRef": {
            "type": "string"
          },
          "ToAmount": {
            "type": "number"
          },
          "ToCurrencyRef": {
            "type": "string"
          },
          "TxnDate": {
            "type": "string",
            "readOnly": true
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "TrialBalance": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `trialBalance` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "Vendor": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `vendor` record, from the published field contract (model `Vendor`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AtcCode": {
            "type": "string"
          },
          "Attachments": {
            "type": "object"
          },
          "BirRdoCode": {
            "type": "string"
          },
          "BirTin": {
            "type": "string"
          },
          "CategorizationRule": {
            "type": "string"
          },
          "CisDeductionRate": {
            "type": "string"
          },
          "CisUTR": {
            "type": "string"
          },
          "CisVerificationDate": {
            "type": "string"
          },
          "CodiceDestinatario": {
            "type": "string"
          },
          "CodiceFiscale": {
            "type": "string"
          },
          "Comment": {
            "type": "string"
          },
          "CompanyName": {
            "type": "string"
          },
          "ContactDetails": {
            "type": "object"
          },
          "CountryOfResidence": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "Currency": {
            "type": "string"
          },
          "CustomFields": {
            "type": "object"
          },
          "CustomPaymentDays": {
            "type": "string"
          },
          "DefaultExpenseAccountRef": {
            "type": "string"
          },
          "DefaultPaymentTerm": {
            "type": "string"
          },
          "DefaultTaxRef": {
            "type": "string"
          },
          "DefaultTcsRefId": {
            "type": "string"
          },
          "DefaultTdsRefId": {
            "type": "string"
          },
          "DisplayName": {
            "type": "string"
          },
          "Dnd": {
            "type": "boolean"
          },
          "DndSetAt": {
            "type": "string"
          },
          "DndSource": {
            "type": "string"
          },
          "EfakturEnabled": {
            "type": "boolean"
          },
          "EfakturSertifikatSerial": {
            "type": "string"
          },
          "EwtExemptionCertNumber": {
            "type": "string"
          },
          "EwtExemptionIsRevoked": {
            "type": "boolean"
          },
          "EwtExemptionValidFrom": {
            "type": "string"
          },
          "EwtExemptionValidUntil": {
            "type": "string"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "FreistellungsbescheinigungIsRevoked": {
            "type": "boolean"
          },
          "FreistellungsbescheinigungIssuingFinanzamt": {
            "type": "string"
          },
          "FreistellungsbescheinigungNumber": {
            "type": "string"
          },
          "FreistellungsbescheinigungValidFrom": {
            "type": "string"
          },
          "FreistellungsbescheinigungValidUntil": {
            "type": "string"
          },
          "FxSource": {
            "type": "string"
          },
          "GensenChoshuSection": {
            "type": "string"
          },
          "GroupRef": {
            "type": "array"
          },
          "GustoCompanyId": {
            "type": "string"
          },
          "GustoContractorId": {
            "type": "string"
          },
          "GustoLinkedAt": {
            "type": "string"
          },
          "HboId": {
            "type": "string"
          },
          "IndustryName": {
            "type": "string"
          },
          "IndustryRefId": {
            "type": "string"
          },
          "Ir330CReceivedDate": {
            "type": "string"
          },
          "IrpfExemptCertNumber": {
            "type": "string"
          },
          "IrpfExemptValidUntil": {
            "type": "string"
          },
          "IrpfSection": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "IsBauabzugApplicable": {
            "type": "boolean"
          },
          "IsEwtApplicable": {
            "type": "boolean"
          },
          "IsGensenChoshuPayee": {
            "type": "boolean"
          },
          "IsIrpfApplicable": {
            "type": "boolean"
          },
          "IsPphWithholdable": {
            "type": "boolean"
          },
          "IsRctSubcontractor": {
            "type": "boolean"
          },
          "IsRitenutaApplicable": {
            "type": "boolean"
          },
          "IsSchedularExempt": {
            "type": "boolean"
          },
          "IsSchedularWithholdingApplicable": {
            "type": "boolean"
          },
          "IsSubcontractor": {
            "type": "boolean"
          },
          "IsTparReportable": {
            "type": "boolean"
          },
          "IsWhtApplicable": {
            "type": "boolean"
          },
          "LastEditedSystem": {
            "type": "string"
          },
          "MigrationBatchId": {
            "type": "string"
          },
          "OdooId": {
            "type": "integer"
          },
          "OdooLinkedAt": {
            "type": "string"
          },
          "OdooModel": {
            "type": "string"
          },
          "OdooWriteDate": {
            "type": "string"
          },
          "OriginId": {
            "type": "string"
          },
          "OriginSystem": {
            "type": "string"
          },
          "PartitaIVA": {
            "type": "string"
          },
          "PaymentNotes": {
            "type": "string"
          },
          "PecAddress": {
            "type": "string"
          },
          "PphArticle": {
            "type": "string"
          },
          "PphSection": {
            "type": "string"
          },
          "PphSkbIsRevoked": {
            "type": "boolean"
          },
          "PphSkbNumber": {
            "type": "string"
          },
          "PphSkbValidFrom": {
            "type": "string"
          },
          "PphSkbValidUntil": {
            "type": "string"
          },
          "PphTreatyRate": {
            "type": "number"
          },
          "PreferredPaymentMethod": {
            "type": "string"
          },
          "QboId": {
            "type": "string"
          },
          "QboLinkedAt": {
            "type": "string"
          },
          "QboRealmId": {
            "type": "string"
          },
          "QboSyncToken": {
            "type": "string"
          },
          "QualifiedInvoiceIssuerNumber": {
            "type": "string"
          },
          "RctDeductionRate": {
            "type": "number"
          },
          "RegimeFiscale": {
            "type": "string"
          },
          "ResidencyStatus": {
            "type": "string"
          },
          "RetencionIRPFRate": {
            "type": "number"
          },
          "RitenutaBaseBasis": {
            "type": "string"
          },
          "RitenutaCausale": {
            "type": "string"
          },
          "RitenutaExemptionIsRevoked": {
            "type": "boolean"
          },
          "RitenutaExemptionNumber": {
            "type": "string"
          },
          "RitenutaExemptionValidFrom": {
            "type": "string"
          },
          "RitenutaExemptionValidUntil": {
            "type": "string"
          },
          "SchedularActivityCode": {
            "type": "string"
          },
          "SchedularElectedRatePct": {
            "type": "number"
          },
          "SchedularExemptCertNumber": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "SyncVersion": {
            "type": "integer"
          },
          "TallyDepth": {
            "type": "integer"
          },
          "TallyExtras": {
            "type": "object"
          },
          "TallyGroupPath": {
            "type": "string"
          },
          "TallyGuid": {
            "type": "string"
          },
          "TallyLedgerName": {
            "type": "string"
          },
          "TallyParentGroup": {
            "type": "string"
          },
          "TallyPrimaryGroup": {
            "type": "string"
          },
          "TdsNotificationsEnabled": {
            "type": "boolean"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "VendorChartOfAccount": {
            "type": "array"
          },
          "VendorClass": {
            "type": "array"
          },
          "VendorLocation": {
            "type": "array"
          },
          "VendorProject": {
            "type": "array"
          },
          "VendorType": {
            "type": "string"
          },
          "WaveBusinessId": {
            "type": "string"
          },
          "WaveId": {
            "type": "string"
          },
          "WaveLinkedAt": {
            "type": "string"
          },
          "WhtCategory": {
            "type": "string"
          },
          "WhtDtaRate": {
            "type": "number"
          },
          "WhtExemptionIsRevoked": {
            "type": "boolean"
          },
          "WhtExemptionNumber": {
            "type": "string"
          },
          "WhtExemptionValidFrom": {
            "type": "string"
          },
          "WhtExemptionValidUntil": {
            "type": "string"
          },
          "XeroId": {
            "type": "string"
          },
          "XeroLinkedAt": {
            "type": "string"
          },
          "XeroTenantId": {
            "type": "string"
          },
          "XeroUpdatedDateUTC": {
            "type": "string"
          },
          "ZatcaCommercialRegNo": {
            "type": "string"
          },
          "ZatcaTin": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "VendorAddress": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `vendorAddress` record, from the published field contract (model `VendorAddress`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AddressType": {
            "type": "string"
          },
          "City": {
            "type": "string"
          },
          "Country": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "LineOne": {
            "type": "string"
          },
          "LineTwo": {
            "type": "string"
          },
          "Province": {
            "type": "string"
          },
          "VendorId": {
            "type": "string"
          },
          "ZipCode": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "VendorBalance": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `vendorBalance` record, from the published field contract (model `VendorBalance`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "Amount": {
            "type": "number"
          },
          "AsOfDate": {
            "type": "string"
          },
          "CurrencyRef": {
            "type": "string"
          },
          "FunctionalAmount": {
            "type": "number"
          },
          "Type": {
            "type": "string"
          },
          "VendorId": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "VendorContactPersons": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `vendorContactPersons` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "VendorCreditCard": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `vendorCreditCard` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "VendorDebitCard": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `vendorDebitCard` record. The publishable field contract for this resource is NOT yet published, so this description does not enumerate its fields. The response body is a JSON object whose shape is whatever the internal controller emits. Do not read the absence of properties here as 'this resource has no fields' — it means 'HelloBooks has not yet committed to a field list for it'. The contract lands in routes/publicApi.fields.generated.js; this file regenerates from it.",
        "x-hellobooks-field-contract": "unpublished"
      },
      "VendorGroup": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `vendorGroup` record, from the published field contract (model `VendorGroup`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "IsArchived": {
            "type": "boolean"
          },
          "Name": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "VendorPrepayment": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `vendorPrepayment` record, from the published field contract (model `VendorPrepayment`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AppliedAmount": {
            "type": "number"
          },
          "Attachments": {
            "type": "object"
          },
          "BankAccountRefId": {
            "type": "string"
          },
          "ChequeDate": {
            "type": "string"
          },
          "ChequeNumber": {
            "type": "string"
          },
          "ClassComponentRef": {
            "type": "string"
          },
          "ClassRef": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "CurrencyRef": {
            "type": "string"
          },
          "ExchangeRate": {
            "type": "number"
          },
          "FunctionalTotalAmount": {
            "type": "number"
          },
          "FxRateDate": {
            "type": "string"
          },
          "FxSource": {
            "type": "string"
          },
          "GSTCategory": {
            "type": "string"
          },
          "IdempotencyKey": {
            "type": "string"
          },
          "IsArchived": {
            "type": "boolean"
          },
          "IsPartyGSTRegistered": {
            "type": "boolean"
          },
          "IsReverseCharge": {
            "type": "boolean"
          },
          "IsTaxInclusive": {
            "type": "boolean"
          },
          "LocationRef": {
            "type": "string"
          },
          "Memo": {
            "type": "string"
          },
          "Notes": {
            "type": "string"
          },
          "PaidDate": {
            "type": "string",
            "readOnly": true
          },
          "PartyGSTIN": {
            "type": "string"
          },
          "PartyStateCode": {
            "type": "string"
          },
          "PaymentRefId": {
            "type": "string"
          },
          "PlaceOfSupply": {
            "type": "string"
          },
          "PrepaymentAccountRefId": {
            "type": "string"
          },
          "PrepaymentNumber": {
            "type": "string"
          },
          "PrevYearCarryFwd": {
            "type": "number"
          },
          "PurchaseOrderRefId": {
            "type": "string"
          },
          "RecurringBillTemplateRefId": {
            "type": "string"
          },
          "Reference": {
            "type": "string"
          },
          "ScheduleType": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "SupplyType": {
            "type": "string"
          },
          "TaxAmount": {
            "type": "number"
          },
          "TaxRefId": {
            "type": "string"
          },
          "TaxType": {
            "type": "string"
          },
          "TaxableAmount": {
            "type": "number"
          },
          "TdsAmount": {
            "type": "number"
          },
          "TdsBaseAmount": {
            "type": "number"
          },
          "TdsRate": {
            "type": "number"
          },
          "TdsRefId": {
            "type": "string"
          },
          "TotalAmount": {
            "type": "number"
          },
          "TransactionRefId": {
            "type": "string"
          },
          "UnappliedAmount": {
            "type": "number"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "VendorRefId": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "VendorPrepaymentApplication": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `vendorPrepaymentApplication` record, from the published field contract (model `VendorPrepaymentApplication`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "Amount": {
            "type": "number"
          },
          "AppliedDate": {
            "type": "string",
            "readOnly": true
          },
          "BillRefId": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "IdempotencyKey": {
            "type": "string"
          },
          "JournalId": {
            "type": "string"
          },
          "PaymentRefId": {
            "type": "string"
          },
          "PrepaymentId": {
            "type": "string"
          },
          "ScheduleId": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "VendorPrepaymentRecurringLink": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `vendorPrepaymentRecurringLink` record, from the published field contract (model `VendorPrepaymentRecurringLink`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AutoApplyPolicy": {
            "type": "integer"
          },
          "CarryForward": {
            "type": "integer"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "EffectiveFrom": {
            "type": "string"
          },
          "EffectiveTo": {
            "type": "string"
          },
          "FixedAmountPerCycle": {
            "type": "number"
          },
          "MaxPerCycleCap": {
            "type": "number"
          },
          "MinPerCycleFloor": {
            "type": "number"
          },
          "PercentOfBill": {
            "type": "number"
          },
          "PrepaymentId": {
            "type": "string"
          },
          "Priority": {
            "type": "integer"
          },
          "RecurringBillTemplateRefId": {
            "type": "string"
          },
          "Rounding": {
            "type": "integer"
          },
          "StopWhenFullyAdjusted": {
            "type": "boolean"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "VendorPrepaymentRefund": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `vendorPrepaymentRefund` record, from the published field contract (model `VendorPrepaymentRefund`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "Amount": {
            "type": "number"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "IdempotencyKey": {
            "type": "string"
          },
          "JournalId": {
            "type": "string"
          },
          "PaymentRefId": {
            "type": "string"
          },
          "PrepaymentId": {
            "type": "string"
          },
          "Reason": {
            "type": "string"
          },
          "RefundDate": {
            "type": "string",
            "readOnly": true
          },
          "Status": {
            "type": "string"
          },
          "TransactionRefId": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      },
      "VendorPrepaymentSchedule": {
        "type": "object",
        "additionalProperties": true,
        "description": "A `vendorPrepaymentSchedule` record, from the published field contract (model `VendorPrepaymentSchedule`). Additional properties are permitted because the runtime allowlist is not yet in enforce mode — see PUBLIC_API_FILTER_MODE.",
        "properties": {
          "AppliedAmount": {
            "type": "number"
          },
          "BillRefId": {
            "type": "string"
          },
          "CreatedAt": {
            "type": "string",
            "readOnly": true
          },
          "IsAdjusted": {
            "type": "boolean"
          },
          "PaymentRefId": {
            "type": "string"
          },
          "PeriodStart": {
            "type": "string"
          },
          "PrepaymentId": {
            "type": "string"
          },
          "ScheduledAmount": {
            "type": "number"
          },
          "Status": {
            "type": "string"
          },
          "UpdatedAt": {
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "readOnly": true
          }
        },
        "x-hellobooks-field-contract": "published"
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Missing, malformed, expired or revoked bearer token, or a disabled client.",
        "headers": {
          "RateLimit": {
            "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
            "schema": {
              "type": "string"
            }
          },
          "RateLimit-Policy": {
            "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
            "schema": {
              "type": "string"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GatewayError"
            },
            "examples": {
              "invalid_token": {
                "value": {
                  "error": "invalid_token",
                  "message": "Token invalid or expired."
                }
              },
              "invalid_client": {
                "value": {
                  "error": "invalid_client",
                  "message": "Client disabled."
                }
              }
            }
          }
        }
      },
      "Forbidden": {
        "description": "Denied. THREE different bodies land on this status: the token is not bound to the org/entity in the path (`tenant_scope_violation`), the token lacks the scope the route requires (`insufficient_scope`), or the organisation's plan does not include API access — which returns the entitlement shape, not the gateway shape.",
        "headers": {
          "RateLimit": {
            "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
            "schema": {
              "type": "string"
            }
          },
          "RateLimit-Policy": {
            "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
            "schema": {
              "type": "string"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/GatewayError"
                },
                {
                  "$ref": "#/components/schemas/EntitlementError"
                }
              ]
            },
            "examples": {
              "tenant_scope_violation": {
                "value": {
                  "error": "tenant_scope_violation",
                  "message": "Token not authorized for this entity."
                }
              },
              "insufficient_scope": {
                "value": {
                  "error": "insufficient_scope",
                  "message": "Missing scope: book:write",
                  "required": [
                    "book:write"
                  ]
                }
              },
              "plan_denied": {
                "value": {
                  "success": false,
                  "error": {
                    "code": "FEATURE_NOT_IN_PLAN",
                    "plan": "free",
                    "upgradeTo": "pro",
                    "upgradeUrl": "/settings/subscription?intent=upgrade",
                    "feature": "ApiAccess"
                  }
                }
              }
            }
          }
        }
      },
      "PaymentRequired": {
        "description": "The tenant's AI-credit wallet cannot cover this request. Charged before any tenant work; the deduction settles only on a <400 response.",
        "headers": {
          "RateLimit": {
            "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
            "schema": {
              "type": "string"
            }
          },
          "RateLimit-Policy": {
            "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
            "schema": {
              "type": "string"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AiCreditsError"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Rate limit exceeded for this (clientId, installId) pair. Default 120 requests per 60s; see the description at the top of this document for the per-app override and the plan-derived ceiling.",
        "headers": {
          "RateLimit": {
            "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
            "schema": {
              "type": "string"
            }
          },
          "RateLimit-Policy": {
            "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
            "schema": {
              "type": "string"
            }
          },
          "Retry-After": {
            "description": "Seconds until the window resets.",
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GatewayError"
            },
            "examples": {
              "rate_limited": {
                "value": {
                  "error": "rate_limited",
                  "message": "Public API rate limit exceeded."
                }
              }
            }
          }
        }
      },
      "ServerError": {
        "description": "Unhandled failure. The generic resource gateway also returns 500 with `controller_load_failed` or `handler_missing` when a registry row names a controller or export that does not resolve — binding is lazy and per-request, so a bad row fails on its own route rather than at boot.",
        "headers": {
          "RateLimit": {
            "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
            "schema": {
              "type": "string"
            }
          },
          "RateLimit-Policy": {
            "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
            "schema": {
              "type": "string"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GatewayError"
            }
          }
        }
      },
      "ServiceUnavailable": {
        "description": "The AI-credit balance check itself was unavailable.",
        "headers": {
          "RateLimit": {
            "description": "RFC 9651 draft-8 structured field, e.g. `\"default\"; r=118; t=41` — remaining requests and seconds until the window resets.",
            "schema": {
              "type": "string"
            }
          },
          "RateLimit-Policy": {
            "description": "Draft-8 policy, e.g. `\"default\"; q=120; w=60; pk=:mkt:<clientId>:<installId>:` — quota, window in seconds, and the partition key the quota is counted against.",
            "schema": {
              "type": "string"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AiCreditsError"
            }
          }
        }
      }
    }
  },
  "x-hellobooks-generated": {
    "generator": "scripts/generate-openapi.js",
    "doNotEdit": "Regenerate with `node scripts/generate-openapi.js`. tests/publicApiOpenapi.test.js fails if this file is edited by hand or left stale.",
    "inputs": {
      "registry": "routes/publicApi.resources.js",
      "routes": "routes/publicApi.routes.js",
      "scopeCatalog": "utils/marketplaceScopes.util.js",
      "scopeVocabulary": "utils/publicApiScopes.util.js — every operation's scope is produced by that module's scopeFor(), never synthesised here",
      "factoryScopeExpressions": {
        "read": "scopeFor(r.scope, \"read\")",
        "write": "scopeFor(r.scope, \"write\")"
      },
      "fieldContract": "present (routes/publicApi.contract.js); 76 of 105 resources have a published field baseline",
      "uncontractedListSource": "middlewares/publicApiSerialize.middleware.js"
    },
    "coverage": {
      "registryResources": 105,
      "factoryOperations": 471,
      "handWrittenOperations": 20,
      "totalOperations": 491,
      "operationsWithPublishedFieldContract": 376,
      "operationsWithoutPublishedFieldContract": 115
    },
    "pathTemplateOverlaps": [
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/account/{id}",
          "/orgs/{orgId}/entities/{entityId}/account/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/bill/{id}",
          "/orgs/{orgId}/entities/{entityId}/bill/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/billAddress/{id}",
          "/orgs/{orgId}/entities/{entityId}/billAddress/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/businessOwner/{id}",
          "/orgs/{orgId}/entities/{entityId}/businessOwner/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/cashbook/{id}",
          "/orgs/{orgId}/entities/{entityId}/cashbook/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/class/{id}",
          "/orgs/{orgId}/entities/{entityId}/class/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/comment/{id}",
          "/orgs/{orgId}/entities/{entityId}/comment/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/customer/{id}",
          "/orgs/{orgId}/entities/{entityId}/customer/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/customerAddress/{id}",
          "/orgs/{orgId}/entities/{entityId}/customerAddress/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/customerAdvance/{id}",
          "/orgs/{orgId}/entities/{entityId}/customerAdvance/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/customerContactPersons/{id}",
          "/orgs/{orgId}/entities/{entityId}/customerContactPersons/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/customerCreditCard/{id}",
          "/orgs/{orgId}/entities/{entityId}/customerCreditCard/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/customerDebitCard/{id}",
          "/orgs/{orgId}/entities/{entityId}/customerDebitCard/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/customerGroup/{id}",
          "/orgs/{orgId}/entities/{entityId}/customerGroup/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/deliveryChallan/{id}",
          "/orgs/{orgId}/entities/{entityId}/deliveryChallan/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/deliveryChallanAddress/{id}",
          "/orgs/{orgId}/entities/{entityId}/deliveryChallanAddress/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/deliveryChallanLine/{id}",
          "/orgs/{orgId}/entities/{entityId}/deliveryChallanLine/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/employee/{id}",
          "/orgs/{orgId}/entities/{entityId}/employee/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/employeeAddress/{id}",
          "/orgs/{orgId}/entities/{entityId}/employeeAddress/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/employeeCreditCard/{id}",
          "/orgs/{orgId}/entities/{entityId}/employeeCreditCard/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/employeeDebitCard/{id}",
          "/orgs/{orgId}/entities/{entityId}/employeeDebitCard/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/fixedAsset/{id}",
          "/orgs/{orgId}/entities/{entityId}/fixedAsset/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/goodReceiptNoteLine/{id}",
          "/orgs/{orgId}/entities/{entityId}/goodReceiptNoteLine/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/goodReceiptNotes/{id}",
          "/orgs/{orgId}/entities/{entityId}/goodReceiptNotes/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/invoice/{id}",
          "/orgs/{orgId}/entities/{entityId}/invoice/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/invoiceAddress/{id}",
          "/orgs/{orgId}/entities/{entityId}/invoiceAddress/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/invoiceLinkedBill/{id}",
          "/orgs/{orgId}/entities/{entityId}/invoiceLinkedBill/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/item/{id}",
          "/orgs/{orgId}/entities/{entityId}/item/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/lead/{id}",
          "/orgs/{orgId}/entities/{entityId}/lead/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/linkedSalesCreditNoteInvoice/{id}",
          "/orgs/{orgId}/entities/{entityId}/linkedSalesCreditNoteInvoice/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/location/{id}",
          "/orgs/{orgId}/entities/{entityId}/location/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/payment/{id}",
          "/orgs/{orgId}/entities/{entityId}/payment/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/project/{id}",
          "/orgs/{orgId}/entities/{entityId}/project/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/purchaseCreditNote/{id}",
          "/orgs/{orgId}/entities/{entityId}/purchaseCreditNote/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/purchaseOrder/{id}",
          "/orgs/{orgId}/entities/{entityId}/purchaseOrder/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/purchaseOrderAddress/{id}",
          "/orgs/{orgId}/entities/{entityId}/purchaseOrderAddress/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/purchaseRequest/{id}",
          "/orgs/{orgId}/entities/{entityId}/purchaseRequest/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/quote/{id}",
          "/orgs/{orgId}/entities/{entityId}/quote/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/reconcile-period/{id}",
          "/orgs/{orgId}/entities/{entityId}/reconcile-period/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/recurringBill/{id}",
          "/orgs/{orgId}/entities/{entityId}/recurringBill/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/recurringInvoice/{id}",
          "/orgs/{orgId}/entities/{entityId}/recurringInvoice/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/recurringInvoiceAttachment/{id}",
          "/orgs/{orgId}/entities/{entityId}/recurringInvoiceAttachment/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/recurringInvoiceLineItem/{id}",
          "/orgs/{orgId}/entities/{entityId}/recurringInvoiceLineItem/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/recurringInvoiceLog/{id}",
          "/orgs/{orgId}/entities/{entityId}/recurringInvoiceLog/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/rfq/{id}",
          "/orgs/{orgId}/entities/{entityId}/rfq/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/salesCreditNote/{id}",
          "/orgs/{orgId}/entities/{entityId}/salesCreditNote/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/salesOrder/{id}",
          "/orgs/{orgId}/entities/{entityId}/salesOrder/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/taxation/{id}",
          "/orgs/{orgId}/entities/{entityId}/taxation/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/transaction/{id}",
          "/orgs/{orgId}/entities/{entityId}/transaction/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/transfer/{id}",
          "/orgs/{orgId}/entities/{entityId}/transfer/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/vendor/{id}",
          "/orgs/{orgId}/entities/{entityId}/vendor/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/vendorAddress/{id}",
          "/orgs/{orgId}/entities/{entityId}/vendorAddress/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/vendorGroup/{id}",
          "/orgs/{orgId}/entities/{entityId}/vendorGroup/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/vendorPrepayment/{id}",
          "/orgs/{orgId}/entities/{entityId}/vendorPrepayment/restore"
        ],
        "methods": [
          [
            "get"
          ],
          [
            "put"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      },
      {
        "paths": [
          "/orgs/{orgId}/entities/{entityId}/webhooks/deliveries/purge",
          "/orgs/{orgId}/entities/{entityId}/webhooks/deliveries/{deliveryId}"
        ],
        "methods": [
          [
            "post"
          ],
          [
            "get"
          ]
        ],
        "sharedMethods": [],
        "methodDisjoint": true
      }
    ],
    "declaredUncontractedPrefixes": [
      "/health",
      "/me",
      "/orgs/:orgId/entities/:entityId/customers",
      "/orgs/:orgId/entities/:entityId/books",
      "/orgs/:orgId/entities/:entityId/webhooks",
      "/orgs/:orgId/entities/:entityId/document-sequence-numbers"
    ],
    "knownGaps": [
      "Field-level request/response schemas are unpublished for every resource (empty contract baseline).",
      "`owner:close` and `audit:export` remain in the marketplace catalog but gate no /public/v1 route; they are enforced by AI-MCP-Hellobooks only.",
      "55 pairs of path templates overlap — one URL can match both. 54 are the resource factory's `/{id}` vs `/restore` shape; 1 involve a parameter at a different position. Express resolves them by registration order. All are method-disjoint, so no request is actually routed ambiguously. Full list in x-hellobooks-generated.pathTemplateOverlaps.",
      "Success bodies use resource-named top-level keys rather than one envelope, so the payload key is not described per operation.",
      "No business event is ever enqueued for webhook delivery — MEASURED: the delivery worker starts unconditionally and POSTs with an HMAC signature, but nothing in the codebase produces a job for it. A subscription therefore receives no callbacks on its own. The only deliveries that occur are those an app triggers itself through the test and replay endpoints, which do send for real."
    ]
  }
}