{"site":{"title":"Calibre API","description":"The Calibre API: read understood invoices with per-field confidence and provenance, run accounts-payable workflows, and keep your ERP master data in sync.","baseUrlPlaceholder":"https://{your-api-host}"},"version":"1.0.0","groups":{"invoices":{"title":"Invoices","card":"Read each invoice with per-field confidence and provenance, correct fields, and get analytics.","intro":"Every invoice Calibre reads becomes an **understanding result**: the header fields, line items and tax, each with a confidence score and its provenance (the page, the position and the method that produced it), plus the validation findings and a review decision.\n\n* **Results and corrections**: list and retrieve results, and correct a field when a reviewer fixes it.\n* **Analytics**: counts, queue depth, automation rates, spend and vendor performance for your dashboards.\n\nThe [InvoiceUnderstandingResult](#/schema/InvoiceUnderstandingResult) model describes the full result."},"ap":{"title":"Accounts payable","card":"Approvals, coding, PO matching, posting to the ERP, payments, comments and GST checks.","intro":"The workflow after an invoice is understood: assignment, approvals, GL coding and PO matching, posting to your ERP, payment tracking, comments and vendor emails, and GST checks.\n\nMost endpoints act on one invoice, by its Calibre ID. Changes are recorded against the user the token was issued to and appear in the invoice’s [activity](#/op/get-ap-invoices-invoice_id-activity)."},"bootstrap":{"title":"Bootstrap training","card":"Teach Calibre your vendors from invoices you have already booked, before you go live.","intro":"Bootstrap training teaches Calibre your vendors before go-live, using invoices you have already booked. For each one you send the PDF and the invoice as booked in your ERP. Calibre reads the PDF, compares the two, and learns from every difference.\n\n1. [Create a run](#/op/post-bootstrap-runs).\n2. [Submit invoices](#/op/post-bootstrap-runs-run_id-invoices) to it, one request per invoice.\n3. Follow progress with [Retrieve a run](#/op/get-bootstrap-runs-run_id) and [Get readiness](#/op/get-bootstrap-runs-run_id-readiness).\n4. [Close the run](#/op/post-bootstrap-runs-run_id-close) once every invoice has finished processing."},"automation":{"title":"Automation","card":"Record QA verdicts and read the automation threshold and weekly scorecard.","intro":"Calibre approves an invoice automatically only when its confidence clears a threshold. People check a QA sample of those invoices, and their verdicts keep the threshold honest: if QA finds too many errors, Calibre raises it, so fewer invoices are approved automatically."},"master-data":{"title":"Master data","card":"Sync companies, vendors, accounts, tax codes and the rest of your ERP reference data.","intro":"Your ERP stays the system of record. Calibre keeps a copy of its reference data so it can match vendors, accounts, tax codes and purchase orders on every invoice. Push changes from your ERP with the sync endpoints.\n\nEvery entity has the same five endpoints:\n\n| Endpoint | What it does |\n|---|---|\n| `GET /master-data/{entity}` | List, search and sort. |\n| `POST /master-data/{entity}` | Sync in bulk. Safe to repeat. |\n| `GET /master-data/{entity}/{externalId}` | Retrieve one record. |\n| `PUT /master-data/{entity}/{externalId}` | Update the fields you send. |\n| `DELETE /master-data/{entity}/{externalId}` | Deactivate, keeping the record. |\n\nFields are camelCase, and records are identified by your ERP’s own key, `externalId`."}},"subOrder":{"invoices":["Results and corrections","Analytics"],"ap":["Invoice workflow","Approvals","Coding and PO matching","Posting","Payments","Comments and vendor messages","GST compliance","Activity","Split and merge"],"master-data":["Companies","Vendors","Accounts","Tax codes","Payment terms","Currencies","Units of measure","Products","Purchase orders","Dimensions"]},"pages":[{"id":"overview","title":"Overview","heading":"Calibre API","lede":"The Calibre API gives your systems the same results your team sees in Calibre.","md":"* **Read understood invoices.** Every field comes with a confidence score and its provenance: the page, the position and the method that produced it.\n* **Run accounts-payable workflows.** Approvals, coding, PO matching, posting, payments, comments and GST checks.\n* **Keep master data in sync.** Push vendors, accounts, tax codes and the rest from your ERP. Syncs are safe to repeat.\n* **Train on your history.** Submit invoices you have already booked, and Calibre learns your vendors before go-live.\n\n## Hosts\n\nCalibre gives you two hosts during onboarding: the **API host** and the **sign-in host** that issues tokens. The examples in these docs read them from environment variables:\n\n```bash\nexport CALIBRE_API_URL=\"https://…\"    # your API host\nexport CALIBRE_AUTH_URL=\"https://…\"   # your sign-in host\n```\n\n## Quickstart\n\n**1. Get an access token** with your client credentials:\n\n```bash\nexport CALIBRE_TOKEN=$(curl -s -X POST \"$CALIBRE_AUTH_URL/oauth/token\" \\\n  -d grant_type=client_credentials \\\n  -d client_id=\"$CALIBRE_CLIENT_ID\" \\\n  -d client_secret=\"$CALIBRE_CLIENT_SECRET\" | jq -r .access_token)\n```\n\n**2. Call the API** with the token:\n\n```bash\ncurl \"$CALIBRE_API_URL/invoices?limit=10\" \\\n  -H \"Authorization: Bearer $CALIBRE_TOKEN\"\n```\n\nThe response lists your ten newest invoices, with vendor names resolved from your master data. [List invoices](#/op/get-invoices) describes every filter."},{"id":"authentication","title":"Authentication","heading":"Authentication","lede":"The API uses OAuth 2.0 with the client-credentials grant. You exchange your client ID and secret for a short-lived token, and send that token on every request.","md":"## Get a token\n\nSend a `POST` to `/oauth/token` on your sign-in host. Put the credentials in the body (form-encoded or JSON), or send them as HTTP Basic authentication.\n\n| Field | Required | Description |\n|---|---|---|\n| `grant_type` | Yes | Always `client_credentials`. |\n| `client_id` | Yes | Your client ID, unless you use HTTP Basic. |\n| `client_secret` | Yes | Your client secret, unless you use HTTP Basic. |\n| `scope` | No | Space-separated scopes to request. Leave it out to receive every scope your client holds. |\n\n```bash\ncurl -X POST \"$CALIBRE_AUTH_URL/oauth/token\" \\\n  -d grant_type=client_credentials \\\n  -d client_id=\"$CALIBRE_CLIENT_ID\" \\\n  -d client_secret=\"$CALIBRE_CLIENT_SECRET\"\n```\n\n```json\n{\n  \"access_token\": \"eyJhbGciOi…\",\n  \"token_type\": \"Bearer\",\n  \"expires_in\": 900,\n  \"scope\": \"master_data:read master_data:write invoices:read\"\n}\n```\n\nRequest a new token before `expires_in` seconds pass. Tokens are signed JWTs, and the public keys are published at `/.well-known/jwks.json` on the sign-in host.\n\n## Call the API\n\nSend the token in the `Authorization` header of every request:\n\n```http\nAuthorization: Bearer <access_token>\n```\n\n**Your organisation comes from the token.** There is no tenant header, and no request can read or change another organisation’s data.\n\n## Scopes\n\nEach endpoint lists the scopes that authorise it, and a token needs any one of them. Write scopes include the matching read access.\n\n| Scope | Grants |\n|---|---|\n| `master_data:read` | Read master data. |\n| `master_data:write` | Sync and edit master data. Also creates and reads bootstrap runs. |\n| `invoices:read` | Read invoices, analytics and automation state. |\n| `invoices:review` | Correct fields and record QA verdicts. Includes `invoices:read`. |\n| `ap:read` | Read accounts-payable data. |\n| `ap:write` | Assign, approve, code, post, record payments and comment. Includes `ap:read`. |\n| `bootstrap:read` | Read bootstrap runs and readiness. |\n| `bootstrap:write` | Create, feed, close and cancel bootstrap runs. Includes `bootstrap:read`. |\n\n## Auth errors\n\n| Status | Error code | Meaning |\n|---|---|---|\n| 401 | `missing_bearer` | The request has no `Authorization: Bearer` header. |\n| 401 | `invalid_token` | The token is expired, malformed or not signed by Calibre. |\n| 403 | `insufficient_scope` | The token is valid but holds none of the scopes the endpoint accepts. |\n\nThe token endpoint itself answers `invalid_client` (401), `invalid_scope` (400) or `unsupported_grant_type` (400).\n\n> Keep the client secret on your server. Never ship it in a browser or mobile app."},{"id":"conventions","title":"Conventions","heading":"Conventions","lede":"The rules every endpoint follows: naming, money, dates, pagination and errors.","md":"## Format\n\n* Requests and responses are JSON (`Content-Type: application/json`) unless an endpoint says otherwise.\n* **Money and rates are strings**, for example `\"1500.00\"`, so no precision is lost. Never send or expect floats for money.\n* **Timestamps** are ISO 8601 in UTC. Dates are `YYYY-MM-DD`.\n* **Master data** uses camelCase (`externalId`, `isActive`). Other resources use snake_case (`review_status`, `vendor_name`).\n* Master-data records are identified by your ERP’s own key, `externalId`.\n\n## Pagination\n\nList endpoints take `limit` and `offset`, and return one page with the full `total`:\n\n```json\n{ \"items\": [ … ], \"total\": 142, \"limit\": 50, \"offset\": 0 }\n```\n\nMaster-data lists also take `sort` (`field`, or `-field` for descending), `q` to search, and `active` (`active`, `inactive` or `all`).\n\n## Safe to repeat\n\n`POST /master-data/{entity}` takes an array of records and matches each on `externalId`, creating, updating, deactivating or restoring as needed. Sending the same payload twice leaves the same state and creates no duplicates. A record with an older `externalUpdatedAt` never overwrites newer data.\n\n## Deleting master data\n\n`DELETE` on master data marks the record inactive (`isActive: false`) and keeps it, so past invoices still resolve. A later sync with `isActive: true` restores it.\n\n## Errors\n\nErrors use one envelope:\n\n```json\n{ \"error\": \"entity_not_found\", \"detail\": null }\n```\n\n| Status | Meaning |\n|---|---|\n| 401 | The token is missing or invalid. See [Authentication](#/authentication). |\n| 403 | The token lacks a scope the endpoint accepts. |\n| 404 | The record does not exist in your organisation. |\n| 409 | The request conflicts with the record’s current state. |\n| 422 | The request is invalid. |\n\nBranch on `error`, which is stable. `detail` is written for people and may change.\n\nWhen a request body or parameter fails schema validation, the 422 lists each problem instead:\n\n```json\n{ \"detail\": [ { \"loc\": [\"body\", \"amount\"], \"msg\": \"Input should be a valid decimal\", \"type\": \"decimal_parsing\" } ] }\n```"}],"ops":[{"id":"get-invoices","method":"get","path":"/invoices","group":"invoices","sub":"Results and corrections","title":"List invoices","description":"Returns your invoices, newest first unless you choose a `sort`, with vendor names resolved from your master data. Combine the filters below to narrow the list.","parameters":[{"name":"review_status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ReviewStatus"},{"type":"null"}]},"description":"Only invoices with this review status."},{"name":"doc_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Only documents of this type: `tax_invoice`, `credit_note`, `debit_note`, `rcm_invoice` or `unknown`."},{"name":"vendor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Only vendors whose name contains this text. Not case-sensitive."},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Search vendor names and invoice numbers."},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"description":"Only invoices dated on or after this day (YYYY-MM-DD)."},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"description":"Only invoices dated on or before this day (YYYY-MM-DD)."},{"name":"amount_min","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}]},"description":"Only invoices whose total is at least this amount."},{"name":"amount_max","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}]},"description":"Only invoices whose total is at most this amount."},{"name":"exceptions_only","in":"query","required":false,"schema":{"type":"boolean","default":false},"description":"Only invoices with a hard validation finding, a suspected duplicate or a PO mismatch."},{"name":"assigned_to_user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Only invoices assigned to this user."},{"name":"pending_for_me","in":"query","required":false,"schema":{"type":"boolean","default":false},"description":"Only invoices whose current approval step the caller can decide. The caller is the user the token was issued to."},{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Field to sort by. Prefix with `-` for descending: `invoice_date`, `total_amount`, `document_confidence`, `vendor_name`, `review_status`, `doc_type` or `created_at`."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50},"description":"Maximum number of items to return."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0},"description":"Number of items to skip before the first one returned. Use with `limit` to page through results."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceListResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["invoices:read","invoices:review"]},{"id":"get-invoices-invoice_id","method":"get","path":"/invoices/{invoice_id}","group":"invoices","sub":"Results and corrections","title":"Retrieve an invoice","description":"Returns everything Calibre understood from one invoice: each extracted field with its confidence score and provenance (the page, position and method that produced it), the line items and tax, the validation findings and the review decision.","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice’s Calibre ID."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceUnderstandingResult"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["invoices:read","invoices:review"]},{"id":"post-invoices-invoice_id-fields-field_key-correct","method":"post","path":"/invoices/{invoice_id}/fields/{field_key}/correct","group":"invoices","sub":"Results and corrections","title":"Correct a field","description":"Records a reviewer’s correction to one extracted field. Calibre learns from corrections, so later invoices are read better.\n\nCall it with a user’s token: the correction is recorded against that person.","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice’s Calibre ID."},{"name":"field_key","in":"path","required":true,"schema":{"type":"string"},"description":"The field to correct, for example `invoice_number` or `total_amount`."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldCorrectionRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CorrectionAcceptedResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["invoices:review"]},{"id":"get-invoices-aggregate-status-counts","method":"get","path":"/invoices/aggregate/status-counts","group":"invoices","sub":"Analytics","title":"Count invoices by status","description":"Returns how many of your invoices are in each review status.","parameters":[],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusCountsResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["invoices:read","invoices:review"]},{"id":"get-invoices-aggregate-queue-depth","method":"get","path":"/invoices/aggregate/queue-depth","group":"invoices","sub":"Analytics","title":"Get the review queue","description":"Returns how many invoices, and how many individual fields, are waiting for review.","parameters":[],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueueDepthResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["invoices:read","invoices:review"]},{"id":"get-invoices-aggregate-auto-approve-rate","method":"get","path":"/invoices/aggregate/auto-approve-rate","group":"invoices","sub":"Analytics","title":"Get the auto-approval rate","description":"Returns the share of invoices approved automatically, per day, week or month.","parameters":[{"name":"granularity","in":"query","required":false,"schema":{"type":"string","default":"day"},"description":"Bucket size: `day`, `week` or `month`."},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"description":"Only invoices received on or after this time (ISO 8601)."},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"description":"Only invoices received on or before this time (ISO 8601)."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoApproveRateResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["invoices:read","invoices:review"]},{"id":"get-invoices-aggregate-spend-by-vendor","method":"get","path":"/invoices/aggregate/spend-by-vendor","group":"invoices","sub":"Analytics","title":"List top vendors by spend","description":"Returns the vendors with the highest total invoiced amount, largest first.","parameters":[{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"description":"Only invoices dated on or after this day (YYYY-MM-DD)."},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"description":"Only invoices dated on or before this day (YYYY-MM-DD)."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":20},"description":"Maximum number of vendors to return."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpendByVendorResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["invoices:read","invoices:review"]},{"id":"get-invoices-aggregate-analytics-overview","method":"get","path":"/invoices/aggregate/analytics-overview","group":"invoices","sub":"Analytics","title":"Get the analytics overview","description":"Returns spend and throughput trends, spend by category, and headline automation rates over a fixed recent period.","parameters":[],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsOverviewResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["invoices:read","invoices:review"]},{"id":"get-invoices-aggregate-vendor-performance","method":"get","path":"/invoices/aggregate/vendor-performance","group":"invoices","sub":"Analytics","title":"Get vendor performance","description":"Returns one row per vendor: invoice count, total spend, exception rate, duplicates, average confidence, whether the GSTIN is valid and the on-time payment rate.","parameters":[],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/VendorPerformanceRow"},"title":"Response Vendor Performance Invoices Aggregate Vendor Performance Get"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["invoices:read","invoices:review"]},{"id":"get-ap-invoices-invoice_id","method":"get","path":"/ap/invoices/{invoice_id}","group":"ap","sub":"Invoice workflow","title":"Retrieve an AP invoice","description":"Returns the invoice’s accounts-payable record: approval and coding status, assignee, and any invoice it replaces or is replaced by. Calibre creates the record the first time it is read.","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice’s Calibre ID."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApInvoiceResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:read","ap:write"]},{"id":"post-ap-invoices-invoice_id-assign","method":"post","path":"/ap/invoices/{invoice_id}/assign","group":"ap","sub":"Invoice workflow","title":"Assign an invoice","description":"Assigns the invoice to a teammate. Send `\"user_id\": null` to unassign it.","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice’s Calibre ID."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignInvoiceRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApInvoiceResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:write"]},{"id":"get-ap-approval-policy","method":"get","path":"/ap/approval-policy","group":"ap","sub":"Approvals","title":"Retrieve the approval policy","description":"Returns your approval policy: the amount ladder that decides who approves, the amount below which invoices need no approval, and whether segregation of duties and approval limits are enforced.","parameters":[],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalPolicy"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:read","ap:write"]},{"id":"put-ap-approval-policy","method":"put","path":"/ap/approval-policy","group":"ap","sub":"Approvals","title":"Replace the approval policy","description":"Replaces the whole approval policy. Rules you leave out are removed.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalPolicyInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalPolicy"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:write"]},{"id":"get-ap-invoices-invoice_id-approval","method":"get","path":"/ap/invoices/{invoice_id}/approval","group":"ap","sub":"Approvals","title":"Retrieve an approval","description":"Returns the invoice’s approval chain, the step it is on and the last decision.","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice’s Calibre ID."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalState"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:read","ap:write"]},{"id":"post-ap-invoices-invoice_id-approval-actions","method":"post","path":"/ap/invoices/{invoice_id}/approval/actions","group":"ap","sub":"Approvals","title":"Decide an approval step","description":"Approves, rejects, holds or asks for more information on the invoice’s current approval step.\n\nCall it with a user’s token. Calibre checks that this person may decide the step: their role, any delegation, their approval limit and segregation of duties. You cannot name the approver in the request.","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice’s Calibre ID."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalActionRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalState"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:write"]},{"id":"get-ap-delegations","method":"get","path":"/ap/delegations","group":"ap","sub":"Approvals","title":"List delegations","description":"Returns your organisation’s approval delegations.","parameters":[],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Delegation"},"title":"Response List Delegations Ap Delegations Get"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:read","ap:write"]},{"id":"post-ap-delegations","method":"post","path":"/ap/delegations","group":"ap","sub":"Approvals","title":"Create a delegation","description":"Lets one person approve on another’s behalf between two times, optionally only up to an amount.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDelegationRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Delegation"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:write"]},{"id":"delete-ap-delegations-delegation_id","method":"delete","path":"/ap/delegations/{delegation_id}","group":"ap","sub":"Approvals","title":"Revoke a delegation","description":"Ends the delegation. Returns no content.","parameters":[{"name":"delegation_id","in":"path","required":true,"schema":{"type":"string"},"description":"The delegation’s ID."}],"requestBody":null,"responses":{"204":{"description":"No Content"},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:write"]},{"id":"get-ap-invoices-invoice_id-coding","method":"get","path":"/ap/invoices/{invoice_id}/coding","group":"ap","sub":"Coding and PO matching","title":"Retrieve the coding","description":"Returns the invoice’s GL coding lines. The first time it is read, Calibre suggests a split based on the vendor’s past invoices.","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice’s Calibre ID."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceCoding"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:read","ap:write"]},{"id":"put-ap-invoices-invoice_id-coding","method":"put","path":"/ap/invoices/{invoice_id}/coding","group":"ap","sub":"Coding and PO matching","title":"Replace the coding","description":"Replaces all of the invoice’s GL coding lines with the ones you send.","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice’s Calibre ID."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CodingLineInput"},"title":"Body"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceCoding"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:write"]},{"id":"get-ap-invoices-invoice_id-lines","method":"get","path":"/ap/invoices/{invoice_id}/lines","group":"ap","sub":"Coding and PO matching","title":"List invoice lines","description":"Returns the invoice’s editable expense and item lines. Each item line is compared with its purchase-order line.","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice’s Calibre ID."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceLinesResult"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:read","ap:write"]},{"id":"put-ap-invoices-invoice_id-lines","method":"put","path":"/ap/invoices/{invoice_id}/lines","group":"ap","sub":"Coding and PO matching","title":"Update invoice lines","description":"Saves edited expense and item lines. When item lines change, Calibre matches them against the PO again. Send `\"rematch\": false` to save without re-matching; the match is then marked stale until you re-run it.","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice’s Calibre ID."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInvoiceLinesInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceLinesResult"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:write"]},{"id":"put-ap-invoices-invoice_id-dimensions","method":"put","path":"/ap/invoices/{invoice_id}/dimensions","group":"ap","sub":"Coding and PO matching","title":"Set header dimensions","description":"Sets or clears the invoice’s header-level ERP dimensions, such as cost centre or project. Only dimension types switched on in dimension settings are accepted.","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice’s Calibre ID."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInvoiceDimensionsInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceLinesResult"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:write"]},{"id":"put-ap-invoices-invoice_id-po-header","method":"put","path":"/ap/invoices/{invoice_id}/po-header","group":"ap","sub":"Coding and PO matching","title":"Change the vendor or PO","description":"Links the invoice to a different vendor or purchase order from your master data, then matches the lines again. Send `\"rematch\": false` to skip re-matching.","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice’s Calibre ID."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePoHeaderInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceLinesResult"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:write"]},{"id":"post-ap-invoices-invoice_id-rematch","method":"post","path":"/ap/invoices/{invoice_id}/rematch","group":"ap","sub":"Coding and PO matching","title":"Re-run PO matching","description":"Matches the invoice’s item lines against its purchase order again, using the current master data.","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice’s Calibre ID."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceLinesResult"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:write"]},{"id":"get-ap-purchase-orders-po_external_id-line-matches","method":"get","path":"/ap/purchase-orders/{po_external_id}/line-matches","group":"ap","sub":"Coding and PO matching","title":"List PO line matches","description":"For each line of a purchase order, returns the invoices matched to it and the quantities ordered, billed in the ERP, matched but not yet posted, and still open.","parameters":[{"name":"po_external_id","in":"path","required":true,"schema":{"type":"string"},"description":"The purchase order’s `externalId` in your master data."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoLineMatchesResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:read","ap:write"]},{"id":"get-ap-dimension-settings","method":"get","path":"/ap/dimension-settings","group":"ap","sub":"Coding and PO matching","title":"Retrieve dimension settings","description":"Lists the ERP dimension types synced into your master data, each with whether invoices use it.","parameters":[],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DimensionSettingsResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:read","ap:write"]},{"id":"put-ap-dimension-settings","method":"put","path":"/ap/dimension-settings","group":"ap","sub":"Coding and PO matching","title":"Update dimension settings","description":"Switches dimension types on or off for invoices. Only types synced from your ERP are accepted.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDimensionSettingsInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DimensionSettingsResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:write"]},{"id":"get-ap-invoices-invoice_id-posting","method":"get","path":"/ap/invoices/{invoice_id}/posting","group":"ap","sub":"Posting","title":"Retrieve posting status","description":"Returns where the invoice stands in posting to your ERP and, once posted, the ERP’s document number.","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice’s Calibre ID."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostingStateResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:read","ap:write"]},{"id":"post-ap-invoices-invoice_id-post-request","method":"post","path":"/ap/invoices/{invoice_id}/post-request","group":"ap","sub":"Posting","title":"Post to the ERP","description":"Queues the invoice for posting to your ERP and returns `202` straight away. Check **Retrieve posting status** for the outcome.\n\nCalibre refuses to post when something must change first:\n\n| Status | Error code | Meaning |\n|---|---|---|\n| 409 | `approval_pending`, `held`, `rejected`, `info_requested` | The approval is not complete. |\n| 409 | `already_posted`, `processing` | The invoice is posted or being posted. |\n| 422 | `lines_do_not_reconcile` | The lines do not add up to the invoice amounts. `detail` gives the difference. |\n| 422 | `duplicate`, `review_failed`, `no_erp` | A suspected duplicate, a failed review, or no ERP connection. |","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice’s Calibre ID."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostRequestInput"}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostRequestAcceptedResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:write"]},{"id":"get-ap-payments","method":"get","path":"/ap/payments","group":"ap","sub":"Payments","title":"List payments","description":"Returns payment status for your invoices, one row per invoice. Calibre tracks payments; it does not move money.","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Only payments with this status, such as `scheduled`, `partially_paid`, `paid` or `overdue`."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50},"description":"Maximum number of items to return."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0},"description":"Number of items to skip before the first one returned. Use with `limit` to page through results."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentListResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:read","ap:write"]},{"id":"get-ap-aging-report","method":"get","path":"/ap/aging-report","group":"ap","sub":"Payments","title":"Get the aging report","description":"Returns what you owe in aging buckets (current, 1–30, 31–60, 61–90 and over 90 days), in total and by vendor.","parameters":[],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgingReport"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:read","ap:write"]},{"id":"get-ap-invoices-invoice_id-payment","method":"get","path":"/ap/invoices/{invoice_id}/payment","group":"ap","sub":"Payments","title":"Retrieve payment status","description":"Returns the invoice’s payment status, the amount paid so far and the amount still due.","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice’s Calibre ID."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:read","ap:write"]},{"id":"post-ap-invoices-invoice_id-payment-schedule","method":"post","path":"/ap/invoices/{invoice_id}/payment/schedule","group":"ap","sub":"Payments","title":"Schedule a payment","description":"Records the date and method you plan to pay the invoice. Calibre tracks the plan; your bank or ERP makes the payment.","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice’s Calibre ID."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchedulePaymentInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:write"]},{"id":"post-ap-invoices-invoice_id-payment-record","method":"post","path":"/ap/invoices/{invoice_id}/payment/record","group":"ap","sub":"Payments","title":"Record a payment","description":"Records a payment made against the invoice. Partial payments are supported: each recorded payment adds to the amount paid.","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice’s Calibre ID."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordPaymentInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:write"]},{"id":"get-ap-invoices-invoice_id-comments","method":"get","path":"/ap/invoices/{invoice_id}/comments","group":"ap","sub":"Comments and vendor messages","title":"List comments","description":"Returns the invoice’s comment thread, oldest first.","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice’s Calibre ID."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Comment"},"title":"Response List Comments Ap Invoices  Invoice Id  Comments Get"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:read","ap:write"]},{"id":"post-ap-invoices-invoice_id-comments","method":"post","path":"/ap/invoices/{invoice_id}/comments","group":"ap","sub":"Comments and vendor messages","title":"Add a comment","description":"Adds a comment to the invoice. @-mentions are matched to people in your approver directory.","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice’s Calibre ID."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCommentInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Comment"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:write"]},{"id":"post-ap-invoices-invoice_id-vendor-messages","method":"post","path":"/ap/invoices/{invoice_id}/vendor-messages","group":"ap","sub":"Comments and vendor messages","title":"Email the vendor","description":"Sends an email about this invoice to the vendor. Calibre takes the vendor’s address from your master data, so the request never carries it.","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice’s Calibre ID."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendVendorMessageInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorMessage"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:write"]},{"id":"get-ap-gst-gstin-gstin-validate","method":"get","path":"/ap/gst/gstin/{gstin}/validate","group":"ap","sub":"GST compliance","title":"Validate a GSTIN","description":"Checks a GSTIN’s format, check digit and state code. The check runs inside Calibre and does not contact the GST portal.","parameters":[{"name":"gstin","in":"path","required":true,"schema":{"type":"string"},"description":"The 15-character GSTIN to check."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GstinValidation"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:read","ap:write"]},{"id":"post-ap-gst-irn-validate","method":"post","path":"/ap/gst/irn/validate","group":"ap","sub":"GST compliance","title":"Validate an IRN","description":"Checks an e-invoice’s IRN with the Invoice Registration Portal and stores the acknowledgement number and date.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateIrnRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IrnValidation"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:write"]},{"id":"get-ap-gst-reconciliation","method":"get","path":"/ap/gst/reconciliation","group":"ap","sub":"GST compliance","title":"Get the GSTR-2B reconciliation","description":"Compares the GST on your invoices with GSTR-2B for one return period, by vendor: matched, mismatched, and missing on either side, with the input tax credit at risk.","parameters":[{"name":"period","in":"query","required":true,"schema":{"type":"string"},"description":"The return period, as `YYYY-MM`."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GstReconSummary"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:read","ap:write"]},{"id":"get-ap-activity","method":"get","path":"/ap/activity","group":"ap","sub":"Activity","title":"List recent activity","description":"Returns recent activity across all your invoices.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50},"description":"Maximum number of items to return."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0},"description":"Number of items to skip before the first one returned. Use with `limit` to page through results."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivityListResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:read","ap:write"]},{"id":"get-ap-invoices-invoice_id-activity","method":"get","path":"/ap/invoices/{invoice_id}/activity","group":"ap","sub":"Activity","title":"List an invoice’s activity","description":"Returns the invoice’s audit trail, newest first.","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice’s Calibre ID."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ActivityEvent"},"title":"Response Get Invoice Activity Ap Invoices  Invoice Id  Activity Get"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:read","ap:write"]},{"id":"post-ap-invoices-invoice_id-split-request","method":"post","path":"/ap/invoices/{invoice_id}/split-request","group":"ap","sub":"Split and merge","title":"Split a document","description":"Asks Calibre to split a document that holds several invoices into separate invoices. Processing happens in the background.","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice’s Calibre ID."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SplitRequestInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SplitRequestAcceptedResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:write"]},{"id":"post-ap-merge-request","method":"post","path":"/ap/merge-request","group":"ap","sub":"Split and merge","title":"Merge documents","description":"Asks Calibre to merge several documents into one invoice. Processing happens in the background.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeRequestInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeRequestAcceptedResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["ap:write"]},{"id":"post-bootstrap-runs","method":"post","path":"/bootstrap/runs","group":"bootstrap","sub":null,"title":"Create a run","description":"Opens a bootstrap training run. Submit your historical invoices to it, watch readiness, then close it.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRunRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["bootstrap:write","master_data:write"]},{"id":"post-bootstrap-runs-run_id-invoices","method":"post","path":"/bootstrap/runs/{run_id}/invoices","group":"bootstrap","sub":null,"title":"Submit an invoice","description":"Uploads one historical invoice: the PDF and the invoice as it was booked in your ERP. Calibre reads the PDF, compares what it read with your ERP, and learns from every difference.\n\nReturns `202`: processing happens in the background. Track it with **Retrieve a run**. Submitting the same PDF again is safe; the response says whether it was a repeat (`idempotent`).","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string"},"description":"The bootstrap run’s ID, returned when you create the run."}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/SubmitInvoiceForm"}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntakeResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["bootstrap:write","master_data:write"]},{"id":"get-bootstrap-runs-run_id","method":"get","path":"/bootstrap/runs/{run_id}","group":"bootstrap","sub":null,"title":"Retrieve a run","description":"Returns the run’s state and counters: invoices submitted, processed, matched to your ERP, unverifiable and failed, and corrections written.","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string"},"description":"The bootstrap run’s ID, returned when you create the run."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["bootstrap:read","bootstrap:write","master_data:read","master_data:write"]},{"id":"get-bootstrap-runs-run_id-readiness","method":"get","path":"/bootstrap/runs/{run_id}/readiness","group":"bootstrap","sub":null,"title":"Get readiness","description":"Returns readiness for each vendor and the accuracy forecast on held-out invoices: the signal for when to go live.","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string"},"description":"The bootstrap run’s ID, returned when you create the run."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadinessReport"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["bootstrap:read","bootstrap:write","master_data:read","master_data:write"]},{"id":"post-bootstrap-runs-run_id-close","method":"post","path":"/bootstrap/runs/{run_id}/close","group":"bootstrap","sub":null,"title":"Close a run","description":"Completes the run. Every submitted invoice must have finished processing first.","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string"},"description":"The bootstrap run’s ID, returned when you create the run."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["bootstrap:write","master_data:write"]},{"id":"post-bootstrap-runs-run_id-cancel","method":"post","path":"/bootstrap/runs/{run_id}/cancel","group":"bootstrap","sub":null,"title":"Cancel a run","description":"Cancels the run and stops invoices that are still processing.","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string"},"description":"The bootstrap run’s ID, returned when you create the run."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["bootstrap:write","master_data:write"]},{"id":"get-automation-state","method":"get","path":"/automation/state","group":"automation","sub":null,"title":"Retrieve automation state","description":"Returns whether automatic approval is on, the confidence threshold in force, whether Calibre is still warming up, QA results so far and recent threshold changes.","parameters":[],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationStateResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["invoices:read","invoices:review"]},{"id":"get-automation-scorecard","method":"get","path":"/automation/scorecard","group":"automation","sub":null,"title":"Get the weekly scorecard","description":"Returns the scorecard for one week: straight-through rate, QA precision, correction rates and review time, split by how much history Calibre has with each vendor.","parameters":[{"name":"week","in":"query","required":true,"schema":{"type":"string","format":"date"},"description":"Any day in the week you want, as YYYY-MM-DD. Weeks run Monday to Sunday."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WeeklyScorecard"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["invoices:read","invoices:review"]},{"id":"post-automation-verdicts-invoice_id","method":"post","path":"/automation/verdicts/{invoice_id}","group":"automation","sub":null,"title":"Record a QA verdict","description":"Records a reviewer’s verdict on an invoice: which critical fields, if any, were wrong. If QA finds too many errors, Calibre raises its confidence threshold so fewer invoices are approved automatically.\n\nCall it with a user’s token: the verdict is recorded against that person.","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice’s Calibre ID."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerdictRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerdictResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["invoices:review"]},{"id":"get-master-data-companies","method":"get","path":"/master-data/companies","group":"master-data","sub":"Companies","title":"List companies","description":"Returns your companies, active ones by default. Search with `q`, sort with `sort`, and page with `limit` and `offset`.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50},"description":"Maximum number of items to return."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0},"description":"Number of items to skip before the first one returned. Use with `limit` to page through results."},{"name":"active","in":"query","required":false,"schema":{"type":"string","default":"active"},"description":"Which records to return: `active` (the default), `inactive` or `all`."},{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Field to sort by, in camelCase. Prefix with `-` for descending."},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Text to search for. Not case-sensitive. Matches any field of the record unless you set `q_field`."},{"name":"q_field","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Search only this field (camelCase), for example `name`."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_CompanyRead_"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:read","master_data:write"]},{"id":"post-master-data-companies","method":"post","path":"/master-data/companies","group":"master-data","sub":"Companies","title":"Sync companies","description":"Creates or updates companies in bulk. Send an array; each record is matched on its `externalId`. Sending the same payload again changes nothing, and a record with an older `externalUpdatedAt` never overwrites newer data. Send `isActive: false` to deactivate a company, and `true` to restore it.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CompanyUpsert"},"title":"Payload"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncResult"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"get-master-data-companies-external_id","method":"get","path":"/master-data/companies/{external_id}","group":"master-data","sub":"Companies","title":"Retrieve a company","description":"Returns one company by its `externalId`, whether it is active or not.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:read","master_data:write"]},{"id":"put-master-data-companies-external_id","method":"put","path":"/master-data/companies/{external_id}","group":"master-data","sub":"Companies","title":"Update a company","description":"Updates the fields you send and leaves the others unchanged.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyUpsert"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"delete-master-data-companies-external_id","method":"delete","path":"/master-data/companies/{external_id}","group":"master-data","sub":"Companies","title":"Delete a company","description":"Deactivates the company (`isActive: false`) but keeps it, so past invoices still resolve. Sync it with `isActive: true` to restore it.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"get-master-data-vendors","method":"get","path":"/master-data/vendors","group":"master-data","sub":"Vendors","title":"List vendors","description":"Returns your vendors, active ones by default. Search with `q`, sort with `sort`, and page with `limit` and `offset`.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50},"description":"Maximum number of items to return."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0},"description":"Number of items to skip before the first one returned. Use with `limit` to page through results."},{"name":"active","in":"query","required":false,"schema":{"type":"string","default":"active"},"description":"Which records to return: `active` (the default), `inactive` or `all`."},{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Field to sort by, in camelCase. Prefix with `-` for descending."},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Text to search for. Not case-sensitive. Matches any field of the record unless you set `q_field`."},{"name":"q_field","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Search only this field (camelCase), for example `name`."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_VendorRead_"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:read","master_data:write"]},{"id":"post-master-data-vendors","method":"post","path":"/master-data/vendors","group":"master-data","sub":"Vendors","title":"Sync vendors","description":"Creates or updates vendors in bulk. Send an array; each record is matched on its `externalId`. Sending the same payload again changes nothing, and a record with an older `externalUpdatedAt` never overwrites newer data. Send `isActive: false` to deactivate a vendor, and `true` to restore it.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/VendorUpsert"},"title":"Payload"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncResult"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"get-master-data-vendors-external_id","method":"get","path":"/master-data/vendors/{external_id}","group":"master-data","sub":"Vendors","title":"Retrieve a vendor","description":"Returns one vendor by its `externalId`, whether it is active or not.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:read","master_data:write"]},{"id":"put-master-data-vendors-external_id","method":"put","path":"/master-data/vendors/{external_id}","group":"master-data","sub":"Vendors","title":"Update a vendor","description":"Updates the fields you send and leaves the others unchanged.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorUpsert"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"delete-master-data-vendors-external_id","method":"delete","path":"/master-data/vendors/{external_id}","group":"master-data","sub":"Vendors","title":"Delete a vendor","description":"Deactivates the vendor (`isActive: false`) but keeps it, so past invoices still resolve. Sync it with `isActive: true` to restore it.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"get-master-data-accounts","method":"get","path":"/master-data/accounts","group":"master-data","sub":"Accounts","title":"List accounts","description":"Returns your accounts, active ones by default. Search with `q`, sort with `sort`, and page with `limit` and `offset`.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50},"description":"Maximum number of items to return."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0},"description":"Number of items to skip before the first one returned. Use with `limit` to page through results."},{"name":"active","in":"query","required":false,"schema":{"type":"string","default":"active"},"description":"Which records to return: `active` (the default), `inactive` or `all`."},{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Field to sort by, in camelCase. Prefix with `-` for descending."},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Text to search for. Not case-sensitive. Matches any field of the record unless you set `q_field`."},{"name":"q_field","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Search only this field (camelCase), for example `name`."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_AccountRead_"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:read","master_data:write"]},{"id":"post-master-data-accounts","method":"post","path":"/master-data/accounts","group":"master-data","sub":"Accounts","title":"Sync accounts","description":"Creates or updates accounts in bulk. Send an array; each record is matched on its `externalId`. Sending the same payload again changes nothing, and a record with an older `externalUpdatedAt` never overwrites newer data. Send `isActive: false` to deactivate an account, and `true` to restore it.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccountUpsert"},"title":"Payload"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncResult"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"get-master-data-accounts-external_id","method":"get","path":"/master-data/accounts/{external_id}","group":"master-data","sub":"Accounts","title":"Retrieve an account","description":"Returns one account by its `externalId`, whether it is active or not.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:read","master_data:write"]},{"id":"put-master-data-accounts-external_id","method":"put","path":"/master-data/accounts/{external_id}","group":"master-data","sub":"Accounts","title":"Update an account","description":"Updates the fields you send and leaves the others unchanged.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountUpsert"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"delete-master-data-accounts-external_id","method":"delete","path":"/master-data/accounts/{external_id}","group":"master-data","sub":"Accounts","title":"Delete an account","description":"Deactivates the account (`isActive: false`) but keeps it, so past invoices still resolve. Sync it with `isActive: true` to restore it.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"get-master-data-tax-codes","method":"get","path":"/master-data/tax-codes","group":"master-data","sub":"Tax codes","title":"List tax codes","description":"Returns your tax codes, active ones by default. Search with `q`, sort with `sort`, and page with `limit` and `offset`.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50},"description":"Maximum number of items to return."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0},"description":"Number of items to skip before the first one returned. Use with `limit` to page through results."},{"name":"active","in":"query","required":false,"schema":{"type":"string","default":"active"},"description":"Which records to return: `active` (the default), `inactive` or `all`."},{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Field to sort by, in camelCase. Prefix with `-` for descending."},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Text to search for. Not case-sensitive. Matches any field of the record unless you set `q_field`."},{"name":"q_field","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Search only this field (camelCase), for example `name`."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_TaxCodeRead_"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:read","master_data:write"]},{"id":"post-master-data-tax-codes","method":"post","path":"/master-data/tax-codes","group":"master-data","sub":"Tax codes","title":"Sync tax codes","description":"Creates or updates tax codes in bulk. Send an array; each record is matched on its `externalId`. Sending the same payload again changes nothing, and a record with an older `externalUpdatedAt` never overwrites newer data. Send `isActive: false` to deactivate a tax code, and `true` to restore it.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TaxCodeUpsert"},"title":"Payload"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncResult"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"get-master-data-tax-codes-external_id","method":"get","path":"/master-data/tax-codes/{external_id}","group":"master-data","sub":"Tax codes","title":"Retrieve a tax code","description":"Returns one tax code by its `externalId`, whether it is active or not.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxCodeRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:read","master_data:write"]},{"id":"put-master-data-tax-codes-external_id","method":"put","path":"/master-data/tax-codes/{external_id}","group":"master-data","sub":"Tax codes","title":"Update a tax code","description":"Updates the fields you send and leaves the others unchanged.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxCodeUpsert"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxCodeRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"delete-master-data-tax-codes-external_id","method":"delete","path":"/master-data/tax-codes/{external_id}","group":"master-data","sub":"Tax codes","title":"Delete a tax code","description":"Deactivates the tax code (`isActive: false`) but keeps it, so past invoices still resolve. Sync it with `isActive: true` to restore it.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxCodeRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"get-master-data-payment-terms","method":"get","path":"/master-data/payment-terms","group":"master-data","sub":"Payment terms","title":"List payment terms","description":"Returns your payment terms, active ones by default. Search with `q`, sort with `sort`, and page with `limit` and `offset`.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50},"description":"Maximum number of items to return."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0},"description":"Number of items to skip before the first one returned. Use with `limit` to page through results."},{"name":"active","in":"query","required":false,"schema":{"type":"string","default":"active"},"description":"Which records to return: `active` (the default), `inactive` or `all`."},{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Field to sort by, in camelCase. Prefix with `-` for descending."},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Text to search for. Not case-sensitive. Matches any field of the record unless you set `q_field`."},{"name":"q_field","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Search only this field (camelCase), for example `name`."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_PaymentTermRead_"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:read","master_data:write"]},{"id":"post-master-data-payment-terms","method":"post","path":"/master-data/payment-terms","group":"master-data","sub":"Payment terms","title":"Sync payment terms","description":"Creates or updates payment terms in bulk. Send an array; each record is matched on its `externalId`. Sending the same payload again changes nothing, and a record with an older `externalUpdatedAt` never overwrites newer data. Send `isActive: false` to deactivate a payment term, and `true` to restore it.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PaymentTermUpsert"},"title":"Payload"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncResult"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"get-master-data-payment-terms-external_id","method":"get","path":"/master-data/payment-terms/{external_id}","group":"master-data","sub":"Payment terms","title":"Retrieve a payment term","description":"Returns one payment term by its `externalId`, whether it is active or not.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentTermRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:read","master_data:write"]},{"id":"put-master-data-payment-terms-external_id","method":"put","path":"/master-data/payment-terms/{external_id}","group":"master-data","sub":"Payment terms","title":"Update a payment term","description":"Updates the fields you send and leaves the others unchanged.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentTermUpsert"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentTermRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"delete-master-data-payment-terms-external_id","method":"delete","path":"/master-data/payment-terms/{external_id}","group":"master-data","sub":"Payment terms","title":"Delete a payment term","description":"Deactivates the payment term (`isActive: false`) but keeps it, so past invoices still resolve. Sync it with `isActive: true` to restore it.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentTermRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"get-master-data-currencies","method":"get","path":"/master-data/currencies","group":"master-data","sub":"Currencies","title":"List currencies","description":"Returns your currencies, active ones by default. Search with `q`, sort with `sort`, and page with `limit` and `offset`.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50},"description":"Maximum number of items to return."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0},"description":"Number of items to skip before the first one returned. Use with `limit` to page through results."},{"name":"active","in":"query","required":false,"schema":{"type":"string","default":"active"},"description":"Which records to return: `active` (the default), `inactive` or `all`."},{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Field to sort by, in camelCase. Prefix with `-` for descending."},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Text to search for. Not case-sensitive. Matches any field of the record unless you set `q_field`."},{"name":"q_field","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Search only this field (camelCase), for example `name`."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_CurrencyRead_"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:read","master_data:write"]},{"id":"post-master-data-currencies","method":"post","path":"/master-data/currencies","group":"master-data","sub":"Currencies","title":"Sync currencies","description":"Creates or updates currencies in bulk. Send an array; each record is matched on its `externalId`. Sending the same payload again changes nothing, and a record with an older `externalUpdatedAt` never overwrites newer data. Send `isActive: false` to deactivate a currency, and `true` to restore it.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CurrencyUpsert"},"title":"Payload"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncResult"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"get-master-data-currencies-external_id","method":"get","path":"/master-data/currencies/{external_id}","group":"master-data","sub":"Currencies","title":"Retrieve a currency","description":"Returns one currency by its `externalId`, whether it is active or not.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrencyRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:read","master_data:write"]},{"id":"put-master-data-currencies-external_id","method":"put","path":"/master-data/currencies/{external_id}","group":"master-data","sub":"Currencies","title":"Update a currency","description":"Updates the fields you send and leaves the others unchanged.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrencyUpsert"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrencyRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"delete-master-data-currencies-external_id","method":"delete","path":"/master-data/currencies/{external_id}","group":"master-data","sub":"Currencies","title":"Delete a currency","description":"Deactivates the currency (`isActive: false`) but keeps it, so past invoices still resolve. Sync it with `isActive: true` to restore it.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrencyRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"get-master-data-unit-of-measures","method":"get","path":"/master-data/unit-of-measures","group":"master-data","sub":"Units of measure","title":"List units of measure","description":"Returns your units of measure, active ones by default. Search with `q`, sort with `sort`, and page with `limit` and `offset`.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50},"description":"Maximum number of items to return."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0},"description":"Number of items to skip before the first one returned. Use with `limit` to page through results."},{"name":"active","in":"query","required":false,"schema":{"type":"string","default":"active"},"description":"Which records to return: `active` (the default), `inactive` or `all`."},{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Field to sort by, in camelCase. Prefix with `-` for descending."},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Text to search for. Not case-sensitive. Matches any field of the record unless you set `q_field`."},{"name":"q_field","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Search only this field (camelCase), for example `name`."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_UnitOfMeasureRead_"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:read","master_data:write"]},{"id":"post-master-data-unit-of-measures","method":"post","path":"/master-data/unit-of-measures","group":"master-data","sub":"Units of measure","title":"Sync units of measure","description":"Creates or updates units of measure in bulk. Send an array; each record is matched on its `externalId`. Sending the same payload again changes nothing, and a record with an older `externalUpdatedAt` never overwrites newer data. Send `isActive: false` to deactivate a unit of measure, and `true` to restore it.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UnitOfMeasureUpsert"},"title":"Payload"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncResult"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"get-master-data-unit-of-measures-external_id","method":"get","path":"/master-data/unit-of-measures/{external_id}","group":"master-data","sub":"Units of measure","title":"Retrieve a unit of measure","description":"Returns one unit of measure by its `externalId`, whether it is active or not.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitOfMeasureRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:read","master_data:write"]},{"id":"put-master-data-unit-of-measures-external_id","method":"put","path":"/master-data/unit-of-measures/{external_id}","group":"master-data","sub":"Units of measure","title":"Update a unit of measure","description":"Updates the fields you send and leaves the others unchanged.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitOfMeasureUpsert"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitOfMeasureRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"delete-master-data-unit-of-measures-external_id","method":"delete","path":"/master-data/unit-of-measures/{external_id}","group":"master-data","sub":"Units of measure","title":"Delete a unit of measure","description":"Deactivates the unit of measure (`isActive: false`) but keeps it, so past invoices still resolve. Sync it with `isActive: true` to restore it.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitOfMeasureRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"get-master-data-products","method":"get","path":"/master-data/products","group":"master-data","sub":"Products","title":"List products","description":"Returns your products, active ones by default. Search with `q`, sort with `sort`, and page with `limit` and `offset`.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50},"description":"Maximum number of items to return."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0},"description":"Number of items to skip before the first one returned. Use with `limit` to page through results."},{"name":"active","in":"query","required":false,"schema":{"type":"string","default":"active"},"description":"Which records to return: `active` (the default), `inactive` or `all`."},{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Field to sort by, in camelCase. Prefix with `-` for descending."},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Text to search for. Not case-sensitive. Matches any field of the record unless you set `q_field`."},{"name":"q_field","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Search only this field (camelCase), for example `name`."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_ProductRead_"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:read","master_data:write"]},{"id":"post-master-data-products","method":"post","path":"/master-data/products","group":"master-data","sub":"Products","title":"Sync products","description":"Creates or updates products in bulk. Send an array; each record is matched on its `externalId`. Sending the same payload again changes nothing, and a record with an older `externalUpdatedAt` never overwrites newer data. Send `isActive: false` to deactivate a product, and `true` to restore it.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProductUpsert"},"title":"Payload"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncResult"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"get-master-data-products-external_id","method":"get","path":"/master-data/products/{external_id}","group":"master-data","sub":"Products","title":"Retrieve a product","description":"Returns one product by its `externalId`, whether it is active or not.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:read","master_data:write"]},{"id":"put-master-data-products-external_id","method":"put","path":"/master-data/products/{external_id}","group":"master-data","sub":"Products","title":"Update a product","description":"Updates the fields you send and leaves the others unchanged.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductUpsert"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"delete-master-data-products-external_id","method":"delete","path":"/master-data/products/{external_id}","group":"master-data","sub":"Products","title":"Delete a product","description":"Deactivates the product (`isActive: false`) but keeps it, so past invoices still resolve. Sync it with `isActive: true` to restore it.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"get-master-data-purchase-orders","method":"get","path":"/master-data/purchase-orders","group":"master-data","sub":"Purchase orders","title":"List purchase orders","description":"Returns your purchase orders, active ones by default. Search with `q`, sort with `sort`, and page with `limit` and `offset`.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50},"description":"Maximum number of items to return."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0},"description":"Number of items to skip before the first one returned. Use with `limit` to page through results."},{"name":"active","in":"query","required":false,"schema":{"type":"string","default":"active"},"description":"Which records to return: `active` (the default), `inactive` or `all`."},{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Field to sort by, in camelCase. Prefix with `-` for descending."},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Text to search for. Not case-sensitive. Matches any field of the record unless you set `q_field`."},{"name":"q_field","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Search only this field (camelCase), for example `name`."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_PurchaseOrderRead_"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:read","master_data:write"]},{"id":"post-master-data-purchase-orders","method":"post","path":"/master-data/purchase-orders","group":"master-data","sub":"Purchase orders","title":"Sync purchase orders","description":"Creates or updates purchase orders in bulk. Send an array; each record is matched on its `externalId`. Sending the same payload again changes nothing, and a record with an older `externalUpdatedAt` never overwrites newer data. Send `isActive: false` to deactivate a purchase order, and `true` to restore it.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderUpsert"},"title":"Payload"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncResult"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"get-master-data-purchase-orders-external_id","method":"get","path":"/master-data/purchase-orders/{external_id}","group":"master-data","sub":"Purchase orders","title":"Retrieve a purchase order","description":"Returns one purchase order by its `externalId`, whether it is active or not.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrderRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:read","master_data:write"]},{"id":"put-master-data-purchase-orders-external_id","method":"put","path":"/master-data/purchase-orders/{external_id}","group":"master-data","sub":"Purchase orders","title":"Update a purchase order","description":"Updates the fields you send and leaves the others unchanged.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrderUpsert"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrderRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"delete-master-data-purchase-orders-external_id","method":"delete","path":"/master-data/purchase-orders/{external_id}","group":"master-data","sub":"Purchase orders","title":"Delete a purchase order","description":"Deactivates the purchase order (`isActive: false`) but keeps it, so past invoices still resolve. Sync it with `isActive: true` to restore it.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrderRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"get-master-data-dimensions","method":"get","path":"/master-data/dimensions","group":"master-data","sub":"Dimensions","title":"List dimensions","description":"Returns your dimensions, active ones by default. Search with `q`, sort with `sort`, and page with `limit` and `offset`.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50},"description":"Maximum number of items to return."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0},"description":"Number of items to skip before the first one returned. Use with `limit` to page through results."},{"name":"active","in":"query","required":false,"schema":{"type":"string","default":"active"},"description":"Which records to return: `active` (the default), `inactive` or `all`."},{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Field to sort by, in camelCase. Prefix with `-` for descending."},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Text to search for. Not case-sensitive. Matches any field of the record unless you set `q_field`."},{"name":"q_field","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Search only this field (camelCase), for example `name`."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_DimensionRead_"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:read","master_data:write"]},{"id":"post-master-data-dimensions","method":"post","path":"/master-data/dimensions","group":"master-data","sub":"Dimensions","title":"Sync dimensions","description":"Creates or updates dimensions in bulk. Send an array; each record is matched on its `externalId`. Sending the same payload again changes nothing, and a record with an older `externalUpdatedAt` never overwrites newer data. Send `isActive: false` to deactivate a dimension, and `true` to restore it.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DimensionUpsert"},"title":"Payload"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncResult"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"get-master-data-dimensions-external_id","method":"get","path":"/master-data/dimensions/{external_id}","group":"master-data","sub":"Dimensions","title":"Retrieve a dimension","description":"Returns one dimension by its `externalId`, whether it is active or not.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DimensionRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:read","master_data:write"]},{"id":"put-master-data-dimensions-external_id","method":"put","path":"/master-data/dimensions/{external_id}","group":"master-data","sub":"Dimensions","title":"Update a dimension","description":"Updates the fields you send and leaves the others unchanged.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DimensionUpsert"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DimensionRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"delete-master-data-dimensions-external_id","method":"delete","path":"/master-data/dimensions/{external_id}","group":"master-data","sub":"Dimensions","title":"Delete a dimension","description":"Deactivates the dimension (`isActive: false`) but keeps it, so past invoices still resolve. Sync it with `isActive: true` to restore it.","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string"},"description":"Your ERP’s ID for the record (its `externalId`)."}],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DimensionRead"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:write"]},{"id":"get-master-data-dimensions-config","method":"get","path":"/master-data/dimensions/config","group":"master-data","sub":"Dimensions","title":"Retrieve dimension configuration","description":"Returns the dimension types configured for your organisation and the values each one allows.","parameters":[],"requestBody":null,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DimensionConfigResponse"}}}},"401":{"description":"The token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token holds none of the scopes this endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"scopes":["master_data:read","master_data:write"]}],"schemas":{"AccountRead":{"properties":{"externalId":{"type":"string","title":"Externalid"},"externalUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Externalupdatedat"},"isActive":{"type":"boolean","title":"Isactive"},"externalData":{"additionalProperties":true,"type":"object","title":"Externaldata"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"updatedAt":{"type":"string","format":"date-time","title":"Updatedat"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deletedat"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"accountType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accounttype"},"parentAccountExternalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parentaccountexternalid"}},"additionalProperties":false,"type":"object","required":["externalId","isActive","createdAt","updatedAt"],"title":"AccountRead","description":"A GL account, as the API returns it."},"AccountUpsert":{"properties":{"externalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Externalid"},"externalUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Externalupdatedat"},"isActive":{"type":"boolean","title":"Isactive","default":true},"externalData":{"additionalProperties":true,"type":"object","title":"Externaldata"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"accountType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accounttype"},"parentAccountExternalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parentaccountexternalid"}},"additionalProperties":false,"type":"object","title":"AccountUpsert","description":"A GL account, as you send it to sync or update."},"ActivityEvent":{"properties":{"id":{"type":"string","title":"Id"},"invoice_id":{"type":"string","title":"Invoice Id"},"event_type":{"type":"string","title":"Event Type"},"actor_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor User Id"},"actor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Name"},"before":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Before"},"after":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"After"},"at":{"type":"string","format":"date-time","title":"At"}},"type":"object","required":["id","invoice_id","event_type","at"],"title":"ActivityEvent","description":"One entry in an invoice’s activity trail. `event_type` is a dot-notation value such as `approval.decided`."},"ActivityListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ActivityEvent"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"ActivityListResponse"},"AddCommentInput":{"properties":{"body":{"type":"string","title":"Body","description":"The comment. Mention a teammate with @."}},"type":"object","required":["body"],"title":"AddCommentInput"},"AgingBucket":{"properties":{"label":{"type":"string","title":"Label"},"from_days":{"type":"integer","title":"From Days"},"to_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"To Days"},"count":{"type":"integer","title":"Count"},"amount":{"type":"string","title":"Amount"}},"type":"object","required":["label","from_days","count","amount"],"title":"AgingBucket"},"AgingReport":{"properties":{"as_of":{"type":"string","format":"date-time","title":"As Of"},"buckets":{"items":{"$ref":"#/components/schemas/AgingBucket"},"type":"array","title":"Buckets"},"total_outstanding":{"type":"string","title":"Total Outstanding"},"by_vendor":{"items":{"$ref":"#/components/schemas/AgingVendorRollup"},"type":"array","title":"By Vendor"}},"type":"object","required":["as_of","buckets","total_outstanding","by_vendor"],"title":"AgingReport"},"AgingVendorRollup":{"properties":{"vendor_external_id":{"type":"string","title":"Vendor External Id"},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name"},"outstanding":{"type":"string","title":"Outstanding"},"overdue":{"type":"string","title":"Overdue"}},"type":"object","required":["vendor_external_id","outstanding","overdue"],"title":"AgingVendorRollup"},"AnalyticsOverviewResponse":{"properties":{"period":{"type":"string","title":"Period"},"total_spend":{"type":"string","title":"Total Spend"},"invoice_count":{"type":"integer","title":"Invoice Count"},"auto_approval_rate":{"type":"number","title":"Auto Approval Rate"},"touchless_rate":{"type":"number","title":"Touchless Rate"},"avg_turnaround_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Turnaround Hours"},"exception_rate":{"type":"number","title":"Exception Rate"},"spend_trend":{"items":{"$ref":"#/components/schemas/TimeseriesPoint"},"type":"array","title":"Spend Trend"},"throughput_trend":{"items":{"$ref":"#/components/schemas/TimeseriesPoint"},"type":"array","title":"Throughput Trend"},"spend_by_vendor":{"items":{"$ref":"#/components/schemas/SpendByDimension"},"type":"array","title":"Spend By Vendor"},"spend_by_category":{"items":{"$ref":"#/components/schemas/SpendByDimension"},"type":"array","title":"Spend By Category"}},"type":"object","required":["period","total_spend","invoice_count","auto_approval_rate","touchless_rate","avg_turnaround_hours","exception_rate","spend_trend","throughput_trend","spend_by_vendor","spend_by_category"],"title":"AnalyticsOverviewResponse","description":"Spend and throughput trends, spend by category, and headline rates. `period` is a fixed trailing window."},"ApInvoiceResponse":{"properties":{"invoice_id":{"type":"string","title":"Invoice Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"approval_status":{"type":"string","title":"Approval Status"},"coding_status":{"type":"string","title":"Coding Status"},"assignee_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee User Id"},"superseded":{"type":"boolean","title":"Superseded","default":false},"superseded_by":{"items":{"type":"string"},"type":"array","title":"Superseded By","default":[]},"supersedes":{"items":{"type":"string"},"type":"array","title":"Supersedes","default":[]},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["invoice_id","tenant_id","approval_status","coding_status","created_at","updated_at"],"title":"ApInvoiceResponse"},"ApprovalActionRequest":{"properties":{"decision":{"type":"string","title":"Decision","description":"One of `approve`, `reject`, `hold` or `request_info`.","example":"approve"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Why, in a few words. Recorded in the activity trail.","example":"Matches the PO and the goods receipt"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment","description":"An optional comment.","example":"Approved against PO-2026-0187."}},"type":"object","required":["decision"],"title":"ApprovalActionRequest"},"ApprovalPolicy":{"properties":{"enforce_segregation_of_duties":{"type":"boolean","title":"Enforce Segregation Of Duties"},"enforce_approval_limits":{"type":"boolean","title":"Enforce Approval Limits"},"auto_approve_below_amount":{"type":"string","title":"Auto Approve Below Amount"},"rules":{"items":{"$ref":"#/components/schemas/ApprovalRule"},"type":"array","title":"Rules"}},"type":"object","required":["enforce_segregation_of_duties","enforce_approval_limits","auto_approve_below_amount","rules"],"title":"ApprovalPolicy"},"ApprovalPolicyInput":{"properties":{"enforce_segregation_of_duties":{"type":"boolean","title":"Enforce Segregation Of Duties","description":"When `true`, people who uploaded or corrected an invoice cannot approve it."},"enforce_approval_limits":{"type":"boolean","title":"Enforce Approval Limits","description":"When `true`, approvers can only approve invoices up to their own limit."},"auto_approve_below_amount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Auto Approve Below Amount","description":"Invoices with a total below this amount need no approval.","example":"5000.00"},"rules":{"items":{"$ref":"#/components/schemas/ApprovalRuleInput"},"type":"array","title":"Rules","description":"The approval ladder: which role approves at which amount."}},"type":"object","required":["enforce_segregation_of_duties","enforce_approval_limits","auto_approve_below_amount","rules"],"title":"ApprovalPolicyInput"},"ApprovalRule":{"properties":{"id":{"type":"string","title":"Id"},"basis":{"type":"string","title":"Basis"},"amount_threshold":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Amount Threshold"},"approver_role_chain":{"items":{"type":"string"},"type":"array","title":"Approver Role Chain"},"description":{"type":"string","title":"Description"},"active":{"type":"boolean","title":"Active"}},"type":"object","required":["id","basis","approver_role_chain","description","active"],"title":"ApprovalRule"},"ApprovalRuleInput":{"properties":{"basis":{"type":"string","title":"Basis"},"amount_threshold":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Amount Threshold"},"approver_role_chain":{"items":{"type":"string"},"type":"array","title":"Approver Role Chain"},"description":{"type":"string","title":"Description","default":""},"active":{"type":"boolean","title":"Active","default":true}},"type":"object","required":["basis","approver_role_chain"],"title":"ApprovalRuleInput"},"ApprovalState":{"properties":{"status":{"type":"string","title":"Status"},"chain":{"items":{"$ref":"#/components/schemas/ApprovalStep"},"type":"array","title":"Chain"},"current_step_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Current Step Index"},"posted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Posted At"},"posted_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posted By"},"last_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Reason"}},"type":"object","required":["status","chain","current_step_index"],"title":"ApprovalState"},"ApprovalStep":{"properties":{"order":{"type":"integer","title":"Order"},"approver_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approver User Id"},"approver_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approver Name"},"reason":{"type":"string","title":"Reason"},"status":{"type":"string","title":"Status"},"decided_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Decided At"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"}},"type":"object","required":["order","approver_user_id","approver_name","reason","status"],"title":"ApprovalStep"},"AssignInvoiceRequest":{"properties":{"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"The teammate to assign the invoice to. `null` unassigns it."}},"type":"object","title":"AssignInvoiceRequest"},"AutoApproveBucket":{"properties":{"bucket":{"type":"string","format":"date-time","title":"Bucket"},"auto_approved":{"type":"integer","title":"Auto Approved"},"total":{"type":"integer","title":"Total"},"rate":{"type":"number","title":"Rate"}},"type":"object","required":["bucket","auto_approved","total","rate"],"title":"AutoApproveBucket","description":"One time bucket of the auto-approve-rate series."},"AutoApproveDecision":{"properties":{"decision":{"type":"string","enum":["auto_approved","review"],"title":"Decision"},"blocked_by":{"items":{"type":"string"},"type":"array","title":"Blocked By"},"tau":{"anyOf":[{"type":"number","maximum":1,"minimum":0},{"type":"null"}],"title":"Tau"},"threshold":{"anyOf":[{"type":"string","enum":["tau","tau_cold"]},{"type":"null"}],"title":"Threshold"},"p_document":{"anyOf":[{"type":"number","maximum":1,"minimum":0},{"type":"null"}],"title":"P Document"},"qa_sample":{"type":"boolean","title":"Qa Sample","default":false},"qa_reason":{"anyOf":[{"type":"string","enum":["first_n","random"]},{"type":"null"}],"title":"Qa Reason"},"bank":{"anyOf":[{"type":"string","enum":["match","changed","unverified","not_read"]},{"type":"null"}],"title":"Bank"},"bank_fingerprint":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{64}$"},{"type":"null"}],"title":"Bank Fingerprint"}},"additionalProperties":false,"type":"object","required":["decision"],"title":"AutoApproveDecision","description":"Added in schema 1.7.0. Whether Calibre approved this invoice automatically. `decision` is `auto_approved` or `review`; with `review`, `blocked_by` lists the codes that stopped automatic approval."},"AutoApproveRateResponse":{"properties":{"granularity":{"type":"string","title":"Granularity"},"buckets":{"items":{"$ref":"#/components/schemas/AutoApproveBucket"},"type":"array","title":"Buckets"}},"type":"object","required":["granularity","buckets"],"title":"AutoApproveRateResponse","description":"The auto-approval rate over time."},"AutomationEvent":{"properties":{"kind":{"type":"string","title":"Kind"},"tau_before":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Tau Before"},"tau_after":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Tau After"},"qa_samples":{"type":"integer","title":"Qa Samples"},"qa_failures":{"type":"integer","title":"Qa Failures"},"lower_bound":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Lower Bound"},"actor":{"type":"string","title":"Actor"},"reason":{"type":"string","title":"Reason"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["kind","tau_before","tau_after","qa_samples","qa_failures","lower_bound","actor","reason","created_at"],"title":"AutomationEvent"},"AutomationStateResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"day_one":{"type":"boolean","title":"Day One"},"tau_in_force":{"type":"number","title":"Tau In Force"},"threshold":{"type":"string","enum":["tau","tau_cold"],"title":"Threshold"},"warming_up":{"type":"boolean","title":"Warming Up"},"tau_floor":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Tau Floor"},"auto_approved":{"type":"integer","title":"Auto Approved"},"verified":{"type":"integer","title":"Verified"},"ece":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Ece"},"qa_target":{"type":"number","title":"Qa Target"},"qa_samples":{"type":"integer","title":"Qa Samples"},"qa_failures":{"type":"integer","title":"Qa Failures"},"qa_lower_bound":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Qa Lower Bound"},"qa_samples_to_certify":{"type":"integer","title":"Qa Samples To Certify"},"qa_open":{"type":"integer","title":"Qa Open"},"breaches":{"type":"integer","title":"Breaches"},"events":{"items":{"$ref":"#/components/schemas/AutomationEvent"},"type":"array","title":"Events"}},"type":"object","required":["enabled","day_one","tau_in_force","threshold","warming_up","tau_floor","auto_approved","verified","ece","qa_target","qa_samples","qa_failures","qa_lower_bound","qa_samples_to_certify","qa_open","breaches","events"],"title":"AutomationStateResponse"},"BBox":{"properties":{"page":{"type":"integer","title":"Page"},"x0":{"type":"number","title":"X0"},"y0":{"type":"number","title":"Y0"},"x1":{"type":"number","title":"X1"},"y1":{"type":"number","title":"Y1"}},"type":"object","required":["page","x0","y0","x1","y1"],"title":"BBox","description":"A box on a page, in PDF points (1 pt = 1/72 inch), with the origin at the top-left of the page and y growing downward."},"BlockerRow":{"properties":{"cause":{"type":"string","title":"Cause"},"invoices":{"type":"integer","title":"Invoices","default":0},"sole_blocker":{"type":"integer","title":"Sole Blocker","default":0}},"type":"object","required":["cause"],"title":"BlockerRow","description":"One reason a vendor’s invoices are not approved automatically. `invoices` counts the invoices it affects; `sole_blocker` counts those it alone holds back, so fixing it would approve exactly those."},"CalibrationSummary":{"properties":{"status":{"type":"string","title":"Status"},"calibrator":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Calibrator"},"bundle_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bundle Id"},"feature_set":{"type":"string","title":"Feature Set"},"vendor_history_depth":{"type":"string","title":"Vendor History Depth"},"p_document":{"anyOf":[{"type":"number","maximum":1,"minimum":0},{"type":"null"}],"title":"P Document"},"p_fields":{"additionalProperties":{"type":"number"},"type":"object","title":"P Fields"}},"additionalProperties":false,"type":"object","required":["status","feature_set","vendor_history_depth"],"title":"CalibrationSummary","description":"Added in schema 1.7.0. The calibrated probability that this reading is right. `status` is `ok` with `p_document` set, or a code saying why there is no probability. Without one, the invoice is not approved automatically."},"ClassificationResult":{"properties":{"doc_type":{"$ref":"#/components/schemas/DocType"},"doc_subtype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doc Subtype"},"is_einvoice":{"type":"boolean","title":"Is Einvoice","default":false},"has_irn":{"type":"boolean","title":"Has Irn","default":false},"supply_state_hint":{"type":"string","enum":["intra","inter","unknown"],"title":"Supply State Hint","default":"unknown"},"language_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language Hint"},"confidence":{"type":"number","maximum":1,"minimum":0,"title":"Confidence","default":0},"features":{"additionalProperties":{"type":"number"},"type":"object","title":"Features"}},"type":"object","required":["doc_type"],"title":"ClassificationResult"},"CodingLine":{"properties":{"id":{"type":"string","title":"Id"},"amount":{"type":"string","title":"Amount"},"account_external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account External Id"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"cost_centre":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cost Centre"},"project":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project"},"tax_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Code"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"account_source":{"type":"string","enum":["model","vendor_history","none"],"title":"Account Source","default":"none"},"account_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Account Confidence"}},"type":"object","required":["id","amount"],"title":"CodingLine"},"CodingLineInput":{"properties":{"amount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Amount"},"account_external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account External Id"},"cost_centre":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cost Centre"},"project":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project"},"tax_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Code"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["amount"],"title":"CodingLineInput"},"CohortRow":{"properties":{"cohort":{"type":"string","title":"Cohort"},"invoices":{"type":"integer","title":"Invoices"},"verified":{"type":"integer","title":"Verified"},"correction_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Correction Rate"},"qa_samples":{"type":"integer","title":"Qa Samples"},"qa_precision":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Qa Precision"},"qa_lower_bound":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Qa Lower Bound"}},"additionalProperties":false,"type":"object","required":["cohort","invoices","verified","correction_rate","qa_samples","qa_precision","qa_lower_bound"],"title":"CohortRow","description":"One week’s results for vendors with a similar amount of history in Calibre."},"Comment":{"properties":{"id":{"type":"string","title":"Id"},"invoice_id":{"type":"string","title":"Invoice Id"},"author_user_id":{"type":"string","title":"Author User Id"},"author_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author Name"},"body":{"type":"string","title":"Body"},"mentions":{"items":{"type":"string"},"type":"array","title":"Mentions"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","invoice_id","author_user_id","body","mentions","created_at"],"title":"Comment"},"CompanyRead":{"properties":{"externalId":{"type":"string","title":"Externalid"},"externalUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Externalupdatedat"},"isActive":{"type":"boolean","title":"Isactive"},"externalData":{"additionalProperties":true,"type":"object","title":"Externaldata"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"updatedAt":{"type":"string","format":"date-time","title":"Updatedat"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deletedat"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"currencyCode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currencycode"},"countryCode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Countrycode"},"gstin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gstin"},"pan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pan"},"vatNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vatnumber"},"ein":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ein"}},"additionalProperties":false,"type":"object","required":["externalId","isActive","createdAt","updatedAt"],"title":"CompanyRead","description":"A company, as the API returns it."},"CompanyUpsert":{"properties":{"externalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Externalid"},"externalUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Externalupdatedat"},"isActive":{"type":"boolean","title":"Isactive","default":true},"externalData":{"additionalProperties":true,"type":"object","title":"Externaldata"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"currencyCode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currencycode"},"countryCode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Countrycode"},"gstin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gstin"},"pan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pan"},"vatNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vatnumber"},"ein":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ein"}},"additionalProperties":false,"type":"object","title":"CompanyUpsert","description":"A company, as you send it to sync or update."},"ConfidenceBreakdown":{"properties":{"field":{"type":"string","title":"Field"},"components":{"additionalProperties":{"anyOf":[{"type":"number"},{"type":"null"}]},"type":"object","title":"Components"},"weights":{"additionalProperties":{"type":"number"},"type":"object","title":"Weights"},"raw":{"type":"number","title":"Raw"},"gated":{"type":"number","title":"Gated"},"value":{"type":"number","maximum":0.99,"minimum":0,"title":"Value"},"gate_reasons":{"items":{"type":"string"},"type":"array","title":"Gate Reasons"}},"type":"object","required":["field","components","weights","raw","gated","value"],"title":"ConfidenceBreakdown","description":"How a field’s confidence score was built. `components` holds each input (method, OCR, layout, resolution and validation) from 0 to 1, or `null` where it does not apply. `raw` is their weighted sum, `gated` the score after hard checks, and `value` the final score. Calibre’s own scores stop at 0.99; 1.0 means a person verified the value."},"CorrectionAcceptedResponse":{"properties":{"accepted":{"type":"boolean","title":"Accepted","default":true}},"type":"object","title":"CorrectionAcceptedResponse","description":"Confirms the correction was saved."},"CreateDelegationRequest":{"properties":{"from_user_id":{"type":"string","title":"From User Id","description":"The approver whose authority is delegated."},"to_user_id":{"type":"string","title":"To User Id","description":"The person who may approve on their behalf."},"starts_at":{"type":"string","format":"date-time","title":"Starts At","description":"When the delegation starts (ISO 8601)."},"ends_at":{"type":"string","format":"date-time","title":"Ends At","description":"When the delegation ends (ISO 8601)."},"amount_cap":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Amount Cap","description":"Invoices above this total are not covered. `null` covers any amount.","example":"50000.00"}},"type":"object","required":["from_user_id","to_user_id","starts_at","ends_at"],"title":"CreateDelegationRequest"},"CreateRunRequest":{"properties":{"created_by":{"type":"string","title":"Created By","description":"The ID of the person opening the run."},"notes":{"additionalProperties":{"type":"string"},"type":"object","title":"Notes","description":"Optional notes, as text keys and values, stored with the run.","example":{"source":"Purchase register, FY 2025-26"}}},"type":"object","required":["created_by"],"title":"CreateRunRequest","description":"Opens a bootstrap training run."},"CurrencyRead":{"properties":{"externalId":{"type":"string","title":"Externalid"},"externalUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Externalupdatedat"},"isActive":{"type":"boolean","title":"Isactive"},"externalData":{"additionalProperties":true,"type":"object","title":"Externaldata"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"updatedAt":{"type":"string","format":"date-time","title":"Updatedat"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deletedat"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"additionalProperties":false,"type":"object","required":["externalId","isActive","createdAt","updatedAt"],"title":"CurrencyRead","description":"A currency, as the API returns it."},"CurrencyUpsert":{"properties":{"externalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Externalid"},"externalUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Externalupdatedat"},"isActive":{"type":"boolean","title":"Isactive","default":true},"externalData":{"additionalProperties":true,"type":"object","title":"Externaldata"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"additionalProperties":false,"type":"object","title":"CurrencyUpsert","description":"A currency, as you send it to sync or update."},"Delegation":{"properties":{"id":{"type":"string","title":"Id"},"from_user_id":{"type":"string","title":"From User Id"},"from_user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From User Name"},"to_user_id":{"type":"string","title":"To User Id"},"to_user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To User Name"},"starts_at":{"type":"string","format":"date-time","title":"Starts At"},"ends_at":{"type":"string","format":"date-time","title":"Ends At"},"amount_cap":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Amount Cap"},"active":{"type":"boolean","title":"Active"}},"type":"object","required":["id","from_user_id","from_user_name","to_user_id","to_user_name","starts_at","ends_at","active"],"title":"Delegation"},"DimensionConfigResponse":{"properties":{"knownTypes":{"items":{"type":"string"},"type":"array","title":"Knowntypes"},"dimensions":{"items":{"$ref":"#/components/schemas/DimensionTypeConfig"},"type":"array","title":"Dimensions"}},"additionalProperties":false,"type":"object","required":["knownTypes","dimensions"],"title":"DimensionConfigResponse","description":"The configured dimension types and the values each one allows."},"DimensionRead":{"properties":{"externalId":{"type":"string","title":"Externalid"},"externalUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Externalupdatedat"},"isActive":{"type":"boolean","title":"Isactive"},"externalData":{"additionalProperties":true,"type":"object","title":"Externaldata"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"updatedAt":{"type":"string","format":"date-time","title":"Updatedat"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deletedat"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"shortName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shortname"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"typeName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Typename"},"typeExternalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Typeexternalid"}},"additionalProperties":false,"type":"object","required":["externalId","isActive","createdAt","updatedAt"],"title":"DimensionRead","description":"A dimension, as the API returns it."},"DimensionSetting":{"properties":{"dimension_type":{"type":"string","title":"Dimension Type"},"label":{"type":"string","title":"Label"},"value_count":{"type":"integer","title":"Value Count"},"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["dimension_type","label","value_count","enabled"],"title":"DimensionSetting","description":"One ERP dimension type synced into master data, and whether your invoices use it."},"DimensionSettingsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DimensionSetting"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"DimensionSettingsResponse"},"DimensionTypeConfig":{"properties":{"type":{"type":"string","title":"Type"},"typeName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Typename"},"count":{"type":"integer","title":"Count"},"truncated":{"type":"boolean","title":"Truncated","default":false},"values":{"items":{"$ref":"#/components/schemas/DimensionValue"},"type":"array","title":"Values"}},"additionalProperties":false,"type":"object","required":["type","count","values"],"title":"DimensionTypeConfig","description":"One configured dimension type + its allowed values (values may be capped)."},"DimensionUpsert":{"properties":{"externalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Externalid"},"externalUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Externalupdatedat"},"isActive":{"type":"boolean","title":"Isactive","default":true},"externalData":{"additionalProperties":true,"type":"object","title":"Externaldata"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"shortName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shortname"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"typeName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Typename"},"typeExternalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Typeexternalid"}},"additionalProperties":false,"type":"object","title":"DimensionUpsert","description":"A dimension, as you send it to sync or update."},"DimensionValue":{"properties":{"externalId":{"type":"string","title":"Externalid"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"shortName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shortname"},"isActive":{"type":"boolean","title":"Isactive","default":true}},"additionalProperties":false,"type":"object","required":["externalId"],"title":"DimensionValue","description":"One allowed value of a dimension type."},"DocType":{"type":"string","enum":["tax_invoice","credit_note","debit_note","rcm_invoice","unknown"],"title":"DocType","description":"Document classification."},"Error":{"title":"Error","type":"object","required":["error"],"description":"The error envelope. Branch on `error`, which is stable; `detail` is written for people.","properties":{"error":{"type":"string","description":"A stable, machine-readable code, for example `invalid_token`."},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"More detail, when there is any."}}},"ExtractionMethod":{"type":"string","enum":["template_anchor","ruled_table_cell","kv_block","anchor_regex","regex_only","ml_crf","ml_ranker","derived","master_data","structural","llm_reader","llm_escalation","structured_payload","absent"],"title":"ExtractionMethod","description":"How a field's value was obtained."},"FieldCorrectionRequest":{"properties":{"new_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Value","description":"The correct value, as text."}},"type":"object","title":"FieldCorrectionRequest","description":"The corrected value of one field."},"FieldKey":{"type":"string","enum":["vendor_name","vendor_gstin","vendor_vat_id","invoice_number","invoice_date","due_date","po_number","payment_terms","taxable_amount","cgst","sgst","igst","sales_tax","vat","total_amount"],"title":"FieldKey","description":"Canonical header / tax field names.\n\nLine-item sub-fields are addressed as the string `\"line_items[i].<sub>\"`\n(not enumerated here)."},"FieldResult":{"properties":{"key":{"anyOf":[{"$ref":"#/components/schemas/FieldKey"},{"type":"string"}],"title":"Key"},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value"},"raw":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Raw"},"confidence":{"type":"number","maximum":0.99,"minimum":0,"title":"Confidence","default":0},"provenance":{"$ref":"#/components/schemas/Provenance"},"needs_review":{"type":"boolean","title":"Needs Review","default":false},"review_reasons":{"items":{"type":"string"},"type":"array","title":"Review Reasons"},"ml_margin":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Ml Margin"},"calibrated_confidence":{"anyOf":[{"type":"number","maximum":0.99,"minimum":0},{"type":"null"}],"title":"Calibrated Confidence"},"alternatives":{"items":{"$ref":"#/components/schemas/FieldResult"},"type":"array","title":"Alternatives"}},"type":"object","required":["key","value","provenance"],"title":"FieldResult","description":"The final, scored value of one field. Every field carries its `provenance`."},"GstinValidation":{"properties":{"gstin":{"type":"string","title":"Gstin"},"valid":{"type":"boolean","title":"Valid"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"state_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State Code"},"state_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State Name"}},"type":"object","required":["gstin","valid"],"title":"GstinValidation"},"GstReconRow":{"properties":{"invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Id"},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name"},"vendor_gstin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Gstin"},"invoice_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Number"},"invoice_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Invoice Date"},"tax_in_books":{"type":"string","title":"Tax In Books"},"tax_in_2b":{"type":"string","title":"Tax In 2B"},"status":{"type":"string","title":"Status"}},"type":"object","required":["invoice_id","vendor_name","vendor_gstin","invoice_number","invoice_date","tax_in_books","tax_in_2b","status"],"title":"GstReconRow"},"GstReconSummary":{"properties":{"period":{"type":"string","title":"Period"},"matched_count":{"type":"integer","title":"Matched Count"},"mismatch_count":{"type":"integer","title":"Mismatch Count"},"missing_in_2b_count":{"type":"integer","title":"Missing In 2B Count"},"missing_in_books_count":{"type":"integer","title":"Missing In Books Count"},"total_credit_at_risk":{"type":"string","title":"Total Credit At Risk"},"rows":{"items":{"$ref":"#/components/schemas/GstReconRow"},"type":"array","title":"Rows"}},"type":"object","required":["period","matched_count","mismatch_count","missing_in_2b_count","missing_in_books_count","total_credit_at_risk","rows"],"title":"GstReconSummary"},"HoldoutReport":{"properties":{"invoices":{"type":"integer","title":"Invoices","default":0},"predicted_live_accuracy":{"type":"number","title":"Predicted Live Accuracy","default":0},"predicted_auto_approve_rate":{"type":"number","title":"Predicted Auto Approve Rate","default":0},"field_accuracy":{"additionalProperties":{"type":"number"},"type":"object","title":"Field Accuracy"},"measured":{"type":"boolean","title":"Measured","default":false}},"type":"object","title":"HoldoutReport","description":"What the held-out invoices predict for live use. `predicted_live_accuracy` is measured only on invoices Calibre did not learn from, so it is a fair forecast. The per-vendor readiness rows answer a different question: how well Calibre reads the invoices it trained on."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"IntakeResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"invoice_id":{"type":"string","title":"Invoice Id"},"ocr_job_id":{"type":"string","title":"Ocr Job Id"},"pdf_content_hash":{"type":"string","title":"Pdf Content Hash"},"state":{"type":"string","title":"State"},"idempotent":{"type":"boolean","title":"Idempotent"}},"type":"object","required":["run_id","invoice_id","ocr_job_id","pdf_content_hash","state","idempotent"],"title":"IntakeResponse","description":"Result of submitting one historical invoice for training."},"InvoiceCoding":{"properties":{"invoice_id":{"type":"string","title":"Invoice Id"},"lines":{"items":{"$ref":"#/components/schemas/CodingLine"},"type":"array","title":"Lines"},"complete":{"type":"boolean","title":"Complete"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"updated_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated By"}},"type":"object","required":["invoice_id","lines","complete"],"title":"InvoiceCoding"},"InvoiceLine":{"properties":{"id":{"type":"string","title":"Id"},"kind":{"type":"string","title":"Kind"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"line_amount":{"type":"string","title":"Line Amount"},"tax_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Code"},"item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Id"},"quantity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quantity"},"unit_price":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit Price"},"po_line_comparison":{"anyOf":[{"$ref":"#/components/schemas/PoLineComparison"},{"type":"null"}]},"account_external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account External Id"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"dimensions":{"additionalProperties":{"type":"string"},"type":"object","title":"Dimensions"}},"type":"object","required":["id","kind","line_amount"],"title":"InvoiceLine"},"InvoiceLineInput":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"line_amount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Line Amount"},"tax_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Code"},"item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Id"},"quantity":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Quantity"},"unit_price":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Unit Price"},"account_external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account External Id"},"cost_centre":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cost Centre"},"project":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project"},"dimensions":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":"object"},{"type":"null"}],"title":"Dimensions"}},"type":"object","required":["line_amount"],"title":"InvoiceLineInput"},"InvoiceLinesResult":{"properties":{"invoice_id":{"type":"string","title":"Invoice Id"},"vendor_external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor External Id"},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name"},"po_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Po Number"},"po_external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Po External Id"},"po_match_status":{"type":"string","title":"Po Match Status"},"expenses":{"items":{"$ref":"#/components/schemas/InvoiceLine"},"type":"array","title":"Expenses"},"items":{"items":{"$ref":"#/components/schemas/InvoiceLine"},"type":"array","title":"Items"},"dimensions":{"additionalProperties":{"type":"string"},"type":"object","title":"Dimensions"},"reconciliation":{"anyOf":[{"$ref":"#/components/schemas/LinesReconciliation"},{"type":"null"}]},"duplicate_of_invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Duplicate Of Invoice Id"},"duplicate_of_invoice_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Duplicate Of Invoice Number"}},"type":"object","required":["invoice_id","po_match_status","expenses","items"],"title":"InvoiceLinesResult"},"InvoiceListItem":{"properties":{"invoice_id":{"type":"string","title":"Invoice Id"},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name"},"review_status":{"$ref":"#/components/schemas/ReviewStatus"},"document_confidence":{"type":"number","title":"Document Confidence"},"doc_type":{"type":"string","title":"Doc Type"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"invoice_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Number"},"invoice_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Invoice Date"},"total_amount":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Total Amount"},"posting_status":{"type":"string","title":"Posting Status","default":"not_posted"},"erp_document_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Erp Document Number"},"posted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Posted At"},"posting_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posting Error"},"po_linked":{"type":"boolean","title":"Po Linked","default":false},"linked_po_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Linked Po Number"},"vendor_external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor External Id"},"has_duplicate":{"type":"boolean","title":"Has Duplicate","default":false},"has_hard_finding":{"type":"boolean","title":"Has Hard Finding","default":false},"has_po_mismatch":{"type":"boolean","title":"Has Po Mismatch","default":false},"lines_mismatch":{"type":"boolean","title":"Lines Mismatch","default":false},"lines_total":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lines Total"},"lines_expected":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lines Expected"}},"type":"object","required":["invoice_id","vendor_name","review_status","document_confidence","doc_type","created_at"],"title":"InvoiceListItem","description":"One invoice in a list."},"InvoiceListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/InvoiceListItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"InvoiceListResponse","description":"A page of invoices."},"InvoiceUnderstandingResult":{"properties":{"schema_version":{"type":"string","title":"Schema Version"},"pipeline_version":{"type":"string","title":"Pipeline Version"},"anchor_pack_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anchor Pack Version"},"tenant_id":{"type":"string","title":"Tenant Id"},"invoice_id":{"type":"string","title":"Invoice Id"},"ocr_result_id":{"type":"string","title":"Ocr Result Id"},"content_hash":{"type":"string","title":"Content Hash"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"classification":{"$ref":"#/components/schemas/ClassificationResult"},"vendor_identity":{"$ref":"#/components/schemas/VendorIdentity"},"cluster_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cluster Id"},"fields":{"additionalProperties":{"$ref":"#/components/schemas/FieldResult"},"type":"object","title":"Fields"},"line_items":{"items":{"$ref":"#/components/schemas/LineItem"},"type":"array","title":"Line Items"},"resolution":{"$ref":"#/components/schemas/ResolutionResult"},"validation":{"$ref":"#/components/schemas/ValidationResult"},"confidence":{"additionalProperties":{"$ref":"#/components/schemas/ConfidenceBreakdown"},"type":"object","title":"Confidence"},"document_confidence":{"type":"number","maximum":1,"minimum":0,"title":"Document Confidence","default":0},"review_status":{"$ref":"#/components/schemas/ReviewStatus"},"flagged_fields":{"items":{"type":"string"},"type":"array","title":"Flagged Fields"},"field_resolved_ids":{"additionalProperties":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}]},"type":"object","title":"Field Resolved Ids"},"is_po_invoice":{"type":"boolean","title":"Is Po Invoice","default":false},"po_matches":{"items":{"$ref":"#/components/schemas/POMatchResult"},"type":"array","title":"Po Matches"},"master_data_overrides":{"items":{"$ref":"#/components/schemas/MasterDataOverride"},"type":"array","title":"Master Data Overrides"},"reader":{"anyOf":[{"$ref":"#/components/schemas/ReaderSummary"},{"type":"null"}]},"integrity":{"anyOf":[{"$ref":"#/components/schemas/ResultIntegrity"},{"type":"null"}]},"calibration":{"anyOf":[{"$ref":"#/components/schemas/CalibrationSummary"},{"type":"null"}]},"auto_approve":{"anyOf":[{"$ref":"#/components/schemas/AutoApproveDecision"},{"type":"null"}]},"taxable_bases":{"anyOf":[{"$ref":"#/components/schemas/TaxableBases"},{"type":"null"}]}},"type":"object","required":["schema_version","pipeline_version","tenant_id","invoice_id","ocr_result_id","content_hash","created_at","classification","vendor_identity","resolution","validation","review_status"],"title":"InvoiceUnderstandingResult","description":"The full understanding result for a single invoice: every extracted field with its confidence and provenance, line items, tax, validation findings and the review decision. Money values are strings."},"IrnValidation":{"properties":{"irn":{"type":"string","title":"Irn"},"valid":{"type":"boolean","title":"Valid"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"ack_no":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ack No"},"ack_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Ack Date"}},"type":"object","required":["irn","valid"],"title":"IrnValidation"},"LearningCoverage":{"properties":{"invoices":{"type":"integer","title":"Invoices","default":0},"healthy":{"type":"boolean","title":"Healthy","default":true},"diagnosis":{"items":{"type":"string"},"type":"array","title":"Diagnosis"},"template_coverage":{"type":"number","title":"Template Coverage","default":0},"vendor_template_coverage":{"type":"number","title":"Vendor Template Coverage","default":0},"unverifiable_rate":{"type":"number","title":"Unverifiable Rate","default":0},"unverifiable_by_field":{"additionalProperties":{"type":"number"},"type":"object","title":"Unverifiable By Field"},"lookup_gap_rate":{"type":"number","title":"Lookup Gap Rate","default":0},"mean_clusters_per_vendor":{"type":"number","title":"Mean Clusters Per Vendor","default":0},"clusters_total":{"type":"integer","title":"Clusters Total","default":0},"clusters_below_floor":{"type":"integer","title":"Clusters Below Floor","default":0},"support_floor":{"type":"integer","title":"Support Floor","default":0},"corrections_by_pass":{"items":{"type":"integer"},"type":"array","title":"Corrections By Pass"},"relaxation_profile":{"additionalProperties":{"additionalProperties":{"type":"integer"},"type":"object"},"type":"object","title":"Relaxation Profile"}},"type":"object","title":"LearningCoverage","description":"Whether the run taught Calibre anything and, if not, what stopped it. An empty `diagnosis` means the run is healthy; otherwise each entry explains a problem in plain words."},"LineItem":{"properties":{"index":{"type":"integer","title":"Index"},"description":{"$ref":"#/components/schemas/FieldResult"},"hsn_sac":{"$ref":"#/components/schemas/FieldResult"},"quantity":{"$ref":"#/components/schemas/FieldResult"},"unit_price":{"$ref":"#/components/schemas/FieldResult"},"line_tax":{"$ref":"#/components/schemas/FieldResult"},"line_amount":{"$ref":"#/components/schemas/FieldResult"},"confidence":{"type":"number","maximum":0.99,"minimum":0,"title":"Confidence","default":0}},"type":"object","required":["index","description","hsn_sac","quantity","unit_price","line_tax","line_amount"],"title":"LineItem","description":"One row of a line-item table; each sub-field is a FieldResult."},"LinesReconciliation":{"properties":{"lines_total":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lines Total"},"expected":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected"},"basis":{"type":"string","title":"Basis"},"difference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Difference"},"ok":{"type":"boolean","title":"Ok"}},"type":"object","required":["lines_total","basis","ok"],"title":"LinesReconciliation","description":"Whether the invoice’s lines add up to its header amounts. Lines are pre-tax, so they are compared with the pre-tax subtotal (`taxable_amount`) when one was read; otherwise with the total less any tax read (CGST, SGST, IGST, sales tax or VAT); otherwise with the total. A tolerance of 1 or 0.5%, whichever is larger, absorbs rounding. When `ok` is `false`, the invoice cannot be posted to the ERP."},"MasterDataOverride":{"properties":{"field_key":{"type":"string","title":"Field Key"},"extracted_value":{"type":"string","title":"Extracted Value"},"extracted_provenance":{"$ref":"#/components/schemas/Provenance"},"master_value":{"type":"string","title":"Master Value"},"master_external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Master External Id"}},"type":"object","required":["field_key","extracted_value","extracted_provenance","master_value"],"title":"MasterDataOverride","description":"A field where your ERP data overruled what the invoice page said. Both values are kept so a reviewer can see them side by side, for example *the invoice says Net 60; the vendor record in the ERP says Net 30*. `extracted_provenance` points at the token on the page that carried the other value."},"MergeRequestAcceptedResponse":{"properties":{"invoice_ids":{"items":{"type":"string"},"type":"array","title":"Invoice Ids"},"status":{"type":"string","title":"Status"}},"type":"object","required":["invoice_ids","status"],"title":"MergeRequestAcceptedResponse"},"MergeRequestInput":{"properties":{"invoice_ids":{"items":{"type":"string"},"type":"array","title":"Invoice Ids","description":"The Calibre IDs of the documents to merge.","example":["3f0c1b52-7d1e-4c43-9b1a-6a1f6f1d2c10","8b7e2d41-2c9a-4f0e-a6d3-1e5b9c7f4a22"]}},"type":"object","required":["invoice_ids"],"title":"MergeRequestInput"},"Page_AccountRead_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AccountRead"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"additionalProperties":false,"type":"object","required":["items","total","limit","offset"],"title":"Page[AccountRead]"},"Page_CompanyRead_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CompanyRead"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"additionalProperties":false,"type":"object","required":["items","total","limit","offset"],"title":"Page[CompanyRead]"},"Page_CurrencyRead_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CurrencyRead"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"additionalProperties":false,"type":"object","required":["items","total","limit","offset"],"title":"Page[CurrencyRead]"},"Page_DimensionRead_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DimensionRead"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"additionalProperties":false,"type":"object","required":["items","total","limit","offset"],"title":"Page[DimensionRead]"},"Page_PaymentTermRead_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PaymentTermRead"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"additionalProperties":false,"type":"object","required":["items","total","limit","offset"],"title":"Page[PaymentTermRead]"},"Page_ProductRead_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ProductRead"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"additionalProperties":false,"type":"object","required":["items","total","limit","offset"],"title":"Page[ProductRead]"},"Page_PurchaseOrderRead_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PurchaseOrderRead"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"additionalProperties":false,"type":"object","required":["items","total","limit","offset"],"title":"Page[PurchaseOrderRead]"},"Page_TaxCodeRead_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TaxCodeRead"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"additionalProperties":false,"type":"object","required":["items","total","limit","offset"],"title":"Page[TaxCodeRead]"},"Page_UnitOfMeasureRead_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/UnitOfMeasureRead"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"additionalProperties":false,"type":"object","required":["items","total","limit","offset"],"title":"Page[UnitOfMeasureRead]"},"Page_VendorRead_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/VendorRead"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"additionalProperties":false,"type":"object","required":["items","total","limit","offset"],"title":"Page[VendorRead]"},"Payment":{"properties":{"invoice_id":{"type":"string","title":"Invoice Id"},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name"},"status":{"type":"string","title":"Status"},"amount_due":{"type":"string","title":"Amount Due"},"amount_paid":{"type":"string","title":"Amount Paid"},"due_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Due Date"},"scheduled_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled Date"},"paid_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paid Date"},"method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Method"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference"},"discount_amount":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Discount Amount"},"discount_deadline":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Discount Deadline"}},"type":"object","required":["invoice_id","status","amount_due","amount_paid"],"title":"Payment"},"PaymentListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/Payment"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"PaymentListResponse"},"PaymentTermRead":{"properties":{"externalId":{"type":"string","title":"Externalid"},"externalUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Externalupdatedat"},"isActive":{"type":"boolean","title":"Isactive"},"externalData":{"additionalProperties":true,"type":"object","title":"Externaldata"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"updatedAt":{"type":"string","format":"date-time","title":"Updatedat"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deletedat"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"daysToPay":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Daystopay"},"discountDays":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Discountdays"},"discountPercentage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Discountpercentage"}},"additionalProperties":false,"type":"object","required":["externalId","isActive","createdAt","updatedAt"],"title":"PaymentTermRead","description":"A payment term, as the API returns it."},"PaymentTermUpsert":{"properties":{"externalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Externalid"},"externalUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Externalupdatedat"},"isActive":{"type":"boolean","title":"Isactive","default":true},"externalData":{"additionalProperties":true,"type":"object","title":"Externaldata"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"daysToPay":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Daystopay"},"discountDays":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Discountdays"},"discountPercentage":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Discountpercentage"}},"additionalProperties":false,"type":"object","title":"PaymentTermUpsert","description":"A payment term, as you send it to sync or update."},"PoFieldComparison":{"properties":{"invoice":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice"},"po":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Po"},"ok":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Ok"}},"type":"object","title":"PoFieldComparison"},"PoLineComparison":{"properties":{"po_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Po Number"},"po_line_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Po Line Number"},"quantity":{"$ref":"#/components/schemas/PoFieldComparison"},"unit_price":{"$ref":"#/components/schemas/PoFieldComparison"},"line_amount":{"$ref":"#/components/schemas/PoFieldComparison"},"status":{"type":"string","title":"Status"},"quantity_open":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quantity Open"},"quantity_remaining":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quantity Remaining"},"partial_quantity":{"type":"boolean","title":"Partial Quantity","default":false},"po_external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Po External Id"},"po_line_external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Po Line External Id"},"po_product_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Po Product Number"},"po_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Po Description"},"po_unit_of_measure":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Po Unit Of Measure"},"po_quantity_ordered":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Po Quantity Ordered"},"po_quantity_billed":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Po Quantity Billed"}},"type":"object","required":["quantity","unit_price","line_amount","status"],"title":"PoLineComparison"},"PoLineInvoiceMatch":{"properties":{"invoice_id":{"type":"string","title":"Invoice Id"},"invoice_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Number"},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name"},"quantity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quantity"},"line_amount":{"type":"string","title":"Line Amount"},"posting_status":{"type":"string","title":"Posting Status"},"match_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Match Status"}},"type":"object","required":["invoice_id","line_amount","posting_status"],"title":"PoLineInvoiceMatch","description":"One invoice item line matched to a PO line."},"POLineMatch":{"properties":{"invoice_line_index":{"type":"integer","title":"Invoice Line Index"},"po_line_external_id":{"type":"string","title":"Po Line External Id"},"match_basis":{"type":"string","enum":["product_code","description_fuzzy","price_quantity"],"title":"Match Basis"},"match_score":{"type":"number","maximum":1,"minimum":0,"title":"Match Score"},"quantity_ok":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Quantity Ok"},"unit_price_ok":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Unit Price Ok"},"line_amount_ok":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Line Amount Ok"},"quantity_open":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quantity Open"},"quantity_remaining":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quantity Remaining"},"partial_quantity":{"type":"boolean","title":"Partial Quantity","default":false}},"type":"object","required":["invoice_line_index","po_line_external_id","match_basis","match_score"],"title":"POLineMatch","description":"One invoice line matched to one PO line."},"PoLineMatchesResponse":{"properties":{"po_external_id":{"type":"string","title":"Po External Id"},"lines":{"items":{"$ref":"#/components/schemas/PoLineMatchSummary"},"type":"array","title":"Lines"}},"type":"object","required":["po_external_id","lines"],"title":"PoLineMatchesResponse"},"PoLineMatchSummary":{"properties":{"po_line_external_id":{"type":"string","title":"Po Line External Id"},"line_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Line Number"},"quantity_ordered":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quantity Ordered"},"quantity_billed_in_erp":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quantity Billed In Erp"},"quantity_matched_pending":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quantity Matched Pending"},"quantity_open":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quantity Open"},"invoices":{"items":{"$ref":"#/components/schemas/PoLineInvoiceMatch"},"type":"array","title":"Invoices"}},"type":"object","required":["po_line_external_id","quantity_matched_pending","invoices"],"title":"PoLineMatchSummary","description":"A PO line’s quantities: ordered, billed in the ERP, matched on invoices in Calibre, and still open."},"POMatchResult":{"properties":{"po_external_id":{"type":"string","title":"Po External Id"},"po_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Po Number"},"header_status":{"type":"string","enum":["ok","closed","not_found","vendor_mismatch","matching_not_required"],"title":"Header Status","default":"ok"},"match_status":{"type":"string","enum":["full","partial","none"],"title":"Match Status","default":"none"},"line_matches":{"items":{"$ref":"#/components/schemas/POLineMatch"},"type":"array","title":"Line Matches"},"unmatched_invoice_line_indexes":{"items":{"type":"integer"},"type":"array","title":"Unmatched Invoice Line Indexes"},"unmatched_po_line_ids":{"items":{"type":"string"},"type":"array","title":"Unmatched Po Line Ids"}},"type":"object","required":["po_external_id"],"title":"POMatchResult","description":"Match readiness for one resolved PO against the invoice's line items."},"PostingStateResponse":{"properties":{"invoice_id":{"type":"string","title":"Invoice Id"},"posting_status":{"type":"string","title":"Posting Status"},"erp_connection_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Erp Connection Id"},"erp_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Erp Type"},"erp_document_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Erp Document Number"},"erp_internal_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Erp Internal Id"},"posted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Posted At"},"posting_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posting Error"}},"type":"object","required":["invoice_id","posting_status"],"title":"PostingStateResponse"},"PostRequestAcceptedResponse":{"properties":{"invoice_id":{"type":"string","title":"Invoice Id"},"posting_status":{"type":"string","title":"Posting Status"}},"type":"object","required":["invoice_id","posting_status"],"title":"PostRequestAcceptedResponse","description":"Confirms the posting request was accepted. Posting has not happened yet: check the invoice’s posting status or activity for the outcome."},"PostRequestInput":{"properties":{"connection_id":{"type":"string","title":"Connection Id","description":"The ERP connection to post through."}},"type":"object","required":["connection_id"],"title":"PostRequestInput","description":"Which ERP connection to post through."},"ProductRead":{"properties":{"externalId":{"type":"string","title":"Externalid"},"externalUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Externalupdatedat"},"isActive":{"type":"boolean","title":"Isactive"},"externalData":{"additionalProperties":true,"type":"object","title":"Externaldata"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"updatedAt":{"type":"string","format":"date-time","title":"Updatedat"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deletedat"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"hsn":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hsn"},"unitPrice":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unitprice"}},"additionalProperties":false,"type":"object","required":["externalId","isActive","createdAt","updatedAt"],"title":"ProductRead","description":"A catalogue product, as the API returns it."},"ProductUpsert":{"properties":{"externalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Externalid"},"externalUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Externalupdatedat"},"isActive":{"type":"boolean","title":"Isactive","default":true},"externalData":{"additionalProperties":true,"type":"object","title":"Externaldata"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"hsn":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hsn"},"unitPrice":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Unitprice"}},"additionalProperties":false,"type":"object","title":"ProductUpsert","description":"A catalogue product, as you send it to sync or update."},"Provenance":{"properties":{"source_method":{"$ref":"#/components/schemas/ExtractionMethod"},"page":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page"},"bboxes":{"items":{"$ref":"#/components/schemas/BBox"},"type":"array","title":"Bboxes"},"token_ids":{"items":{"type":"integer"},"type":"array","title":"Token Ids"},"anchor_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anchor Text"},"template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Id"},"template_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Version"},"model_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Name"},"model_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Version"},"candidate_rank":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Candidate Rank"},"derived_from":{"items":{"anyOf":[{"$ref":"#/components/schemas/FieldKey"},{"type":"string"}]},"type":"array","title":"Derived From"},"anchor_pack_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anchor Pack Version"},"extractor_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extractor Version"}},"type":"object","required":["source_method"],"title":"Provenance","description":"How a field was extracted: where on the page, the anchor text, and the method, model and version that produced it."},"PurchaseOrderLineRead":{"properties":{"externalId":{"type":"string","title":"Externalid"},"externalUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Externalupdatedat"},"isActive":{"type":"boolean","title":"Isactive"},"externalData":{"additionalProperties":true,"type":"object","title":"Externaldata"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"updatedAt":{"type":"string","format":"date-time","title":"Updatedat"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deletedat"},"poExternalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Poexternalid"},"lineNumber":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Linenumber"},"productNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Productnumber"},"productDescription":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Productdescription"},"quantity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quantity"},"unitOfMeasure":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unitofmeasure"},"unitAmount":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unitamount"},"lineItemTotal":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lineitemtotal"},"accountExternalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accountexternalid"},"dimensions":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Dimensions"},"matchingType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matchingtype"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"additionalProperties":false,"type":"object","required":["externalId","isActive","createdAt","updatedAt"],"title":"PurchaseOrderLineRead","description":"One line of a purchase order, as the API returns it."},"PurchaseOrderLineUpsert":{"properties":{"externalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Externalid"},"externalUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Externalupdatedat"},"isActive":{"type":"boolean","title":"Isactive","default":true},"externalData":{"additionalProperties":true,"type":"object","title":"Externaldata"},"lineNumber":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Linenumber"},"productNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Productnumber"},"productDescription":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Productdescription"},"quantity":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Quantity"},"unitOfMeasure":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unitofmeasure"},"unitAmount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Unitamount"},"lineItemTotal":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Lineitemtotal"},"accountExternalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accountexternalid"},"dimensions":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Dimensions"},"matchingType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matchingtype"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"additionalProperties":false,"type":"object","title":"PurchaseOrderLineUpsert","description":"One line of a purchase order, sent inside the purchase order. Its `externalId` identifies the line. Leave `poExternalId` out: it comes from the parent purchase order."},"PurchaseOrderRead":{"properties":{"externalId":{"type":"string","title":"Externalid"},"externalUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Externalupdatedat"},"isActive":{"type":"boolean","title":"Isactive"},"externalData":{"additionalProperties":true,"type":"object","title":"Externaldata"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"updatedAt":{"type":"string","format":"date-time","title":"Updatedat"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deletedat"},"poNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ponumber"},"vendorExternalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendorexternalid"},"vendorName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendorname"},"issuedOn":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Issuedon"},"deliverOn":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Deliveron"},"currencyCode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currencycode"},"amount":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Amount"},"paymentTermExternalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paymenttermexternalid"},"matchingType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matchingtype"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"lineItems":{"items":{"$ref":"#/components/schemas/PurchaseOrderLineRead"},"type":"array","title":"Lineitems"}},"additionalProperties":false,"type":"object","required":["externalId","isActive","createdAt","updatedAt"],"title":"PurchaseOrderRead","description":"A purchase order with its lines, as the API returns it."},"PurchaseOrderUpsert":{"properties":{"externalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Externalid"},"externalUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Externalupdatedat"},"isActive":{"type":"boolean","title":"Isactive","default":true},"externalData":{"additionalProperties":true,"type":"object","title":"Externaldata"},"poNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ponumber"},"vendorExternalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendorexternalid"},"vendorName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendorname"},"issuedOn":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Issuedon"},"deliverOn":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Deliveron"},"currencyCode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currencycode"},"amount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Amount"},"paymentTermExternalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paymenttermexternalid"},"matchingType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matchingtype"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"lineItems":{"items":{"$ref":"#/components/schemas/PurchaseOrderLineUpsert"},"type":"array","title":"Lineitems"}},"additionalProperties":false,"type":"object","title":"PurchaseOrderUpsert","description":"A purchase order, as you send it to sync or update."},"QueueDepthResponse":{"properties":{"needs_review_invoices":{"type":"integer","title":"Needs Review Invoices"},"open_field_items":{"type":"integer","title":"Open Field Items"}},"type":"object","required":["needs_review_invoices","open_field_items"],"title":"QueueDepthResponse","description":"How much review work is waiting."},"ReaderSummary":{"properties":{"bundle_id":{"type":"string","title":"Bundle Id"},"route":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Route"},"tiers":{"items":{"type":"string"},"type":"array","title":"Tiers"},"status":{"type":"string","title":"Status"},"prompt_tokens":{"type":"integer","minimum":0,"title":"Prompt Tokens","default":0},"completion_tokens":{"type":"integer","minimum":0,"title":"Completion Tokens","default":0},"total_ms":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Total Ms"},"cache_hit":{"type":"boolean","title":"Cache Hit","default":false}},"type":"object","required":["bundle_id","status"],"title":"ReaderSummary","description":"Added in schema 1.5.0. The Reader model’s part in this result: which model bundle read the invoice, how long it took, and whether its values were used (`status`). Counts and IDs only."},"ReadinessReport":{"properties":{"schema_version":{"type":"string","title":"Schema Version","default":"1.3.0"},"vendors":{"items":{"$ref":"#/components/schemas/VendorReadinessRow"},"type":"array","title":"Vendors"},"holdout":{"$ref":"#/components/schemas/HoldoutReport"},"blockers":{"items":{"$ref":"#/components/schemas/VendorBlockers"},"type":"array","title":"Blockers"},"leverage":{"items":{"$ref":"#/components/schemas/BlockerRow"},"type":"array","title":"Leverage"},"coverage":{"$ref":"#/components/schemas/LearningCoverage"}},"type":"object","title":"ReadinessReport","description":"The go-live signal: readiness for each vendor, with the forecast from held-out invoices beside it."},"RecordPaymentInput":{"properties":{"paid_date":{"type":"string","format":"date-time","title":"Paid Date","description":"When the payment was made (ISO 8601)."},"amount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Amount","description":"The amount paid. May be less than the amount due."},"method":{"type":"string","title":"Method","description":"How it was paid, for example `bank_transfer`."},"reference":{"type":"string","title":"Reference","description":"Your reference for the payment, such as the bank’s UTR number."}},"type":"object","required":["paid_date","amount","method","reference"],"title":"RecordPaymentInput"},"ResolutionResult":{"properties":{"vendor":{"$ref":"#/components/schemas/ResolvedRef"},"pos":{"items":{"$ref":"#/components/schemas/ResolvedRef"},"type":"array","title":"Pos"},"gl":{"items":{"$ref":"#/components/schemas/ResolvedRef"},"type":"array","title":"Gl"},"payment_terms":{"$ref":"#/components/schemas/ResolvedRef"},"tax_codes":{"items":{"$ref":"#/components/schemas/ResolvedRef"},"type":"array","title":"Tax Codes"},"dimensions":{"items":{"$ref":"#/components/schemas/ResolvedRef"},"type":"array","title":"Dimensions"}},"type":"object","title":"ResolutionResult"},"ResolvedRef":{"properties":{"resolved":{"type":"boolean","title":"Resolved"},"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"match_basis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Match Basis"},"confidence":{"type":"number","maximum":1,"minimum":0,"title":"Confidence","default":0},"active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"},"detail_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail Code"}},"type":"object","required":["resolved"],"title":"ResolvedRef"},"ResultIntegrity":{"properties":{"algorithm":{"type":"string","const":"sha256/canonical-json-v1","title":"Algorithm","default":"sha256/canonical-json-v1"},"output_hash":{"type":"string","pattern":"^[0-9a-f]{64}$","title":"Output Hash"},"signature":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signature"},"signing_key_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signing Key Id"},"signing_algorithm":{"anyOf":[{"type":"string","enum":["ECDSA_SHA_256","RSASSA_PSS_SHA_256"]},{"type":"null"}],"title":"Signing Algorithm"}},"additionalProperties":false,"type":"object","required":["output_hash"],"title":"ResultIntegrity","description":"Added in schema 1.6.0. Proof that a stored result is exactly what Calibre produced. `output_hash` is the SHA-256 of the result’s canonical JSON (keys sorted, no insignificant whitespace), computed without this block; `algorithm` names the method. When signing is enabled, `signature` is a signature over that hash (base64), with the key and algorithm that made it."},"ReviewStatus":{"type":"string","enum":["auto_approved","needs_review","failed"],"title":"ReviewStatus","description":"Final routing decision for a document."},"RunResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"state":{"type":"string","title":"State"},"total_invoices":{"type":"integer","title":"Total Invoices"},"processed_invoices":{"type":"integer","title":"Processed Invoices"},"matched_invoices":{"type":"integer","title":"Matched Invoices"},"unverifiable_invoices":{"type":"integer","title":"Unverifiable Invoices"},"failed_invoices":{"type":"integer","title":"Failed Invoices"},"corrections_written":{"type":"integer","title":"Corrections Written"},"jobs_by_state":{"additionalProperties":{"type":"integer"},"type":"object","title":"Jobs By State"}},"type":"object","required":["run_id","state","total_invoices","processed_invoices","matched_invoices","unverifiable_invoices","failed_invoices","corrections_written"],"title":"RunResponse","description":"A bootstrap run’s state and counters."},"SchedulePaymentInput":{"properties":{"scheduled_date":{"type":"string","format":"date-time","title":"Scheduled Date","description":"When you plan to pay (ISO 8601)."},"method":{"type":"string","title":"Method","description":"How you plan to pay, for example `bank_transfer`."}},"type":"object","required":["scheduled_date","method"],"title":"SchedulePaymentInput"},"SendVendorMessageInput":{"properties":{"subject":{"type":"string","title":"Subject","description":"The email subject."},"body":{"type":"string","title":"Body","description":"The email body."}},"type":"object","required":["subject","body"],"title":"SendVendorMessageInput"},"SpendByDimension":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"amount":{"type":"string","title":"Amount"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["key","label","amount","count"],"title":"SpendByDimension","description":"One row of a spend breakdown."},"SpendByVendorResponse":{"properties":{"vendors":{"items":{"$ref":"#/components/schemas/SpendByVendorRow"},"type":"array","title":"Vendors"}},"type":"object","required":["vendors"],"title":"SpendByVendorResponse","description":"The vendors with the highest spend."},"SpendByVendorRow":{"properties":{"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id"},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name"},"total_amount":{"type":"string","title":"Total Amount"},"invoice_count":{"type":"integer","title":"Invoice Count"}},"type":"object","required":["vendor_id","vendor_name","total_amount","invoice_count"],"title":"SpendByVendorRow","description":"One vendor's total spend over the requested window."},"SplitRequestAcceptedResponse":{"properties":{"invoice_id":{"type":"string","title":"Invoice Id"},"parts":{"type":"integer","title":"Parts"},"status":{"type":"string","title":"Status"}},"type":"object","required":["invoice_id","parts","status"],"title":"SplitRequestAcceptedResponse"},"SplitRequestInput":{"properties":{"parts":{"type":"integer","title":"Parts","description":"How many invoices the document holds.","example":2}},"type":"object","required":["parts"],"title":"SplitRequestInput"},"StatusCountsResponse":{"properties":{"counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["counts","total"],"title":"StatusCountsResponse","description":"Invoice counts by review status."},"SubmitInvoiceForm":{"properties":{"file":{"type":"string","format":"binary","title":"File","description":"The invoice PDF."},"truth":{"type":"string","title":"Truth","description":"The invoice as booked in your ERP, as a JSON string."}},"type":"object","required":["file","truth"],"title":"SubmitInvoiceForm","description":"The multipart form for submitting one historical invoice."},"SyncResult":{"properties":{"received":{"type":"integer","title":"Received"},"inserted":{"type":"integer","title":"Inserted"},"updated":{"type":"integer","title":"Updated"}},"additionalProperties":false,"type":"object","required":["received","inserted","updated"],"title":"SyncResult","description":"How many records a sync received, created and updated."},"TaxableBases":{"properties":{"page":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page"},"total_minus_taxes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Total Minus Taxes"},"subtotal_plus_charges":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtotal Plus Charges"},"total":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Total"},"applied":{"type":"string","enum":["vendor","tenant","page"],"title":"Applied","default":"page"}},"additionalProperties":false,"type":"object","title":"TaxableBases","description":"Added in schema 1.7.0. Candidate taxable amounts for this invoice, from values found on the page. Each is `null` when it cannot be worked out.\n\n* `page`: the subtotal printed on the page.\n* `total_minus_taxes`: the total less every tax found.\n* `subtotal_plus_charges`: the page subtotal plus charges, less discounts.\n* `total`: the whole total, for ERPs that book no tax separately."},"TaxCodeRead":{"properties":{"externalId":{"type":"string","title":"Externalid"},"externalUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Externalupdatedat"},"isActive":{"type":"boolean","title":"Isactive"},"externalData":{"additionalProperties":true,"type":"object","title":"Externaldata"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"updatedAt":{"type":"string","format":"date-time","title":"Updatedat"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deletedat"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"taxType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Taxtype"},"cgstRate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cgstrate"},"sgstRate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sgstrate"},"igstRate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Igstrate"},"cessRate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cessrate"},"rate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rate"},"tdsApplicable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Tdsapplicable"},"isRecoverable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Isrecoverable"}},"additionalProperties":false,"type":"object","required":["externalId","isActive","createdAt","updatedAt"],"title":"TaxCodeRead","description":"A tax code, as the API returns it."},"TaxCodeUpsert":{"properties":{"externalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Externalid"},"externalUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Externalupdatedat"},"isActive":{"type":"boolean","title":"Isactive","default":true},"externalData":{"additionalProperties":true,"type":"object","title":"Externaldata"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"taxType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Taxtype"},"cgstRate":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Cgstrate"},"sgstRate":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Sgstrate"},"igstRate":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Igstrate"},"cessRate":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Cessrate"},"rate":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Rate"},"tdsApplicable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Tdsapplicable"},"isRecoverable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Isrecoverable"}},"additionalProperties":false,"type":"object","title":"TaxCodeUpsert","description":"A tax code, as you send it to sync or update."},"TimeseriesPoint":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"value":{"type":"number","title":"Value"}},"type":"object","required":["date","value"],"title":"TimeseriesPoint"},"UnitOfMeasureRead":{"properties":{"externalId":{"type":"string","title":"Externalid"},"externalUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Externalupdatedat"},"isActive":{"type":"boolean","title":"Isactive"},"externalData":{"additionalProperties":true,"type":"object","title":"Externaldata"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"updatedAt":{"type":"string","format":"date-time","title":"Updatedat"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deletedat"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"shortName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shortname"},"symbol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Symbol"}},"additionalProperties":false,"type":"object","required":["externalId","isActive","createdAt","updatedAt"],"title":"UnitOfMeasureRead","description":"A unit of measure, as the API returns it."},"UnitOfMeasureUpsert":{"properties":{"externalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Externalid"},"externalUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Externalupdatedat"},"isActive":{"type":"boolean","title":"Isactive","default":true},"externalData":{"additionalProperties":true,"type":"object","title":"Externaldata"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"shortName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shortname"},"symbol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Symbol"}},"additionalProperties":false,"type":"object","title":"UnitOfMeasureUpsert","description":"A unit of measure, as you send it to sync or update."},"UpdateDimensionSettingsInput":{"properties":{"enabled":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Enabled","description":"Dimension types to switch on (`true`) or off (`false`), keyed by type. Only types synced from your ERP are accepted.","example":{"COST_CENTRE":true,"PROJECT":false}}},"type":"object","required":["enabled"],"title":"UpdateDimensionSettingsInput","description":"Dimension types to switch on or off, keyed by type."},"UpdateInvoiceDimensionsInput":{"properties":{"dimensions":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":"object","title":"Dimensions","description":"The header dimensions to set, keyed by dimension type.","example":{"COST_CENTRE":"CC-100","PROJECT":null}}},"type":"object","required":["dimensions"],"title":"UpdateInvoiceDimensionsInput","description":"Header dimensions to set, keyed by dimension type. `null` clears one."},"UpdateInvoiceLinesInput":{"properties":{"expenses":{"anyOf":[{"items":{"$ref":"#/components/schemas/InvoiceLineInput"},"type":"array"},{"type":"null"}],"title":"Expenses","description":"The expense lines. Omit to leave them unchanged."},"items":{"anyOf":[{"items":{"$ref":"#/components/schemas/InvoiceLineInput"},"type":"array"},{"type":"null"}],"title":"Items","description":"The item lines. Omit to leave them unchanged."},"rematch":{"type":"boolean","title":"Rematch","default":true,"description":"Match item lines against the PO after saving. With `false`, the match is marked stale until you re-run it."}},"type":"object","title":"UpdateInvoiceLinesInput"},"UpdatePoHeaderInput":{"properties":{"vendor_external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor External Id","description":"The vendor’s `externalId` in your master data."},"po_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Po Number","description":"The purchase order number, from your master data."},"rematch":{"type":"boolean","title":"Rematch","default":true,"description":"Match the lines again after the change. With `false`, the match is marked stale until you re-run it."}},"type":"object","title":"UpdatePoHeaderInput"},"ValidateIrnRequest":{"properties":{"irn":{"type":"string","title":"Irn","description":"The e-invoice’s 64-character Invoice Reference Number."}},"type":"object","required":["irn"],"title":"ValidateIrnRequest"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"ValidationFinding":{"properties":{"tier":{"type":"integer","enum":[1,2,3,4],"title":"Tier"},"code":{"type":"string","title":"Code"},"severity":{"type":"string","enum":["info","warn","hard"],"title":"Severity"},"field_keys":{"items":{"type":"string"},"type":"array","title":"Field Keys"},"detail_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail Code"}},"type":"object","required":["tier","code","severity"],"title":"ValidationFinding"},"ValidationResult":{"properties":{"findings":{"items":{"$ref":"#/components/schemas/ValidationFinding"},"type":"array","title":"Findings"},"tier_pass":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Tier Pass"},"hard_fail":{"type":"boolean","title":"Hard Fail","default":false}},"type":"object","title":"ValidationResult"},"VendorBankAccount":{"properties":{"accountNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accountnumber"},"ifsc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ifsc"},"iban":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Iban"},"bic":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bic"}},"additionalProperties":false,"type":"object","title":"VendorBankAccount","description":"One payee bank account as your ERP holds it: an IBAN, or an account number with its IFSC. A record that names no account is refused with 422."},"VendorBlockers":{"properties":{"vendor_key":{"type":"string","title":"Vendor Key"},"invoices":{"type":"integer","title":"Invoices","default":0},"auto_approved":{"type":"integer","title":"Auto Approved","default":0},"rows":{"items":{"$ref":"#/components/schemas/BlockerRow"},"type":"array","title":"Rows"}},"type":"object","required":["vendor_key"],"title":"VendorBlockers","description":"Why one vendor’s invoices are not approved automatically, most fixable cause first."},"VendorIdentity":{"properties":{"gstin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gstin"},"pan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pan"},"name_norm":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name Norm"},"role":{"type":"string","enum":["supplier","buyer","unknown"],"title":"Role","default":"unknown"},"source_method":{"$ref":"#/components/schemas/ExtractionMethod","default":"absent"},"confidence":{"type":"number","maximum":1,"minimum":0,"title":"Confidence","default":0},"provenance":{"anyOf":[{"$ref":"#/components/schemas/Provenance"},{"type":"null"}]}},"type":"object","title":"VendorIdentity","description":"Who the invoice says the vendor is."},"VendorMessage":{"properties":{"id":{"type":"string","title":"Id"},"invoice_id":{"type":"string","title":"Invoice Id"},"to_email":{"type":"string","title":"To Email"},"subject":{"type":"string","title":"Subject"},"body":{"type":"string","title":"Body"},"sent_by_user_id":{"type":"string","title":"Sent By User Id"},"sent_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sent By Name"},"sent_at":{"type":"string","format":"date-time","title":"Sent At"}},"type":"object","required":["id","invoice_id","to_email","subject","body","sent_by_user_id","sent_at"],"title":"VendorMessage"},"VendorPerformanceRow":{"properties":{"vendor_external_id":{"type":"string","title":"Vendor External Id"},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name"},"invoice_count":{"type":"integer","title":"Invoice Count"},"total_spend":{"type":"string","title":"Total Spend"},"exception_rate":{"type":"number","title":"Exception Rate"},"duplicate_count":{"type":"integer","title":"Duplicate Count"},"avg_confidence":{"type":"number","title":"Avg Confidence"},"gstin_valid":{"type":"boolean","title":"Gstin Valid"},"on_time_rate":{"type":"number","title":"On Time Rate"}},"type":"object","required":["vendor_external_id","vendor_name","invoice_count","total_spend","exception_rate","duplicate_count","avg_confidence","gstin_valid","on_time_rate"],"title":"VendorPerformanceRow"},"VendorRead":{"properties":{"externalId":{"type":"string","title":"Externalid"},"externalUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Externalupdatedat"},"isActive":{"type":"boolean","title":"Isactive"},"externalData":{"additionalProperties":true,"type":"object","title":"Externaldata"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"updatedAt":{"type":"string","format":"date-time","title":"Updatedat"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deletedat"},"companyExternalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Companyexternalid"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"aliases":{"items":{"type":"string"},"type":"array","title":"Aliases"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"street1":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Street1"},"street2":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Street2"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"district":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"District"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"},"postalCode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Postalcode"},"countryCode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Countrycode"},"currencyCode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currencycode"},"paymentTermExternalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paymenttermexternalid"},"vendorGroupExternalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendorgroupexternalid"},"gstin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gstin"},"pan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pan"},"tan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tan"},"cin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cin"},"msmeNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Msmenumber"},"taxId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Taxid"},"taxIdType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Taxidtype"},"vatNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vatnumber"},"ein":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ein"},"isCompositionDealer":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Iscompositiondealer"},"isSez":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Issez"}},"additionalProperties":false,"type":"object","required":["externalId","isActive","createdAt","updatedAt"],"title":"VendorRead","description":"A vendor, as the API returns it."},"VendorReadinessRow":{"properties":{"vendor_key":{"type":"string","title":"Vendor Key"},"invoices_processed":{"type":"integer","title":"Invoices Processed"},"auto_approve_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Auto Approve Rate"},"critical_field_accuracy":{"additionalProperties":{"type":"number"},"type":"object","title":"Critical Field Accuracy"},"weak_fields":{"items":{"type":"string"},"type":"array","title":"Weak Fields"},"template_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Status"},"ready_for_production":{"type":"boolean","title":"Ready For Production","default":false}},"type":"object","required":["vendor_key","invoices_processed","auto_approve_rate"],"title":"VendorReadinessRow","description":"One vendor's readiness summary in the readiness report."},"VendorUpsert":{"properties":{"externalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Externalid"},"externalUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Externalupdatedat"},"isActive":{"type":"boolean","title":"Isactive","default":true},"externalData":{"additionalProperties":true,"type":"object","title":"Externaldata"},"companyExternalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Companyexternalid"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"aliases":{"items":{"type":"string"},"type":"array","title":"Aliases"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"street1":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Street1"},"street2":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Street2"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"district":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"District"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"},"postalCode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Postalcode"},"countryCode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Countrycode"},"currencyCode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currencycode"},"paymentTermExternalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paymenttermexternalid"},"vendorGroupExternalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendorgroupexternalid"},"gstin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gstin"},"pan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pan"},"tan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tan"},"cin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cin"},"msmeNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Msmenumber"},"taxId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Taxid"},"taxIdType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Taxidtype"},"vatNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vatnumber"},"ein":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ein"},"isCompositionDealer":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Iscompositiondealer"},"isSez":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Issez"},"bankAccounts":{"anyOf":[{"items":{"$ref":"#/components/schemas/VendorBankAccount"},"type":"array","maxItems":20},{"type":"null"}],"title":"Bankaccounts"}},"additionalProperties":false,"type":"object","title":"VendorUpsert","description":"A vendor, as you send it to sync or update. `bank_accounts` is write-only: a sync replaces the vendor’s known accounts with the ones you send (none, if you send none), and an update changes them only when you include them. Calibre keeps fingerprints of the accounts, never the numbers."},"VerdictRequest":{"properties":{"kind":{"type":"string","enum":["qa","review"],"title":"Kind","description":"`qa` for a QA sample of an automatically approved invoice, `review` for an invoice a person reviewed.","example":"qa"},"wrong_fields":{"items":{"type":"string"},"type":"array","maxItems":16,"title":"Wrong Fields","description":"The critical fields that were wrong. Empty when every critical field was right. At most 16.","example":["total_amount"]},"review_seconds":{"anyOf":[{"type":"integer","maximum":86400,"minimum":0},{"type":"null"}],"title":"Review Seconds","description":"How long the review took, in seconds, if you measured it."}},"additionalProperties":false,"type":"object","required":["kind"],"title":"VerdictRequest","description":"A reviewer's verdict on one invoice."},"VerdictResponse":{"properties":{"kind":{"type":"string","title":"Kind"},"state":{"type":"string","enum":["passed","failed"],"title":"State"},"wrong_fields":{"items":{"type":"string"},"type":"array","title":"Wrong Fields"},"qa_samples":{"type":"integer","title":"Qa Samples"},"qa_failures":{"type":"integer","title":"Qa Failures"},"qa_lower_bound":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Qa Lower Bound"},"breach":{"type":"boolean","title":"Breach"},"tau_floor":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Tau Floor"}},"type":"object","required":["kind","state","wrong_fields","qa_samples","qa_failures","qa_lower_bound","breach","tau_floor"],"title":"VerdictResponse"},"WeeklyScorecard":{"properties":{"schema_version":{"type":"string","const":"1.0.0","title":"Schema Version","default":"1.0.0"},"tenant_id":{"type":"string","title":"Tenant Id"},"week_start":{"type":"string","format":"date","title":"Week Start"},"week_end":{"type":"string","format":"date","title":"Week End"},"invoices":{"type":"integer","title":"Invoices"},"stp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Stp"},"qa_samples":{"type":"integer","title":"Qa Samples"},"qa_failures":{"type":"integer","title":"Qa Failures"},"qa_precision":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Qa Precision"},"qa_lower_bound":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Qa Lower Bound"},"verified":{"type":"integer","title":"Verified"},"correction_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Correction Rate"},"field_correction_rate":{"additionalProperties":{"type":"number"},"type":"object","title":"Field Correction Rate"},"median_review_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Median Review Seconds"},"cpci_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cpci Seconds"},"first_invoice_of_vendor_verified":{"type":"integer","title":"First Invoice Of Vendor Verified"},"first_invoice_of_vendor_accuracy":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"First Invoice Of Vendor Accuracy"},"active_bundle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Bundle"},"active_bundle_gate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Bundle Gate"},"frozen_set_accuracy":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Frozen Set Accuracy"},"cohorts":{"items":{"$ref":"#/components/schemas/CohortRow"},"type":"array","title":"Cohorts"},"cold_start_slope":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cold Start Slope"}},"additionalProperties":false,"type":"object","required":["tenant_id","week_start","week_end","invoices","stp","qa_samples","qa_failures","qa_precision","qa_lower_bound","verified","correction_rate","field_correction_rate","median_review_seconds","cpci_seconds","first_invoice_of_vendor_verified","first_invoice_of_vendor_accuracy","active_bundle","active_bundle_gate","frozen_set_accuracy","cohorts","cold_start_slope"],"title":"WeeklyScorecard","description":"One week of automation results for your organisation."}}}