{"openapi":"3.1.0","info":{"title":"Evenbooks API","version":"2026-10-19","description":"Nearly everything the Evenbooks app does, for your own scripts and integrations. Authenticate with an API key (`Authorization: Bearer evb_…`) created by an administrator in Settings → Developers. Each key belongs to one company. Guide: https://evenbooks.org/developers"},"servers":[{"url":"https://evenbooks.org/api/v1"}],"security":[{"apiKey":[]}],"tags":[{"name":"Account","description":"Who is calling and with what access."},{"name":"Company","description":"Business details and settings."},{"name":"Customers & vendors","description":"People and businesses you sell to and buy from."},{"name":"Products & services","description":"Reusable invoice lines."},{"name":"Invoices","description":"Drafts, issuing, sending, PDFs and public links."},{"name":"Credit notes","description":"Credits against invoices."},{"name":"Payments received","description":"Money received from customers and how it is applied to invoices."},{"name":"Refunds","description":"Money returned to customers."},{"name":"Recurring invoices","description":"Invoices issued on a schedule."},{"name":"Expenses","description":"Money spent (purchases, bills paid, vendor refunds)."},{"name":"Banking","description":"Bank accounts, connections, statement imports, bank transactions, rules and reconciliation."},{"name":"Journal entries","description":"The ledger itself, including manual entries and starting balances."},{"name":"Chart of accounts","description":"Categories and balance sheet accounts."},{"name":"Sales tax","description":"Sales tax rates."},{"name":"Tax form lines","description":"Which Schedule C line each category reports on."},{"name":"Accounting periods","description":"Closing and reopening periods."},{"name":"Reports","description":"Financial reports as JSON, CSV or PDF."},{"name":"Imports","description":"Importing history from another app."},{"name":"Attachments","description":"Receipts and other files attached to records."},{"name":"Online payments","description":"Card and bank payments through Stripe."},{"name":"History","description":"Every change, who made it and when."},{"name":"Background jobs","description":"Email, PDF, sync and recurring work the server does later."},{"name":"Webhooks","description":"Get notified when something changes."}],"paths":{"/accounts":{"get":{"operationId":"getAccounts","summary":"List accounts","description":"The chart of accounts, by code. Archived accounts are left out unless `includeArchived=true`. `withBalances=true` adds each account’s `balance` from posted entries, in its natural direction (debit minus credit for assets and expenses, credit minus debit for the rest).","tags":["Chart of accounts"],"parameters":[{"name":"includeArchived","in":"query","required":false,"schema":{"$ref":"#/components/schemas/QueryBoolean"}},{"name":"withBalances","in":"query","required":false,"schema":{"$ref":"#/components/schemas/QueryBoolean"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAccountsResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"post":{"operationId":"postAccounts","summary":"Create an account","description":"Adds a category or balance sheet account in the company’s currency. A `parentId` must be an account of the same type. For an income or expense account, `scheduleCLine` also sets its Schedule C line for the current tax year.","tags":["Chart of accounts"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAccountInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/accounts/{id}":{"patch":{"operationId":"patchAccountsId","summary":"Change an account","description":"Omitted fields stay as they are. `isActive: false` archives the account; built-in system accounts cannot be archived. A new parent must have the same type. Needs `version` from the last read (409 `version_conflict` otherwise).","tags":["Chart of accounts"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAccountInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/allocations/{id}/reverse":{"post":{"operationId":"postAllocationsIdReverse","summary":"Take a payment off an invoice","description":"Reverses one allocation (an amount of a payment applied to an invoice): the invoice owes that amount again and the money is unapplied on the payment. Posts to the books on `date` (default: the date it was applied); refused in a locked period (409 `period_locked`). Only payment allocations; credit note allocations are refused (400 `validation`). Returns the payment.","tags":["Payments received"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReverseAllocationInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/attachments":{"get":{"operationId":"getAttachments","summary":"List attachments of a record","description":"Files attached to one record: `entityType` is `purchase` (an expense), `invoice`, `journal_entry` or `bank_transaction`.","tags":["Attachments"],"parameters":[{"name":"entityType","in":"query","required":true,"schema":{"type":"string","enum":["purchase","invoice","journal_entry","bank_transaction"]}},{"name":"entityId","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAttachmentsResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"post":{"operationId":"postAttachments","summary":"Upload an attachment","description":"Send `multipart/form-data`. PDF, PNG, JPEG, WebP, HEIC, CSV or plain text, up to 15 MB. Give `entityType` and `entityId` to attach it to that record at once, or neither and pass the returned `id` in `attachmentIds` when you record the expense; files left unattached are deleted after 7 days.","tags":["Attachments"],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","contentEncoding":"binary","description":"The file."},"kind":{"type":"string","description":"`receipt` (default), `csv_import` or `other`."},"entityType":{"type":"string","description":"Optional: `purchase` (an expense), `invoice`, `journal_entry` or `bank_transaction`."},"entityId":{"type":"string","description":"Optional, with `entityType`: the id of that record."}}}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/attachments/{id}":{"get":{"operationId":"getAttachmentsId","summary":"Get an attachment","description":"The file’s details. Get its contents with `GET /attachments/{id}/download`.","tags":["Attachments"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"delete":{"operationId":"deleteAttachmentsId","summary":"Delete an attachment","description":"Removes the file; History keeps a record of it. Invoice PDFs and import files stay with their records and cannot be deleted (400 `validation`).","tags":["Attachments"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Done; no body","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/attachments/{id}/download":{"get":{"operationId":"getAttachmentsIdDownload","summary":"Download an attachment","description":"Redirects (302) to a short-lived signed URL, or streams the file. Add `?inline=1` to display it in a browser instead of downloading.","tags":["Attachments"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/octet-stream":{"schema":{"type":"string","contentEncoding":"binary"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/audit":{"get":{"operationId":"getAudit","summary":"List history events","description":"Every change in the company, newest first: who made it (a person, an API key with its name, or the system), the action, the record and any reason. Filter by record with `entityType` and `entityId`, and by day with `from` and `to` (inclusive, in the company’s time zone). No `total`.","tags":["History"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{1,15}$"}},{"name":"entityType","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"entityId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"from","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"to","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PlainDateString"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAuditResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/banking/accounts":{"get":{"operationId":"getBankingAccounts","summary":"List bank accounts","description":"Bank and credit card accounts by name, each with its ledger balance and number of unreviewed transactions. Archived ones are left out unless `includeInactive=true`.","tags":["Banking"],"parameters":[{"name":"includeInactive","in":"query","required":false,"schema":{"$ref":"#/components/schemas/QueryBoolean"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetBankingAccountsResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"post":{"operationId":"postBankingAccounts","summary":"Add a bank account","description":"Administrators only. Links the bank or credit card to a ledger account: an existing one with role `bank` (or `credit_card`) in `ledgerAccountId`, or a new one created from `newLedgerAccount`. Transactions come from CSV imports, a bank connection, or by hand.","tags":["Banking"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBankAccountInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankAccountDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/banking/accounts/{id}":{"patch":{"operationId":"patchBankingAccountsId","summary":"Change a bank account","description":"Administrators only. Rename it, or set `isActive: false` to archive it: it is hidden from lists, stops syncing and takes no hand-entered transactions. Needs `version` from the last read (409 `version_conflict` otherwise). The response leaves out the ledger account code and name, ledger balance and unreviewed count.","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBankAccountInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankAccountDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/banking/connections":{"get":{"operationId":"getBankingConnections","summary":"List bank connections","description":"SimpleFIN connections by name, with their sync status and linked bank accounts.","tags":["Banking"],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetBankingConnectionsResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"post":{"operationId":"postBankingConnections","summary":"Connect a bank through SimpleFIN","description":"Administrators only. Claims the one-time SimpleFIN setup token (an outbound call to SimpleFIN; 502 `external_error` when it is refused) and keeps the access it grants, encrypted; the token itself is not stored. Next: GET /banking/connections/{id}/discover, then POST /banking/connections/{id}/link.","tags":["Banking"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectSimpleFinInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankConnectionDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/banking/connections/{id}":{"get":{"operationId":"getBankingConnectionsId","summary":"Get a bank connection","description":"With its sync status and linked bank accounts.","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankConnectionDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"patch":{"operationId":"patchBankingConnectionsId","summary":"Change a bank connection","description":"Administrators only. Rename it, change how often it syncs, or set `status`: `disabled` stops automatic syncs; `active` clears the failure count and syncs soon. A revoked connection can only be made active with POST /banking/connections/{id}/reconnect (409 `invalid_state`). Needs `version` from the last read (409 `version_conflict` otherwise).","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchBankingConnectionsIdBody"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankConnectionDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/banking/connections/{id}/disconnect":{"post":{"operationId":"postBankingConnectionsIdDisconnect","summary":"Disconnect a bank connection","description":"Administrators only. Destroys the stored SimpleFIN access and stops syncing (`status: revoked`); imported transactions, account links and history stay. Needs `version` from the last read (409 `version_conflict` otherwise). Connect again with POST /banking/connections/{id}/reconnect.","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostBankingConnectionsIdDisconnectBody"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankConnectionDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/banking/connections/{id}/discover":{"get":{"operationId":"getBankingConnectionsIdDiscover","summary":"List the accounts a bank connection can see","description":"Administrators only. Asks SimpleFIN (an outbound call; 502 `external_error` when it fails) for the accounts and balances behind the connection, each with the bank account it is linked to, if any. No transactions are fetched. Link them with POST /banking/connections/{id}/link.","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetBankingConnectionsIdDiscoverResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"read"}},"/banking/connections/{id}/link":{"post":{"operationId":"postBankingConnectionsIdLink","summary":"Link bank accounts to a connection","description":"Administrators only. Ties each account from GET /banking/connections/{id}/discover to an existing bank account (`bankAccountId`) or to a new one made from `create`. A bank account linked to another connection is refused (400 `validation`). The connection is then due to sync right away. Needs `version` from the last read (409 `version_conflict` otherwise).","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkProviderAccountsInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankConnectionDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/banking/connections/{id}/reconnect":{"post":{"operationId":"postBankingConnectionsIdReconnect","summary":"Reconnect a bank connection","description":"Administrators only. Claims a new SimpleFIN setup token (an outbound call; 502 `external_error` when it is refused) and makes the connection active again, keeping its account links and history. Needs `version` from the last read (409 `version_conflict` otherwise).","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostBankingConnectionsIdReconnectBody"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankConnectionDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/banking/connections/{id}/sync":{"post":{"operationId":"postBankingConnectionsIdSync","summary":"Sync a bank connection now","description":"Fetches new transactions for the linked accounts from SimpleFIN (an outbound call) into the review inbox. At most once per 15 minutes per connection, unless a linked account has never synced: a throttled call imports nothing and returns `ok: true` with a warning. Provider failures return `ok: false` with `error`, not an HTTP error. Changes to lines already reviewed are counted in `changed` and flagged, never rewritten.","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncResultDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/banking/imports":{"get":{"operationId":"getBankingImports","summary":"List statement imports","description":"The 100 most recent CSV and SimpleFIN import batches, newest first, optionally for one bank account. Without rows: get one import for those.","tags":["Banking"],"parameters":[{"name":"bankAccountId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetBankingImportsResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"post":{"operationId":"postBankingImports","summary":"Preview a CSV bank statement","description":"Step 1 of a CSV import. Reads the file with `mapping`, else the last mapping used for this bank account, else columns detected from the headers (`mapping` is null and there are no rows when none fit), and saves a `previewed` batch with each row marked `ok`, `duplicate` or `error`. Nothing is added to the account yet: fix the columns with POST /banking/imports/{id}/remap, then POST /banking/imports/{id}/commit. `alreadyCommitted` is true when this exact file was imported before.","tags":["Banking"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewCsvInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportBatchDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/banking/imports/{id}":{"get":{"operationId":"getBankingImportsId","summary":"Get a statement import","description":"With the file’s column headers and every row.","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportBatchDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/banking/imports/{id}/commit":{"post":{"operationId":"postBankingImportsIdCommit","summary":"Import a previewed CSV statement","description":"Adds one unreviewed bank transaction per `ok` row; rows already in the account (checked again now) are skipped and counted as duplicates. Posts nothing to the books. Refused when the exact same file was already imported into this account (409 `duplicate`). A batch already committed is returned unchanged. Idempotent with `idempotencyKey`.","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommitBatchInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportBatchDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/banking/imports/{id}/discard":{"post":{"operationId":"postBankingImportsIdDiscard","summary":"Discard a CSV import","description":"Only a `previewed` batch (409 `invalid_state` otherwise). Returns no content.","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Done; no body","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/banking/imports/{id}/remap":{"post":{"operationId":"postBankingImportsIdRemap","summary":"Change the columns of a CSV import","description":"Reads the stored file again with this column mapping. Only a `previewed` batch (409 `invalid_state` otherwise). This batch is discarded and a new previewed batch, with a new `id`, is returned: commit that one.","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CsvMappingInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportBatchDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/banking/reconciliations":{"get":{"operationId":"getBankingReconciliations","summary":"List reconciliations","description":"Latest statement end date first, optionally for one bank account. Without lines: get one reconciliation for those.","tags":["Banking"],"parameters":[{"name":"bankAccountId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetBankingReconciliationsResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"post":{"operationId":"postBankingReconciliations","summary":"Start a reconciliation","description":"Opens an `in_progress` reconciliation of one statement for a bank account; only one can be in progress per account (409 `invalid_state`). The response lists the posted ledger lines on the account up to the statement end date that no other completed reconciliation has cleared. Next: POST /banking/reconciliations/{id}/items, then POST /banking/reconciliations/{id}/complete.","tags":["Banking"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartReconciliationInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconciliationDetailDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/banking/reconciliations/{id}":{"get":{"operationId":"getBankingReconciliationsId","summary":"Get a reconciliation","description":"With its candidate lines and which are cleared, the cleared balance (statement opening balance plus cleared lines) and the `discrepancy` still to explain (closing balance minus cleared balance).","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconciliationDetailDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"delete":{"operationId":"deleteBankingReconciliationsId","summary":"Delete a reconciliation","description":"Only one still in progress; a completed or flagged one must be reopened first (409 `invalid_state`). Returns no content.","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Done; no body","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/banking/reconciliations/{id}/complete":{"post":{"operationId":"postBankingReconciliationsIdComplete","summary":"Complete a reconciliation","description":"Only when the `discrepancy` is zero (400 `validation` otherwise). Its cleared lines can no longer be cleared by another reconciliation; if one of their entries is later reversed or its bank review undone, the reconciliation becomes `flagged`. A reconciliation already completed is returned unchanged. Needs `version` from the last read (409 `version_conflict` otherwise). Idempotent with `idempotencyKey`.","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteReconciliationInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconciliationDetailDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/banking/reconciliations/{id}/items":{"post":{"operationId":"postBankingReconciliationsIdItems","summary":"Clear or unclear reconciliation lines","description":"Ticks (`clear`) or unticks (`unclear`) lines by their `journalLineId`. Lines must be posted on this bank account and dated on or before the statement end (400 `validation`). Only while `in_progress`. Needs `version` from the last read (409 `version_conflict` otherwise); every call increments it.","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToggleReconciliationItemsInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconciliationDetailDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/banking/reconciliations/{id}/reopen":{"post":{"operationId":"postBankingReconciliationsIdReopen","summary":"Reopen a reconciliation","description":"Puts a completed or flagged reconciliation back in progress, keeping its cleared lines. Refused while another reconciliation of the account is in progress (409 `invalid_state`). The `reason` is kept in History. Needs `version` from the last read (409 `version_conflict` otherwise).","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostBankingReconciliationsIdReopenBody"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconciliationDetailDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/banking/rules":{"get":{"operationId":"getBankingRules","summary":"List categorization rules","description":"By priority (lowest number first), then name. For each unreviewed bank transaction, the first active rule that matches suggests an account; rules never post anything themselves.","tags":["Banking"],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetBankingRulesResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"post":{"operationId":"postBankingRules","summary":"Create a categorization rule","description":"Matches the description, the payee or either, ignoring case (`contains`, `starts_with` or `equals`), optionally limited to one bank account, a direction (money in or out) and an amount range. Accept its suggestions with POST /banking/transactions/bulk (`accept_suggestion`).","tags":["Banking"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRuleInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/banking/rules/{id}":{"patch":{"operationId":"patchBankingRulesId","summary":"Change a categorization rule","description":"Omitted fields stay as they are; `isActive: false` turns the rule off. Needs `version` from the last read (409 `version_conflict` otherwise).","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRuleInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"},"delete":{"operationId":"deleteBankingRulesId","summary":"Delete a categorization rule","description":"Transactions it already helped categorize are unchanged. Returns no content.","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Done; no body","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/banking/transactions":{"get":{"operationId":"getBankingTransactions","summary":"List bank transactions","description":"The review inbox, newest first, filtered by bank account, status, dates, text or amount. Unreviewed lines carry a rule `suggestion` and a `matchHint` when there is one. `counts` has the number of lines per status for the same filters (ignoring `status` and paging) and `suggestedCount` the unreviewed ones a rule has a suggestion for. Pass `nextCursor` as `cursor` for the next page.","tags":["Banking"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageCursor"}},{"name":"bankAccountId","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/BankTxnStatus"}},{"name":"from","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"to","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"amountMin","in":"query","required":false,"schema":{"$ref":"#/components/schemas/NonNegativeDecimalString"}},{"name":"amountMax","in":"query","required":false,"schema":{"$ref":"#/components/schemas/NonNegativeDecimalString"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxPageDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"post":{"operationId":"postBankingTransactions","summary":"Add a bank transaction by hand","description":"For a line missing from imports and syncs. A positive `amount` is money into the account, negative is money out; zero is refused, and so is an archived bank account. The line arrives unreviewed and posts nothing until it is reviewed.","tags":["Banking"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateManualBankTransactionInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankTransactionDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/banking/transactions/{id}":{"get":{"operationId":"getBankingTransactionsId","summary":"Get a bank transaction","description":"Includes a rule `suggestion` and a `matchHint` when the line is unreviewed and has one.","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankTransactionDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/banking/transactions/{id}/candidates":{"get":{"operationId":"getBankingTransactionsIdCandidates","summary":"List records a bank transaction could match","description":"Unmatched payments, expenses, refunds, Stripe payouts and other posted entries on the same account for the same amount within 7 days; for a deposit, customer payments still in Undeposited Funds; and opposite lines in other bank accounts within 5 days (`bank_transaction`, a likely transfer). `score` is 100 for the same day, 5 less per day apart. Use them with POST /banking/transactions/{id}/match, or a `bank_transaction` with POST /banking/transactions/{id}/transfer.","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetBankingTransactionsIdCandidatesResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/banking/transactions/{id}/categorize":{"post":{"operationId":"postBankingTransactionsIdCategorize","summary":"Categorize a bank transaction","description":"Records an unreviewed line in the books. Money out becomes a paid expense (or, when every line is an equity account, an owner draw entry); money in posts to the given accounts. Several `lines` split it and must add up to the amount. A customer paying an invoice is refused here: use pay-invoice or match. `createRule` saves a rule from a one-line decision. Refused in a closed period (409 `period_locked`). Needs `version` from the last read (409 `version_conflict` otherwise). Idempotent with `idempotencyKey`.","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategorizeInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankTransactionDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/banking/transactions/{id}/exclude":{"post":{"operationId":"postBankingTransactionsIdExclude","summary":"Exclude a bank transaction","description":"Marks an unreviewed line as not belonging in the books, with a `reason`; nothing is posted. Needs `version` from the last read (409 `version_conflict` otherwise). Put it back with POST /banking/transactions/{id}/undo.","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExcludeInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankTransactionDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/banking/transactions/{id}/invoices":{"get":{"operationId":"getBankingTransactionsIdInvoices","summary":"List invoices a deposit could pay","description":"For money in only (an empty list otherwise): open invoices whose balance equals the amount, every open invoice of the customer in `contactId` or named in the description or payee, and balances within 10% of the amount. Best first, at most 25. Pay them with POST /banking/transactions/{id}/pay-invoice.","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"contactId","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetBankingTransactionsIdInvoicesResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/banking/transactions/{id}/match":{"post":{"operationId":"postBankingTransactionsIdMatch","summary":"Match a bank transaction to recorded items","description":"For a line that is already in the books: links it to records from GET /banking/transactions/{id}/candidates, whose total minus an optional `fee` must equal the line (400 `validation`). Posts only the fee, or, for payments waiting in Undeposited Funds, a deposit entry moving them to the bank. A record already matched elsewhere is refused (409 `duplicate`). Needs `version` from the last read (409 `version_conflict` otherwise). Idempotent with `idempotencyKey`.","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankTransactionDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/banking/transactions/{id}/pay-invoice":{"post":{"operationId":"postBankingTransactionsIdPayInvoice","summary":"Record a deposit as an invoice payment","description":"Records a customer payment for the whole deposit, applied to the chosen invoices in due date order (the last may be paid in part; anything left over stays as credit for the customer), and matches the line to it. Money in only, and all invoices from one customer. Needs `version` from the last read (409 `version_conflict` otherwise). Idempotent with `idempotencyKey`.","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordInvoicePaymentInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankTransactionDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/banking/transactions/{id}/transfer":{"post":{"operationId":"postBankingTransactionsIdTransfer","summary":"Record a bank transaction as a transfer","description":"Money moved between the company’s own accounts; it is neither income nor expense. Give either the other side’s line (`counterpartTransactionId`: unreviewed, in another bank account, same amount the other way), which is marked reviewed too, or another balance sheet account (`otherLedgerAccountId`: a bank, card, loan, clearing or owner account; receivables, customer deposits and sales tax are refused). Posts one entry. Needs `version` from the last read (409 `version_conflict` otherwise). Idempotent with `idempotencyKey`.","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankTransactionDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/banking/transactions/{id}/undo":{"post":{"operationId":"postBankingTransactionsIdUndo","summary":"Undo the review of a bank transaction","description":"Puts a reviewed line back in the inbox. An expense its categorization created is voided and an entry it posted is reversed (refused in a closed period); records it was matched to stay, and the other side of a transfer returns to the inbox too. Completed reconciliations that cleared a reversed entry become `flagged`. Needs `version` from the last read (409 `version_conflict` otherwise). Idempotent with `idempotencyKey`.","tags":["Banking"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UndoReviewInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankTransactionDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/banking/transactions/bulk":{"post":{"operationId":"postBankingTransactionsBulk","summary":"Review many bank transactions at once","description":"Applies one `action` to up to 100 lines, each with its `version`: `accept_suggestion` (the account its rule suggests; refused for a line that looks already recorded), `categorize`, `transfer`, `exclude` or `undo`. Each line succeeds or fails on its own (a stale version, a closed period); the response lists every line with the updated transaction or the error. One `idempotencyKey` covers the whole request.","tags":["Banking"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReviewInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReviewResultDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/company":{"get":{"operationId":"getCompany","summary":"Get the company","description":"Business details and settings of the company the credential belongs to.","tags":["Company"],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"patch":{"operationId":"patchCompany","summary":"Change company details and settings","description":"Omitted fields stay as they are. Send `version` from your last read (409 `version_conflict` if it changed). `nextInvoiceNumber` can only go up, and `fiscalYearStartMonth` can only change while no accounting period is closed (409 `invalid_state`). Changing `invoiceFooter` also updates the invoice branding’s default footer.","tags":["Company"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCompanyInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/company/email-senders":{"get":{"operationId":"getCompanyEmailSenders","summary":"List email sender domains","description":"Domains set up to send invoice emails from the company’s own address, with their verification status and the DNS records to add. `active` marks the one in use; when none is active, emails come from Evenbooks.","tags":["Company"],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCompanyEmailSendersResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"read"},"post":{"operationId":"postCompanyEmailSenders","summary":"Set up an email sender domain","description":"Starts verification of a domain the company controls, so invoice emails can come from `fromEmail` (an address on that domain; personal mailbox providers are refused). Add the returned DNS `records`, then call `POST /company/email-senders/{id}/verify`, then select it with `POST /company/email-senders/select`.","tags":["Company"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SenderSetupInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SenderIdentityDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/company/email-senders/{id}/cancel":{"post":{"operationId":"postCompanyEmailSendersIdCancel","summary":"Cancel an email sender setup","description":"Drops a domain that is not verified yet. A verified domain cannot be cancelled (409 `invalid_state`); select the Evenbooks sender instead. Returns the remaining domains.","tags":["Company"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostCompanyEmailSendersIdCancelResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/company/email-senders/{id}/verify":{"post":{"operationId":"postCompanyEmailSendersIdVerify","summary":"Check an email sender domain","description":"Checks the domain’s DNS records now and returns its updated status: `verified` once the authorization TXT record and the DKIM records are in place, otherwise `pending` (or `failed` if it was verified before) with the reason in `lastError`.","tags":["Company"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SenderIdentityDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/company/email-senders/select":{"post":{"operationId":"postCompanyEmailSendersSelect","summary":"Choose the invoice email sender","description":"Sends invoice emails from the domain `id`, which is checked again first and must be verified (409 `invalid_state`), or from the Evenbooks address when `id` is null. Returns all domains with the new `active` flags.","tags":["Company"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostCompanyEmailSendersSelectBody"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostCompanyEmailSendersSelectResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/company/invoice-presentation":{"get":{"operationId":"getCompanyInvoicePresentation","summary":"Get invoice branding and email template","description":"The layout, colors, logo and default notes of invoice PDFs, and the subject, message and signature of invoice emails. `version` 0 means the defaults were never changed.","tags":["Company"],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicePresentationDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"patch":{"operationId":"patchCompanyInvoicePresentation","summary":"Change invoice branding and email template","description":"Replaces the whole branding and email template; send `version` from your last read (409 `version_conflict` if it changed). Applies to invoices issued from now on: issued invoices keep the design they were issued with. The logo must be a PNG or JPEG data URL.","tags":["Company"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInvoicePresentationInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicePresentationDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/company/invoice-presentation/preview":{"post":{"operationId":"postCompanyInvoicePresentationPreview","summary":"Preview an invoice email","description":"Renders the email without sending it: for `invoiceId`, or a sample invoice when omitted, with the saved template or the unsaved `presentation` you pass. Returns the sender, subject, and text and HTML bodies.","tags":["Company"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceEmailPreviewInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceEmailPreviewDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/company/invoice-presentation/sample-pdf":{"post":{"operationId":"postCompanyInvoicePresentationSamplePdf","summary":"Make a sample invoice PDF","description":"Renders a sample invoice with the branding you pass, saved or not, and returns the PDF. Nothing is stored.","tags":["Company"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicePresentationInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/pdf":{"schema":{"type":"string","contentEncoding":"binary"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/company/invoice-presentation/test-email":{"post":{"operationId":"postCompanyInvoicePresentationTestEmail","summary":"Send a test invoice email","description":"Queues a sample invoice email to `to`, using the branding and template you pass (saved or not). Counts toward the company’s email limits (429 `rate_limited`); an address on the suppression list is refused (409 `invalid_state`). `idempotencyKey` (or the `Idempotency-Key` header) is required.","tags":["Company"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestInvoiceEmailInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailMessageDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/contacts":{"get":{"operationId":"getContacts","summary":"List customers and vendors","description":"By name A–Z unless `sort` and `dir` say otherwise. Archived contacts are left out unless `includeArchived` is set; `kind` keeps customers or vendors; `q` searches the name and email.","tags":["Customers & vendors"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageCursor"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["name","createdAt"]}},{"name":"dir","in":"query","required":false,"schema":{"$ref":"#/components/schemas/SortDirection"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["customer","vendor"]}},{"name":"includeArchived","in":"query","required":false,"schema":{"$ref":"#/components/schemas/QueryBoolean"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetContactsResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"post":{"operationId":"postContacts","summary":"Add a customer or vendor","description":"A contact is a customer, a vendor or both (`isCustomer` defaults to true). Invoices need a customer; expenses can name a vendor.","tags":["Customers & vendors"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContactInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/contacts/{id}":{"get":{"operationId":"getContactsId","summary":"Get a customer or vendor","tags":["Customers & vendors"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"patch":{"operationId":"patchContactsId","summary":"Change a customer or vendor","description":"Omitted fields stay as they are. `isArchived: true` leaves it out of lists and stops new invoices to it (contacts are archived, not deleted). Send `version` from your last read (409 `version_conflict` if it changed). Invoices already issued keep the details they were issued with.","tags":["Customers & vendors"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateContactInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/contacts/{id}/balance":{"get":{"operationId":"getContactsIdBalance","summary":"Get what a customer owes","description":"The customer’s open invoices with their balances, payments with money not yet applied, and credit notes with credit left, plus the totals owed (`totalReceivable`) and held as credit (`totalCredits`).","tags":["Customers & vendors"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerBalanceDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/contacts/bulk":{"post":{"operationId":"postContactsBulk","summary":"Archive or restore many contacts","description":"Up to 100 contacts, each with the `version` from your last read. A stale version fails only that contact; the response has one result per contact, with the updated contact (and its new version) when it went through.","tags":["Customers & vendors"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkContactsInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkContactsResultDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/credit-notes":{"get":{"operationId":"getCreditNotes","summary":"List credit notes","description":"Credit notes are credits you give a customer, used against their invoices or refunded. Newest issue date first unless `sort` and `dir` say otherwise. List items leave `lines` empty and omit `allocations`: get one credit note for those.","tags":["Credit notes"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageCursor"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["issueDate","number","total","customer"]}},{"name":"dir","in":"query","required":false,"schema":{"$ref":"#/components/schemas/SortDirection"}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/DocumentStatus"}},{"name":"contactId","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"from","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"to","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCreditNotesResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"post":{"operationId":"postCreditNotes","summary":"Create a draft credit note","description":"A draft has no number and is not in the books yet; issue it with `POST /credit-notes/{id}/issue`. `invoiceId` links it to an issued invoice of the same customer (for reference; applying it is a separate step). The customer’s details are copied onto the credit note.","tags":["Credit notes"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCreditNoteInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditNoteDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/credit-notes/{id}":{"get":{"operationId":"getCreditNotesId","summary":"Get a credit note","description":"Includes its lines and its allocations (amounts applied to invoices).","tags":["Credit notes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditNoteDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"patch":{"operationId":"patchCreditNotesId","summary":"Change a draft credit note","description":"Drafts only (409 `immutable` once issued). Send `version` from your last read (409 `version_conflict` if it changed). Omitted fields stay as they are; `lines`, when sent, replace all lines.","tags":["Credit notes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCreditNoteInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditNoteDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"},"delete":{"operationId":"deleteCreditNotesId","summary":"Delete a draft credit note","description":"Only drafts can be deleted (409 `immutable` otherwise). Void an issued credit note instead.","tags":["Credit notes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Done; no body","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/credit-notes/{id}/apply":{"post":{"operationId":"postCreditNotesIdApply","summary":"Apply a credit note to invoices","description":"Uses the credit to pay down invoices of the same customer: each allocation lowers that invoice’s balance and the credit note’s, and posts to the books on `date` (default: the credit note date). The total cannot exceed what is left on the credit note (400 `over_allocation`). Issued credit notes only; needs `version` from your last read; refused in a locked period (409 `period_locked`).","tags":["Credit notes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyCreditNoteInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditNoteDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/credit-notes/{id}/issue":{"post":{"operationId":"postCreditNotesIdIssue","summary":"Issue a credit note","description":"Gives the draft the next credit note number and posts it to the books on its issue date (income and sales tax reduced, the customer holds a credit). With `applyToInvoiceId` it is applied to that invoice at once, up to the invoice’s balance. Send `version` from your last read (409 `version_conflict`); the total must be above zero, and a locked period is refused (409 `period_locked`).","tags":["Credit notes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueCreditNoteInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditNoteDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/credit-notes/{id}/void":{"post":{"operationId":"postCreditNotesIdVoid","summary":"Void a credit note","description":"Cancels an issued credit note by posting a reversing entry on `date` (default: its issue date). Refused once any of it is applied to invoices or refunded (409 `invalid_state`); void its refunds first. Needs `version` from your last read; refused in a locked period (409 `period_locked`). Delete a draft instead.","tags":["Credit notes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoidInvoiceInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditNoteDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/imports/ledger":{"get":{"operationId":"getImportsLedger","summary":"List ledger imports","description":"The 100 most recent, newest first, without their accounts and entries.","tags":["Imports"],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetImportsLedgerResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"post":{"operationId":"postImportsLedger","summary":"Upload a general ledger CSV","description":"Administrators only. Step 1 of importing history from another accounting app: stores the file, detects its columns (Wave exports are recognized) and returns a `previewed` import with each source account and the entries found. Nothing is posted yet: set columns and accounts with PATCH /imports/ledger/{id}, then POST /imports/ledger/{id}/commit.","tags":["Imports"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLedgerImportInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LedgerImportDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/imports/ledger/{id}":{"get":{"operationId":"getImportsLedgerId","summary":"Get a ledger import","description":"A `previewed` import is analyzed again against the current accounts, entries and closed periods, with its source accounts and entries (problems first, capped).","tags":["Imports"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LedgerImportDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"patch":{"operationId":"patchImportsLedgerId","summary":"Change a ledger import","description":"Administrators only. Set the column `mapping`, map source account names to Evenbooks accounts (`accountMap`, merged into the saved map; null clears one), or set cash-basis amounts per settlement (`cashOverrides`; a new `mapping` clears them). Only while `previewed` (409 `invalid_state`). Returns the new preview.","tags":["Imports"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLedgerImportInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LedgerImportDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/imports/ledger/{id}/commit":{"post":{"operationId":"postImportsLedgerIdCommit","summary":"Post a ledger import","description":"Administrators only. Posts every ready entry as a journal entry, in date order; entries with errors (including those dated in a closed period) and duplicates are skipped and counted. Every source account the ready entries use must be mapped, and every settlement that needs a cash-basis review must have one (400 `validation`). Refused when the same file was imported before (409 `duplicate`). An import already committed is returned unchanged. Idempotent with `idempotencyKey`.","tags":["Imports"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommitLedgerImportInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LedgerImportDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/imports/ledger/{id}/discard":{"post":{"operationId":"postImportsLedgerIdDiscard","summary":"Discard a ledger import","description":"Administrators only. Only while `previewed` (409 `invalid_state`); entries already imported are reversed one by one from the journal instead. Returns no content.","tags":["Imports"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Done; no body","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/invoices":{"get":{"operationId":"getInvoices","summary":"List invoices","description":"Newest issue date first unless `sort` and `dir` say otherwise. `outstanding` keeps issued invoices that are not fully paid; `overdue` keeps those past their due date; `q` searches the number, memo and customer name. List items leave `lines` empty and omit `allocations`: get one invoice for those.","tags":["Invoices"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageCursor"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["issueDate","dueDate","number","customer","total","balanceDue"]}},{"name":"dir","in":"query","required":false,"schema":{"$ref":"#/components/schemas/SortDirection"}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/DocumentStatus"}},{"name":"contactId","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"from","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"to","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"overdue","in":"query","required":false,"schema":{"$ref":"#/components/schemas/QueryBoolean"}},{"name":"outstanding","in":"query","required":false,"schema":{"$ref":"#/components/schemas/QueryBoolean"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetInvoicesResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"post":{"operationId":"postInvoices","summary":"Create a draft invoice","description":"A draft has no number and is not in the books yet; issue it with `POST /invoices/{id}/issue`. The customer’s name, email and address are copied onto the invoice. `dueDate` defaults to `issueDate` plus `termsDays` (the company’s default terms when omitted), and `memo` and `footer` default to the invoice branding defaults.","tags":["Invoices"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvoiceInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/invoices/{id}":{"get":{"operationId":"getInvoicesId","summary":"Get an invoice","description":"Includes its lines and its allocations (payments and credits applied to it).","tags":["Invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"patch":{"operationId":"patchInvoicesId","summary":"Change an invoice","description":"Send `version` from your last read (409 `version_conflict` if it changed). On a draft, any field of the create body can change, and `lines`, when sent, replace all lines. On an issued, paid or void invoice only `paymentUrl` and `onlinePaymentsDisabled` change; other fields are ignored.","tags":["Invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInvoiceInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"},"delete":{"operationId":"deleteInvoicesId","summary":"Delete a draft invoice","description":"Only drafts can be deleted (409 `immutable` otherwise). Void an issued invoice instead.","tags":["Invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Done; no body","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/invoices/{id}/emails":{"get":{"operationId":"getInvoicesIdEmails","summary":"List emails of an invoice","description":"Every email queued for this invoice, newest first, with its delivery status.","tags":["Invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetInvoicesIdEmailsResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/invoices/{id}/issue":{"post":{"operationId":"postInvoicesIdIssue","summary":"Issue an invoice","description":"Turns a draft into a final invoice: gives it the next invoice number, posts it to the books (money the customer owes, against income and sales tax), creates its public link and queues its PDF. Send `version` from your last read (409 `version_conflict`); the total must be above zero, and a date in a locked period is refused (409 `period_locked`). `issueDate` replaces the draft’s date and recalculates the due date from the terms.","tags":["Invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueInvoiceInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/invoices/{id}/pdf":{"get":{"operationId":"getInvoicesIdPdf","summary":"List PDF versions of an invoice","description":"Every PDF made for this invoice, newest first. Download one with `GET /attachments/{attachmentId}/download`.","tags":["Invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicePdfVersionsDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"post":{"operationId":"postInvoicesIdPdf","summary":"Get or remake the invoice PDF","description":"Returns the current PDF, making one first if the invoice has none. `regenerate: true` makes a new version with the design saved when the invoice was issued; `applyCurrentDesign: true` makes one with the current invoice branding and keeps that design for later PDFs. Drafts have no PDF (409 `invalid_state`). Download it with `GET /attachments/{attachmentId}/download`.","tags":["Invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostInvoicesIdPdfBody"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicePdfDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/invoices/{id}/public-link":{"post":{"operationId":"postInvoicesIdPublicLink","summary":"Get, replace or turn off the public link","description":"The public link lets the customer view, download and pay the invoice without signing in. `get` returns the current link, `rotate` replaces it (the old link stops working) and `revoke` turns it off; while it is off, `url` and `path` are null until you `rotate`. `get` and `rotate` need an issued or paid invoice (409 `invalid_state`); voiding an invoice turns its link off.","tags":["Invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostInvoicesIdPublicLinkBody"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicLinkStateDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/invoices/{id}/send":{"post":{"operationId":"postInvoicesIdSend","summary":"Email an invoice","description":"Queues an email to `to` with the invoice PDF attached; the server sends it shortly after. Only issued or paid invoices (409 `invalid_state`). `subject` and `message` replace the template’s; `usePlatformSender` sends from the Evenbooks address instead of the company’s own domain. Counts toward the company’s hourly and daily email limits (429 `rate_limited`). An address on the suppression list is recorded with status `suppressed` and not sent. Follow delivery with `GET /invoices/{id}/emails`.","tags":["Invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendInvoiceEmailInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailMessageDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/invoices/{id}/void":{"post":{"operationId":"postInvoicesIdVoid","summary":"Void an invoice","description":"Cancels an issued invoice by posting a reversing entry on `date` (default: the issue date) and turns off its public link. Refused while payments or credits are applied to it (409 `invalid_state`): reverse those allocations first, or give a credit note instead. Needs `version` from your last read; refused in a locked period (409 `period_locked`). Delete a draft instead of voiding it.","tags":["Invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoidInvoiceInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/invoices/bulk":{"post":{"operationId":"postInvoicesBulk","summary":"Issue or email many invoices","description":"Up to 100 invoices, each with its own `version` and `idempotencyKey`: one failure (a stale version, a locked period, a missing email address) does not stop the others, and a retry with the same keys repeats only what did not go through. `issue` issues drafts; `send` emails issued invoices to the address on the invoice, or else the contact’s, and skips invoices with neither. The response has one result per invoice and the counts.","tags":["Invoices"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkInvoiceInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkInvoiceResultDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/invoices/preview":{"post":{"operationId":"postInvoicesPreview","summary":"Calculate invoice totals","description":"Works out each line’s discount, sales tax and total, and the document totals, without saving anything. Credit notes use the same calculation.","tags":["Invoices"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostInvoicesPreviewBody"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentPreviewDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/items":{"get":{"operationId":"getItems","summary":"List products and services","description":"Every item, by name. Inactive items are left out unless `includeInactive` is set.","tags":["Products & services"],"parameters":[{"name":"includeInactive","in":"query","required":false,"schema":{"$ref":"#/components/schemas/QueryBoolean"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetItemsResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"post":{"operationId":"postItems","summary":"Add a product or service","description":"A reusable invoice line: a name, a price and the income category it is recorded in (`incomeAccountId`, an income account), with optional default sales tax rates.","tags":["Products & services"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateItemInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/items/{id}":{"patch":{"operationId":"patchItemsId","summary":"Change a product or service","description":"Omitted fields stay as they are; `isActive: false` hides the item from the list and pickers. Send `version` from your last read (409 `version_conflict` if it changed). Invoices that already use it keep their lines.","tags":["Products & services"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateItemInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/jobs/status":{"get":{"operationId":"getJobsStatus","summary":"Get background job status","description":"Work the server does later for this company: queue counts, the 50 latest failed jobs (with their error message and whether they can be retried), events not yet dispatched, bank connections that stopped syncing, emails that failed or bounced, online payment events that failed, and when the worker last ran.","tags":["Background jobs"],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobStatusDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/journal":{"get":{"operationId":"getJournal","summary":"List journal entries","description":"Drafts and posted entries with their lines, newest first by default (`sort`, `dir`). Filter by date range, status, an account the entry touches, source type or memo text. `total` counts every match; pass `nextCursor` as `cursor` for the next page.","tags":["Journal entries"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageCursor"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["date","number"]}},{"name":"dir","in":"query","required":false,"schema":{"$ref":"#/components/schemas/SortDirection"}},{"name":"from","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"to","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/JournalStatus"}},{"name":"accountId","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"sourceType","in":"query","required":false,"schema":{"$ref":"#/components/schemas/JournalSourceType"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetJournalResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"post":{"operationId":"postJournal","summary":"Create a journal entry","description":"A manual entry; its lines must balance (400 `unbalanced`). Saved as a draft unless `post: true`, which posts it to the books at once (409 `period_locked` in a closed period). Posting refuses control accounts such as Accounts Receivable, which only invoices, payments and credit notes change. Idempotent with `idempotencyKey`.","tags":["Journal entries"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateManualJournalInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalEntryDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/journal/{id}":{"get":{"operationId":"getJournalId","summary":"Get a journal entry","description":"With its lines and totals.","tags":["Journal entries"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalEntryDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"patch":{"operationId":"patchJournalId","summary":"Change a draft journal entry","description":"Manual drafts only: posted entries are never edited (409 `immutable`); reverse them instead. Omitted fields stay as they are; `lines`, when sent, replace every line and must balance. Needs `version` from the last read (409 `version_conflict` otherwise).","tags":["Journal entries"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDraftJournalInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalEntryDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"},"delete":{"operationId":"deleteJournalId","summary":"Delete a draft journal entry","description":"Drafts only: posted entries cannot be deleted (409 `immutable`); reverse them instead. Returns no content.","tags":["Journal entries"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Done; no body","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/journal/{id}/cash-basis":{"patch":{"operationId":"patchJournalIdCashBasis","summary":"Set the cash-basis amounts of an imported entry","description":"Administrators only. For a posted entry from a ledger import: `components` (active income and expense accounts, nonzero amounts) replace what the entry counts as on cash-basis reports; the accrual ledger is unchanged and its reversals follow. Refused when the entry or a reversal of it is in a closed period (409 `period_locked`). The `reason` is kept in History. Needs `version` from the last read (409 `version_conflict` otherwise).","tags":["Journal entries"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewImportedCashInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalEntryDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/journal/{id}/post":{"post":{"operationId":"postJournalIdPost","summary":"Post a draft journal entry","description":"Posts the draft to the books and gives it an entry number. Refused in a closed period (409 `period_locked`), for an entry already posted (409 `invalid_state`) and for control accounts such as Accounts Receivable. Needs `version` from the last read (409 `version_conflict` otherwise). Idempotent with `idempotencyKey`.","tags":["Journal entries"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostJournalInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalEntryDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/journal/{id}/reverse":{"post":{"operationId":"postJournalIdReverse","summary":"Reverse a journal entry","description":"Posts a new entry dated `date` (not before the original, not in a closed period) with debits and credits swapped, links the two, and returns the reversal. An entry can be reversed once. Entries made by invoices, payments and credit notes are corrected from that record instead (400 `validation`). Completed reconciliations that cleared the entry become `flagged`. Idempotent with `idempotencyKey`.","tags":["Journal entries"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReverseJournalInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalEntryDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/journal/opening-balances":{"post":{"operationId":"postJournalOpeningBalances","summary":"Enter opening balances","description":"Administrators only. Posts one entry dated `date` with each account’s starting balance in its natural direction (positive is a debit for assets and expenses); the difference goes to Opening Balance Equity and zero balances are skipped. Accounts Receivable and other control accounts are refused: enter open invoices instead. Idempotent with `idempotencyKey`.","tags":["Journal entries"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpeningBalancesInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalEntryDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/mappings/{year}":{"get":{"operationId":"getMappingsYear","summary":"Get the Schedule C lines for a tax year","description":"Every income and expense account with the Schedule C line it reports on in `year` (null when none is set), and the list of lines.","tags":["Tax form lines"],"parameters":[{"name":"year","in":"path","required":true,"schema":{"type":"integer","minimum":2000,"maximum":2100}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxFormMappingsDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"put":{"operationId":"putMappingsYear","summary":"Set Schedule C lines for a tax year","description":"Administrators only. Sets the line of each listed account for `year`; `lineCode: null` clears it and `excluded` keeps the account off Schedule C. Accounts not listed keep their line. An unknown line code is refused (400 `validation`). Returns the whole year.","tags":["Tax form lines"],"parameters":[{"name":"year","in":"path","required":true,"schema":{"type":"integer","minimum":2000,"maximum":2100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutMappingsYearBody"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxFormMappingsDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/mappings/{year}/copy":{"post":{"operationId":"postMappingsYearCopy","summary":"Copy Schedule C lines from another tax year","description":"Administrators only. Gives each account the line it had in `fromYear`, unless it already has one in `year` (those are kept). Returns the whole year and `copied`, the number of accounts filled in.","tags":["Tax form lines"],"parameters":[{"name":"year","in":"path","required":true,"schema":{"type":"integer","minimum":2000,"maximum":2100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostMappingsYearCopyBody"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CopiedTaxFormMappingsDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/me":{"get":{"operationId":"getMe","summary":"Who am I","description":"The company, role and access of the credential making the request, and its request budget. A cheap way to check that a key works.","tags":["Account"],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/payments":{"get":{"operationId":"getPayments","summary":"List payments received","description":"Newest first unless `sort` and `dir` say otherwise. `unappliedOnly` keeps payments with money not yet applied to invoices; `q` searches the reference and memo. Each payment includes its allocations (amounts applied to invoices).","tags":["Payments received"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageCursor"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["date","amount","customer","unapplied"]}},{"name":"dir","in":"query","required":false,"schema":{"$ref":"#/components/schemas/SortDirection"}},{"name":"contactId","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"from","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"to","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["posted","void"]}},{"name":"unappliedOnly","in":"query","required":false,"schema":{"$ref":"#/components/schemas/QueryBoolean"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetPaymentsResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"post":{"operationId":"postPayments","summary":"Record a payment received","description":"Posts money received into `depositAccountId` (a bank account or Undeposited Funds) and applies the `allocations` to the customer’s invoices; whatever is not applied stays on the payment as credit to apply later with `POST /payments/{id}/allocate`. Allocations cannot exceed the amount (400 `over_allocation`) and must all be invoices of one customer. `bankTransactionId` matches the payment to an unreviewed bank deposit of the same amount in that account. Refused in a locked period (409 `period_locked`).","tags":["Payments received"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePaymentInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/payments/{id}":{"get":{"operationId":"getPaymentsId","summary":"Get a payment received","description":"Includes its allocations (amounts applied to invoices) and what is still unapplied or refunded.","tags":["Payments received"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/payments/{id}/allocate":{"post":{"operationId":"postPaymentsIdAllocate","summary":"Apply a payment to invoices","description":"Applies money left on a payment to invoices, lowering their balances, and posts that to the books on `date` (default: the payment date). The total cannot exceed the unapplied amount (400 `over_allocation`). Send `version` from your last read (409 `version_conflict`); refused on a void payment (409 `invalid_state`) or in a locked period (409 `period_locked`).","tags":["Payments received"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllocatePaymentInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/payments/{id}/void":{"post":{"operationId":"postPaymentsIdVoid","summary":"Void a payment received","description":"Cancels a payment by posting a reversing entry on `date` (default: the payment date); a matched bank line goes back to unreviewed. Refused while any of it is applied to invoices or refunded (409 `invalid_state`): reverse the allocations with `POST /allocations/{id}/reverse` and void the refunds first. Payments collected online cannot be voided; refund them instead. Needs `version` from your last read; refused in a locked period (409 `period_locked`).","tags":["Payments received"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoidPaymentInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/periods":{"get":{"operationId":"getPeriods","summary":"List accounting periods","description":"Every period that was closed, by start date; `status` is `open` once it has been reopened.","tags":["Accounting periods"],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetPeriodsResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"post":{"operationId":"postPeriods","summary":"Close an accounting period","description":"Administrators only. Locks the date range: nothing dated inside it can be posted, changed or reversed (409 `period_locked`) until the period is reopened. Drafts dated inside it stay drafts.","tags":["Accounting periods"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClosePeriodInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/periods/{id}/close":{"post":{"operationId":"postPeriodsIdClose","summary":"Close a reopened accounting period","description":"Administrators only. Locks the period’s dates again after a reopen. Needs `version` from the last read (409 `version_conflict` otherwise).","tags":["Accounting periods"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostPeriodsIdCloseBody"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/periods/{id}/reopen":{"post":{"operationId":"postPeriodsIdReopen","summary":"Reopen an accounting period","description":"Administrators only. Allows posting and changes dated inside the period again, until it is closed with POST /periods/{id}/close. The `reason` is kept in History. Needs `version` from the last read (409 `version_conflict` otherwise).","tags":["Accounting periods"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReopenPeriodInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/processor/charges":{"get":{"operationId":"getProcessorCharges","summary":"List online payments","description":"Card and ACH payments taken through Stripe, newest first, at most `limit` (default 50). Filter by invoice or status.","tags":["Online payments"],"parameters":[{"name":"invoiceId","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ProcessorChargeStatus"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetProcessorChargesResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/processor/charges/{id}":{"get":{"operationId":"getProcessorChargesId","summary":"Get an online payment","description":"With its refunds and disputes, oldest first.","tags":["Online payments"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessorChargeDetailDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/processor/charges/{id}/refund":{"post":{"operationId":"postProcessorChargesIdRefund","summary":"Refund an online payment","description":"Administrators only. Asks Stripe to refund `amount` (an outbound call; real money leaves the connected account) and records the refund in the books; Evenbooks’ fee is refunded in proportion. Only a settled payment, up to `refundableAmount` (400 `over_allocation`). The returned refund has `status: failed` when Stripe declines it; 502 `external_error` when Stripe rejects the request. Needs `version` of the payment from the last read (409 `version_conflict` otherwise).","tags":["Online payments"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundProcessorChargeInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessorRefundDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/processor/connection":{"get":{"operationId":"getProcessorConnection","summary":"Get the Stripe connection","description":"The connected Stripe account, its online payment settings and the Stripe balance recorded in the books. Null when Stripe is not connected or was disconnected.","tags":["Online payments"],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetProcessorConnectionResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"patch":{"operationId":"patchProcessorConnection","summary":"Change online payment settings","description":"Administrators only. Which methods customers may use (card, ACH or both, at least one), partial payments and their minimum, the bank account payouts land in, and whether payouts post automatically. Omitted fields stay as they are. Needs `version` from the last read (409 `version_conflict` otherwise).","tags":["Online payments"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProcessorConnectionInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessorConnectionDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/processor/connection/disconnect":{"post":{"operationId":"postProcessorConnectionDisconnect","summary":"Disconnect Stripe","description":"Administrators only. Customers can no longer pay invoices online. The Stripe account stays the company’s, and Stripe events for it keep posting so the books stay complete. Needs `version` from the last read (409 `version_conflict` otherwise). Returns the connection as it was disconnected; GET /processor/connection returns null afterwards.","tags":["Online payments"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostProcessorConnectionDisconnectBody"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessorConnectionDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/processor/connection/refresh":{"post":{"operationId":"postProcessorConnectionRefresh","summary":"Refresh the Stripe connection","description":"Administrators only. Reads the account’s status and whether it can take charges and receive payouts from Stripe (an outbound call), for example after onboarding.","tags":["Online payments"],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessorConnectionDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/processor/payouts":{"get":{"operationId":"getProcessorPayouts","summary":"List Stripe payouts","description":"The 50 most recent payouts from Stripe to the bank, latest arrival date first, with the journal entry each posted.","tags":["Online payments"],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetProcessorPayoutsResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/purchases":{"get":{"operationId":"getPurchases","summary":"List expenses","description":"Money spent, and vendor refunds received. Newest first unless `sort` and `dir` say otherwise; `accountId` keeps expenses with a line in that category or paid from that account; `q` searches the memo and reference. List items omit `attachments`: get one expense for those.","tags":["Expenses"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageCursor"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["date","total","vendor","reference"]}},{"name":"dir","in":"query","required":false,"schema":{"$ref":"#/components/schemas/SortDirection"}},{"name":"from","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"to","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"contactId","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"accountId","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["posted","void"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetPurchasesResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"post":{"operationId":"postPurchases","summary":"Record an expense","description":"Records money already paid from `paidFromAccountId` (a bank account or card) and posts it to the books on `date`, split over the categories in `lines`; `direction: inflow` records a refund from a vendor. `attachmentIds` attaches uploaded receipts (see `POST /attachments`). Refused in a locked period (409 `period_locked`).","tags":["Expenses"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePurchaseInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/purchases/{id}":{"get":{"operationId":"getPurchasesId","summary":"Get an expense","description":"Includes its lines and attachments.","tags":["Expenses"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/purchases/{id}/void":{"post":{"operationId":"postPurchasesIdVoid","summary":"Void an expense","description":"Cancels an expense by posting a reversing entry on `date` (default: the expense date); a matched bank line goes back to unreviewed. Send `version` from your last read (409 `version_conflict`); refused in a locked period (409 `period_locked`).","tags":["Expenses"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoidPurchaseInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/recurring":{"get":{"operationId":"getRecurring","summary":"List recurring invoices","description":"Every schedule, by name. List items omit `occurrences`, `catchUp` and `templateTotal`: get one schedule for those.","tags":["Recurring invoices"],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetRecurringResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"post":{"operationId":"postRecurring","summary":"Create a recurring invoice","description":"A schedule issues an invoice for the customer on every occurrence from `anchorDate` (until `endDate`, if set), and emails it when `sendEmail` is on (to `emailTo`, or else the customer’s email). Give either `contactId` and `template` (the invoice lines), or `fromInvoiceId` to copy an issued invoice; its payment URL is copied only with `copyPaymentUrl: true`.","tags":["Recurring invoices"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateScheduleInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/recurring/{id}":{"get":{"operationId":"getRecurringId","summary":"Get a recurring invoice","description":"Includes the invoices issued so far (`occurrences`) and, for a paused schedule, the missed occurrences a catch-up resume would issue (`catchUp`).","tags":["Recurring invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"patch":{"operationId":"patchRecurringId","summary":"Change a recurring invoice","description":"Omitted fields stay as they are. A new `template` becomes a new template version used for future invoices only. Send `version` from your last read (409 `version_conflict`); cancelled schedules cannot change (409 `invalid_state`).","tags":["Recurring invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateScheduleInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/recurring/{id}/cancel":{"post":{"operationId":"postRecurringIdCancel","summary":"Cancel a recurring invoice","description":"Stops the schedule for good; invoices already issued stay as they are. Send `version` from your last read (409 `version_conflict`). The reason is kept in History.","tags":["Recurring invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostRecurringIdCancelBody"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/recurring/{id}/pause":{"post":{"operationId":"postRecurringIdPause","summary":"Pause a recurring invoice","description":"Stops issuing until it is resumed. Active schedules only (409 `invalid_state`); send `version` from your last read (409 `version_conflict`).","tags":["Recurring invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostRecurringIdPauseBody"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/recurring/{id}/resume":{"post":{"operationId":"postRecurringIdResume","summary":"Resume a recurring invoice","description":"`catch_up` issues every occurrence missed while paused, right away (listed in the schedule’s `catchUp`); `skip` never issues them and continues from the next one. Paused schedules only (409 `invalid_state`); send `version` from your last read (409 `version_conflict`).","tags":["Recurring invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResumeScheduleInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/recurring/{id}/run":{"post":{"operationId":"postRecurringIdRun","summary":"Issue due recurring invoices now","description":"Issues every occurrence that is due today or earlier and has no invoice yet, as the scheduler would, and emails them if the schedule says so. Works on active and paused schedules; cancelled and completed ones issue nothing. Safe to repeat: an occurrence never gets a second invoice.","tags":["Recurring invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleRunResultDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write"}},"/refunds":{"get":{"operationId":"getRefunds","summary":"List refunds","description":"Money returned to customers, newest first; at most 200. Filter by the payment or credit note refunded, or by customer.","tags":["Refunds"],"parameters":[{"name":"paymentId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"creditNoteId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"contactId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetRefundsResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"post":{"operationId":"postRefunds","summary":"Refund a customer","description":"Pays money back from `fromAccountId` (a bank, card, Undeposited Funds or payment processor account) out of the unapplied part of a payment or the balance left on an issued credit note; more than that is refused (400 `over_allocation`). Posts to the books on `date`, which cannot be before the payment or credit note; refused in a locked period (409 `period_locked`).","tags":["Refunds"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRefundInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/refunds/{id}/void":{"post":{"operationId":"postRefundsIdVoid","summary":"Void a refund","description":"Cancels a refund by posting a reversing entry on the refund’s date; the money is available again on the payment or credit note. Refunds made through Stripe cannot be voided (409 `invalid_state`). Refused in a locked period (409 `period_locked`).","tags":["Refunds"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoidRefundInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"write","x-evenbooks-idempotent":true}},"/reports/balance-sheet":{"get":{"operationId":"getReportsBalanceSheet","summary":"Get the balance sheet","description":"What the business has (assets), what it owes (liabilities) and what is left for the owners (equity) at the end of `asOf`, from posted journal entries (accrual basis only). Profit is not closed into an equity account: earlier fiscal years show as `retainedEarningsPriorYears` and the fiscal year to date as `currentYearEarnings`, and both are part of `totalEquity`. `difference` (assets − liabilities − equity) is \"0.00\" when the books are consistent. Accounts with a zero balance are left out. `compareAsOf` adds a comparison column to the PDF only. `format=csv` has one row per account plus the profit and total rows.","tags":["Reports"],"parameters":[{"name":"asOf","in":"query","required":true,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"compareAsOf","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"format","in":"query","required":false,"description":"`json` (default), `csv` (a download) or `pdf` (a printable download).","schema":{"default":"json","type":"string","enum":["json","csv","pdf"]}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BalanceSheetDto"}},"text/csv":{"schema":{"type":"string"}},"application/pdf":{"schema":{"type":"string","contentEncoding":"binary"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/reports/category":{"get":{"operationId":"getReportsCategory","summary":"Get income and expenses by category","description":"Each income and expense category’s total for `from`–`to` (both days included), with how many transactions touched it (`count`), and net income. `basis=accrual` (default) counts income when invoiced and expenses when billed; `basis=cash` counts them when money moved. Money still in the built-in Uncategorized accounts is listed and repeated in `uncategorized`, never hidden. Cash basis is refused (`invalid_state`) while imported history in the range still needs its cash amounts reviewed. `compareFrom` and `compareTo` add a comparison period to the PDF only.","tags":["Reports"],"parameters":[{"name":"from","in":"query","required":true,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"to","in":"query","required":true,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"basis","in":"query","required":false,"schema":{"default":"accrual","$ref":"#/components/schemas/Basis"}},{"name":"compareFrom","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"compareTo","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"format","in":"query","required":false,"description":"`json` (default), `csv` (a download) or `pdf` (a printable download).","schema":{"default":"json","type":"string","enum":["json","csv","pdf"]}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryReportDto"}},"text/csv":{"schema":{"type":"string"}},"application/pdf":{"schema":{"type":"string","contentEncoding":"binary"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/reports/general-ledger":{"get":{"operationId":"getReportsGeneralLedger","summary":"Get the general ledger for one account","description":"Every posted change to one account from `from` to `to` (both days included), in date order, with the account’s balance after each line (`running`). Accrual basis only. Balances are in the account’s natural direction: positive means a debit balance for assets and expenses, a credit balance for liabilities, equity and income. `opening`, `closing`, `totalDebit` and `totalCredit` always cover the whole range; `lines` is one page (`limit`, default 500, at most 2,000). Pass `nextCursor` as `cursor` for the next page. `format=csv` and `format=pdf` return the whole range in one file: up to 50,000 lines as CSV, 10,000 as PDF. A longer range is refused with a `validation` error (details: `lines`, `maxLines`); ask for shorter ranges.","tags":["Reports"],"parameters":[{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"from","in":"query","required":true,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"to","in":"query","required":true,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":2000}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{1,9}$"}},{"name":"format","in":"query","required":false,"description":"`json` (default), `csv` (a download) or `pdf` (a printable download).","schema":{"default":"json","type":"string","enum":["json","csv","pdf"]}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneralLedgerDto"}},"text/csv":{"schema":{"type":"string"}},"application/pdf":{"schema":{"type":"string","contentEncoding":"binary"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/reports/outstanding-invoices":{"get":{"operationId":"getReportsOutstandingInvoices","summary":"Get unpaid invoices by age","description":"Issued invoices dated on or before `asOf` (default: today in the company’s time zone) that are still unpaid, by due date, with their balance due today, the days past due on `asOf`, and the aging `bucket`: `current` (not yet due), `d1_30`, `d31_60`, `d61_90` and `d90plus` days past due. `aging` totals the balance per bucket. `bucket` (only one bucket) and `group` (`invoice` or `customer` rows) shape the PDF only.","tags":["Reports"],"parameters":[{"name":"asOf","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"bucket","in":"query","required":false,"schema":{"$ref":"#/components/schemas/AgingBucket"}},{"name":"group","in":"query","required":false,"schema":{"type":"string","enum":["invoice","customer"]}},{"name":"format","in":"query","required":false,"description":"`json` (default), `csv` (a download) or `pdf` (a printable download).","schema":{"default":"json","type":"string","enum":["json","csv","pdf"]}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutstandingInvoicesDto"}},"text/csv":{"schema":{"type":"string"}},"application/pdf":{"schema":{"type":"string","contentEncoding":"binary"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/reports/profit-and-loss":{"get":{"operationId":"getReportsProfitAndLoss","summary":"Get the profit and loss report","description":"Income, expenses and net income (income − expenses; negative is a loss) for `from`–`to`, both days included, one line per category with a non-zero total. `basis=accrual` (default) counts income when invoiced and expenses when billed, whether or not money moved; `basis=cash` counts them when money moved (card purchases on the day charged) and adds `salesTaxCollected`, which is a liability, not income. Cash basis is refused (`invalid_state`) while imported history in the range still needs its cash amounts reviewed. Bank transactions not yet reviewed are not included; see `GET /reports/unreviewed`. `compareFrom` and `compareTo` add a comparison column to the PDF only.","tags":["Reports"],"parameters":[{"name":"from","in":"query","required":true,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"to","in":"query","required":true,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"basis","in":"query","required":false,"schema":{"default":"accrual","$ref":"#/components/schemas/Basis"}},{"name":"compareFrom","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"compareTo","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"format","in":"query","required":false,"description":"`json` (default), `csv` (a download) or `pdf` (a printable download).","schema":{"default":"json","type":"string","enum":["json","csv","pdf"]}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfitAndLossDto"}},"text/csv":{"schema":{"type":"string"}},"application/pdf":{"schema":{"type":"string","contentEncoding":"binary"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/reports/schedule-c":{"get":{"operationId":"getReportsScheduleC","summary":"Get the Schedule C summary for a tax year","description":"A summary for IRS Schedule C (Form 1040) for calendar year `taxYear`: each line’s total from the categories mapped to it for that year (see Tax form lines), categories with no line chosen yet (`unmapped`), and money still uncategorized with the line it currently lands on. `grossReceipts` is line 1 − line 2 + line 6, and `tentativeProfit` is gross receipts minus total expenses. `basis` defaults to `cash`; cash basis is refused (`invalid_state`) while imported history still needs its cash amounts reviewed. Meals are shown at 100%: the deduction limit is applied on the return. This is a worksheet, not a filing.","tags":["Reports"],"parameters":[{"name":"taxYear","in":"query","required":true,"schema":{"type":"integer","minimum":2000,"maximum":2100}},{"name":"basis","in":"query","required":false,"schema":{"default":"cash","$ref":"#/components/schemas/Basis"}},{"name":"format","in":"query","required":false,"description":"`json` (default), `csv` (a download) or `pdf` (a printable download).","schema":{"default":"json","type":"string","enum":["json","csv","pdf"]}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleCSummaryDto"}},"text/csv":{"schema":{"type":"string"}},"application/pdf":{"schema":{"type":"string","contentEncoding":"binary"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/reports/transactions":{"get":{"operationId":"getReportsTransactions","summary":"List every ledger line in a date range","description":"Posted journal lines dated `from` to `to` (both days included), in date order, across all accounts (accrual basis). Narrow it to one account (`accountId`), one customer or vendor (`contactId`), one kind of record (`sourceType`), or lines whose entry or line memo contains `q` (case-insensitive). `totalDebit`, `totalCredit` and `lineCount` cover every matching line; `rows` is one page (`limit`, default 200, at most 1,000). Pass `nextCursor` as `cursor` for the next page. `format=csv` and `format=pdf` return every matching line in one file: up to 50,000 lines as CSV, 10,000 as PDF. More is refused with a `validation` error (details: `lines`, `maxLines`); ask for shorter ranges.","tags":["Reports"],"parameters":[{"name":"from","in":"query","required":true,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"to","in":"query","required":true,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"accountId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"contactId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"sourceType","in":"query","required":false,"schema":{"$ref":"#/components/schemas/JournalSourceType"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{1,9}$"}},{"name":"format","in":"query","required":false,"description":"`json` (default), `csv` (a download) or `pdf` (a printable download).","schema":{"default":"json","type":"string","enum":["json","csv","pdf"]}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionsReportDto"}},"text/csv":{"schema":{"type":"string"}},"application/pdf":{"schema":{"type":"string","contentEncoding":"binary"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/reports/trial-balance":{"get":{"operationId":"getReportsTrialBalance","summary":"Get the trial balance","description":"Every account with posted entries on or before `asOf`, with its balance at the end of that day in a debit or a credit column (accrual basis), by account number. `totalDebit` equals `totalCredit` for consistent books. `asOf` is required; `to` is accepted as an older name for it.","tags":["Reports"],"parameters":[{"name":"asOf","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"to","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"format","in":"query","required":false,"description":"`json` (default), `csv` (a download) or `pdf` (a printable download).","schema":{"default":"json","type":"string","enum":["json","csv","pdf"]}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrialBalanceDto"}},"text/csv":{"schema":{"type":"string"}},"application/pdf":{"schema":{"type":"string","contentEncoding":"binary"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/reports/unreviewed":{"get":{"operationId":"getReportsUnreviewed","summary":"Count bank transactions not yet in reports","description":"How many bank transactions dated `from` to `to` (both days included; without `from`, everything on or before `to`) are still waiting for review, and their money in and money out. Reports read only what is recorded, so these are missing from every report until they are categorized, matched or excluded. Call it with a report’s dates to warn that the report is incomplete.","tags":["Reports"],"parameters":[{"name":"from","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PlainDateString"}},{"name":"to","in":"query","required":true,"schema":{"$ref":"#/components/schemas/PlainDateString"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PendingReviewSummaryDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"}},"/tax-rates":{"get":{"operationId":"getTaxRates","summary":"List sales tax rates","description":"By name. Archived rates are left out unless `includeInactive=true`. `withUsage=true` adds `usage`: how many active items default to each rate and how many issued, unpaid invoices carry it.","tags":["Sales tax"],"parameters":[{"name":"includeInactive","in":"query","required":false,"schema":{"$ref":"#/components/schemas/QueryBoolean"}},{"name":"withUsage","in":"query","required":false,"schema":{"$ref":"#/components/schemas/QueryBoolean"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTaxRatesResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"member","x-evenbooks-access":"read"},"post":{"operationId":"postTaxRates","summary":"Create a sales tax rate","description":"Administrators only. `rate` is a fraction (`0.0825` for 8.25%). Tax charged at this rate posts to the Sales Tax Payable account (`liabilityAccountId`).","tags":["Sales tax"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaxRateInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxRateDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/tax-rates/{id}":{"patch":{"operationId":"patchTaxRatesId","summary":"Change a sales tax rate","description":"Administrators only. Omitted fields stay as they are; `isActive: false` archives the rate. Issued invoices keep the rate they were issued with. Needs `version` from the last read (409 `version_conflict` otherwise).","tags":["Sales tax"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTaxRateInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxRateDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/webhook-deliveries/{id}/retry":{"post":{"operationId":"postWebhookDeliveriesIdRetry","summary":"Resend a delivery","description":"Sends the same event again right away, also after it failed for good.","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/webhook-endpoints":{"get":{"operationId":"getWebhookEndpoints","summary":"List webhook endpoints","tags":["Webhooks"],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetWebhookEndpointsResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"read"},"post":{"operationId":"postWebhookEndpoints","summary":"Add a webhook endpoint","description":"Subscribes an https URL to events (an empty `events` list means every event type). The signing secret is in the response and is never shown again.","tags":["Webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookEndpointInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecretDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/webhook-endpoints/{id}":{"get":{"operationId":"getWebhookEndpointsId","summary":"Get a webhook endpoint","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"read"},"patch":{"operationId":"patchWebhookEndpointsId","summary":"Change a webhook endpoint","description":"Omitted fields stay as they are. `enabled: false` turns the endpoint off and drops its pending deliveries; `enabled: true` turns it back on.","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookEndpointInput"}}}},"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"},"delete":{"operationId":"deleteWebhookEndpointsId","summary":"Delete a webhook endpoint","description":"Also deletes its delivery log.","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteWebhookEndpointsIdResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/webhook-endpoints/{id}/deliveries":{"get":{"operationId":"getWebhookEndpointsIdDeliveries","summary":"List deliveries to an endpoint","description":"Newest first. Kept for 30 days.","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/WebhookDeliveryStatus"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetWebhookEndpointsIdDeliveriesResponse"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"read"}},"/webhook-endpoints/{id}/rotate-secret":{"post":{"operationId":"postWebhookEndpointsIdRotateSecret","summary":"Rotate a webhook signing secret","description":"The old secret stops working at once. The new one is in the response and is never shown again.","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecretDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}},"/webhook-endpoints/{id}/test":{"post":{"operationId":"postWebhookEndpointsIdTest","summary":"Send a test event","description":"Sends a `ping` event to the endpoint right away and returns the delivery, including the status code your server answered with.","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","headers":{"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryDto"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}},"x-evenbooks-role":"admin","x-evenbooks-access":"write"}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"evb_…","description":"An API key from Settings → Developers."}},"headers":{"RateLimitRemaining":{"description":"Requests left in the current minute for this key. Also sent: X-RateLimit-Limit, X-RateLimit-Reset (seconds), X-RateLimit-Limit-Day, X-RateLimit-Remaining-Day.","schema":{"type":"integer"}}},"responses":{"E400":{"description":"Validation failed (`validation`, `unbalanced`, `over_allocation`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E401":{"description":"No credential, or the API key is unknown, revoked or expired (`unauthenticated`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E403":{"description":"The key is read-only, lacks the administrator role, or the endpoint is for signed-in people only (`forbidden`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E404":{"description":"The record does not exist in this company (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E409":{"description":"The record changed, is in the wrong state, or is in a closed period (`conflict`, `version_conflict`, `invalid_state`, `period_locked`, `immutable`, `duplicate`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E429":{"description":"Too many requests for this key (`rate_limited`). Wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"AccountDto":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/AccountType"},"role":{"anyOf":[{"$ref":"#/components/schemas/AccountRole"},{"type":"null"}]},"parentId":{"type":["string","null"]},"description":{"type":["string","null"]},"currency":{"type":"string"},"isActive":{"type":"boolean"},"isSystem":{"type":"boolean"},"version":{"type":"integer"},"balance":{"$ref":"#/components/schemas/DecimalString"}},"required":["id","code","name","type","role","parentId","description","currency","isActive","isSystem","version"],"additionalProperties":false},"AccountRole":{"type":"string","enum":["accounts_receivable","customer_deposits","sales_tax_payable","undeposited_funds","bank","credit_card","opening_balance_equity","owner_equity","owner_draws","retained_earnings","sales_discounts","bad_debt","bank_fees","uncategorized_income","uncategorized_expense","rounding","advance_payments","processor_clearing","processor_fees"]},"AccountType":{"type":"string","enum":["asset","liability","equity","income","expense"]},"Address":{"type":"object","properties":{"line1":{"type":"string","maxLength":200},"line2":{"type":"string","maxLength":200},"city":{"type":"string","maxLength":100},"region":{"type":"string","maxLength":100},"postalCode":{"type":"string","maxLength":20},"country":{"type":"string","maxLength":2}},"additionalProperties":false},"AddressInput":{"type":"object","properties":{"line1":{"type":"string","maxLength":200},"line2":{"type":"string","maxLength":200},"city":{"type":"string","maxLength":100},"region":{"type":"string","maxLength":100},"postalCode":{"type":"string","maxLength":20},"country":{"type":"string","maxLength":2}}},"AgingBucket":{"type":"string","enum":["current","d1_30","d31_60","d61_90","d90plus"]},"AllocatePaymentInput":{"type":"object","properties":{"version":{"type":"integer"},"date":{"$ref":"#/components/schemas/PlainDateString"},"allocations":{"minItems":1,"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/PaymentAllocationInput"}},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["version","allocations"]},"AllocationDto":{"type":"object","properties":{"id":{"type":"string"},"sourceType":{"type":"string","enum":["payment","credit_note"]},"paymentId":{"type":["string","null"]},"creditNoteId":{"type":["string","null"]},"invoiceId":{"type":"string"},"invoiceNumber":{"type":["string","null"]},"amount":{"$ref":"#/components/schemas/DecimalString"},"date":{"$ref":"#/components/schemas/PlainDateString"},"status":{"type":"string","enum":["active","reversed"]},"journalEntryId":{"type":["string","null"]},"reversalJournalEntryId":{"type":["string","null"]},"sourceLabel":{"type":"string"}},"required":["id","sourceType","paymentId","creditNoteId","invoiceId","amount","date","status","journalEntryId","reversalJournalEntryId"],"additionalProperties":false},"ApiKeyAccess":{"type":"string","enum":["read","write"]},"ApplyCreditNoteInput":{"type":"object","properties":{"version":{"type":"integer"},"date":{"$ref":"#/components/schemas/PlainDateString"},"allocations":{"minItems":1,"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/PaymentAllocationInput"}},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["version","allocations"]},"AttachmentDto":{"type":"object","properties":{"id":{"type":"string"},"kind":{"$ref":"#/components/schemas/AttachmentKind"},"fileName":{"type":"string"},"contentType":{"type":"string"},"sizeBytes":{"type":"number"},"sha256":{"type":["string","null"]},"status":{"type":"string","enum":["pending","uploaded","deleted"]},"entityType":{"type":["string","null"]},"entityId":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","fileName","contentType","sizeBytes","sha256","status","entityType","entityId","createdAt"],"additionalProperties":false},"AttachmentKind":{"type":"string","enum":["receipt","invoice_pdf","csv_import","other"]},"AuditEventDto":{"type":"object","properties":{"id":{"type":"number"},"actorType":{"type":"string","enum":["user","system","job","api_key"]},"actorId":{"type":"string"},"actorName":{"type":["string","null"]},"action":{"type":"string"},"entityType":{"type":"string"},"entityId":{"type":["string","null"]},"reason":{"type":["string","null"]},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"requestId":{"type":["string","null"]},"jobId":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","actorType","actorId","action","entityType","entityId","reason","details","requestId","jobId","createdAt"],"additionalProperties":false},"BalanceSheetDto":{"type":"object","properties":{"asOf":{"$ref":"#/components/schemas/PlainDateString"},"currency":{"type":"string"},"assets":{"type":"array","items":{"$ref":"#/components/schemas/ReportLineDto"}},"liabilities":{"type":"array","items":{"$ref":"#/components/schemas/ReportLineDto"}},"equity":{"type":"array","items":{"$ref":"#/components/schemas/ReportLineDto"}},"currentYearEarnings":{"$ref":"#/components/schemas/DecimalString"},"retainedEarningsPriorYears":{"$ref":"#/components/schemas/DecimalString"},"totalAssets":{"$ref":"#/components/schemas/DecimalString"},"totalLiabilities":{"$ref":"#/components/schemas/DecimalString"},"totalEquity":{"$ref":"#/components/schemas/DecimalString"},"difference":{"$ref":"#/components/schemas/DecimalString"},"note":{"type":"string"}},"required":["asOf","currency","assets","liabilities","equity","currentYearEarnings","retainedEarningsPriorYears","totalAssets","totalLiabilities","totalEquity","difference","note"],"additionalProperties":false},"BankAccountDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["bank","credit_card"]},"ledgerAccountId":{"type":"string"},"ledgerAccountCode":{"type":"string"},"ledgerAccountName":{"type":"string"},"connectionId":{"type":["string","null"]},"providerAccountId":{"type":["string","null"]},"providerOrgName":{"type":["string","null"]},"currency":{"type":"string"},"lastBalance":{"anyOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"lastBalanceAt":{"type":["string","null"]},"lastSyncedAt":{"type":["string","null"]},"ledgerBalance":{"$ref":"#/components/schemas/DecimalString"},"unreviewedCount":{"type":"integer"},"isActive":{"type":"boolean"},"version":{"type":"integer"}},"required":["id","name","kind","ledgerAccountId","connectionId","providerAccountId","providerOrgName","currency","lastBalance","lastBalanceAt","lastSyncedAt","isActive","version"],"additionalProperties":false},"BankConnectionDto":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string","const":"simplefin"},"name":{"type":"string"},"status":{"$ref":"#/components/schemas/ConnectionStatus"},"syncIntervalMinutes":{"type":"integer"},"nextSyncAt":{"type":["string","null"]},"lastSyncStartedAt":{"type":["string","null"]},"lastSuccessAt":{"type":["string","null"]},"lastError":{"type":["string","null"]},"lastErrorAt":{"type":["string","null"]},"consecutiveFailures":{"type":"integer"},"isStale":{"type":"boolean"},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["bank","credit_card"]},"providerAccountId":{"type":["string","null"]},"providerOrgName":{"type":["string","null"]},"lastBalance":{"anyOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"lastBalanceAt":{"type":["string","null"]},"lastSyncedAt":{"type":["string","null"]}},"required":["id","name","kind","providerAccountId","providerOrgName","lastBalance","lastBalanceAt","lastSyncedAt"],"additionalProperties":false}},"version":{"type":"integer"},"createdAt":{"type":"string"}},"required":["id","provider","name","status","syncIntervalMinutes","nextSyncAt","lastSyncStartedAt","lastSuccessAt","lastError","lastErrorAt","consecutiveFailures","isStale","version","createdAt"],"additionalProperties":false},"BankTransactionDto":{"type":"object","properties":{"id":{"type":"string"},"bankAccountId":{"type":"string"},"bankAccountName":{"type":"string"},"source":{"type":"string","enum":["csv","simplefin","manual"]},"date":{"$ref":"#/components/schemas/PlainDateString"},"amount":{"$ref":"#/components/schemas/DecimalString"},"currency":{"type":"string"},"description":{"type":"string"},"payee":{"type":["string","null"]},"memo":{"type":["string","null"]},"reference":{"type":["string","null"]},"pending":{"type":"boolean"},"status":{"$ref":"#/components/schemas/BankTxnStatus"},"excludedReason":{"type":["string","null"]},"journalEntryId":{"type":["string","null"]},"changedAt":{"type":["string","null"]},"changeNote":{"type":["string","null"]},"reviewedBy":{"type":["string","null"]},"reviewedAt":{"type":["string","null"]},"version":{"type":"integer"},"suggestion":{"anyOf":[{"type":"object","properties":{"ruleId":{"type":"string"},"ruleName":{"type":"string"},"accountId":{"type":"string"},"accountName":{"type":"string"},"contactId":{"type":["string","null"]},"memo":{"type":["string","null"]}},"required":["ruleId","ruleName","accountId","accountName","contactId","memo"],"additionalProperties":false},{"type":"null"}]},"matchHint":{"anyOf":[{"type":"object","properties":{"count":{"type":"integer"},"topScore":{"type":"number"},"transfers":{"type":"integer"},"invoices":{"type":"integer"}},"required":["count","topScore","transfers","invoices"],"additionalProperties":false},{"type":"null"}]}},"required":["id","bankAccountId","source","date","amount","currency","description","payee","memo","reference","pending","status","excludedReason","journalEntryId","changedAt","changeNote","reviewedBy","reviewedAt","version"],"additionalProperties":false},"BankTxnStatus":{"type":"string","enum":["unreviewed","categorized","matched","transfer","excluded"]},"Basis":{"type":"string","enum":["accrual","cash"]},"BulkContactsInput":{"type":"object","properties":{"action":{"type":"string","enum":["archive","unarchive"]},"items":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer"}},"required":["id","version"]}}},"required":["action","items"]},"BulkContactsResultDto":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ok":{"type":"boolean"},"contact":{"$ref":"#/components/schemas/ContactDto"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["id","ok"],"additionalProperties":false}},"succeeded":{"type":"integer"},"failed":{"type":"integer"}},"required":["results","succeeded","failed"],"additionalProperties":false},"BulkInvoiceInput":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"issue"},"items":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer"},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["id","version","idempotencyKey"]}}},"required":["action","items"]},{"type":"object","properties":{"action":{"type":"string","const":"send"},"items":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer"},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["id","version","idempotencyKey"]}},"message":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"required":["action","items"]}]},"BulkInvoiceItemResult":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":["string","null"]},"ok":{"type":"boolean"},"skipped":{"type":"boolean"},"invoice":{"$ref":"#/components/schemas/InvoiceDto"},"email":{"$ref":"#/components/schemas/EmailMessageDto"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["id","number","ok"],"additionalProperties":false},"BulkInvoiceResultDto":{"type":"object","properties":{"action":{"type":"string","enum":["issue","send"]},"results":{"type":"array","items":{"$ref":"#/components/schemas/BulkInvoiceItemResult"}},"succeeded":{"type":"integer"},"failed":{"type":"integer"},"skipped":{"type":"integer"}},"required":["action","results","succeeded","failed","skipped"],"additionalProperties":false},"BulkReviewInput":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"accept_suggestion"},"items":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer"}},"required":["id","version"]}},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["action","items"]},{"type":"object","properties":{"action":{"type":"string","const":"categorize"},"items":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer"}},"required":["id","version"]}},"accountId":{"$ref":"#/components/schemas/Uuid"},"contactId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"memo":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["action","items","accountId"]},{"type":"object","properties":{"action":{"type":"string","const":"transfer"},"items":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer"}},"required":["id","version"]}},"otherLedgerAccountId":{"$ref":"#/components/schemas/Uuid"},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["action","items","otherLedgerAccountId"]},{"type":"object","properties":{"action":{"type":"string","const":"exclude"},"items":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer"}},"required":["id","version"]}},"reason":{"type":"string","minLength":1,"maxLength":500},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["action","items","reason"]},{"type":"object","properties":{"action":{"type":"string","const":"undo"},"items":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer"}},"required":["id","version"]}},"reason":{"type":"string","maxLength":500},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["action","items"]}]},"BulkReviewItemResult":{"type":"object","properties":{"id":{"type":"string"},"ok":{"type":"boolean"},"transaction":{"$ref":"#/components/schemas/BankTransactionDto"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["id","ok"],"additionalProperties":false},"BulkReviewResultDto":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/BulkReviewItemResult"}},"succeeded":{"type":"integer"},"failed":{"type":"integer"}},"required":["results","succeeded","failed"],"additionalProperties":false},"BusinessType":{"type":"string","enum":["sole_proprietor","single_member_llc","partnership","s_corp","c_corp","nonprofit","other"]},"CashTreatment":{"type":"string","enum":["derived","include","exclude"]},"CategorizeInput":{"type":"object","properties":{"version":{"type":"integer"},"contactId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"memo":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"lines":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"accountId":{"$ref":"#/components/schemas/Uuid"},"amount":{"$ref":"#/components/schemas/PositiveDecimalString"},"description":{"default":"","type":"string","maxLength":500}},"required":["accountId","amount"]}},"createRule":{"type":"object","properties":{"pattern":{"type":"string","minLength":1,"maxLength":200},"matchType":{"default":"contains","type":"string","enum":["contains","starts_with","equals"]},"direction":{"type":"string","enum":["any","in","out"]}},"required":["pattern"]},"attachmentIds":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["version","lines"]},"CategoryReportDto":{"type":"object","properties":{"basis":{"$ref":"#/components/schemas/Basis"},"from":{"$ref":"#/components/schemas/PlainDateString"},"to":{"$ref":"#/components/schemas/PlainDateString"},"currency":{"type":"string"},"groups":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["income","expense"]},"lines":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"amount":{"$ref":"#/components/schemas/DecimalString"},"count":{"type":"integer"}},"required":["accountId","code","name","amount","count"],"additionalProperties":false}},"total":{"$ref":"#/components/schemas/DecimalString"}},"required":["type","lines","total"],"additionalProperties":false}},"uncategorized":{"type":"object","properties":{"income":{"$ref":"#/components/schemas/DecimalString"},"expense":{"$ref":"#/components/schemas/DecimalString"}},"required":["income","expense"],"additionalProperties":false},"netIncome":{"$ref":"#/components/schemas/DecimalString"},"note":{"type":"string"}},"required":["basis","from","to","currency","groups","uncategorized","netIncome","note"],"additionalProperties":false},"ClosePeriodInput":{"type":"object","properties":{"startDate":{"$ref":"#/components/schemas/PlainDateString"},"endDate":{"$ref":"#/components/schemas/PlainDateString"},"reason":{"type":"string","maxLength":500}},"required":["startDate","endDate"]},"CommitBatchInput":{"type":"object","properties":{"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}}},"CommitLedgerImportInput":{"type":"object","properties":{"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}}},"CompanyDto":{"type":"object","properties":{"id":{"type":"string"},"clerkOrgId":{"type":"string"},"name":{"type":"string"},"legalName":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"address":{"$ref":"#/components/schemas/Address"},"baseCurrency":{"$ref":"#/components/schemas/CurrencyCode"},"timeZone":{"type":"string"},"fiscalYearStartMonth":{"type":"integer"},"invoicePrefix":{"type":"string"},"nextInvoiceNumber":{"type":"integer"},"creditNotePrefix":{"type":"string"},"defaultTermsDays":{"type":"integer"},"invoiceFooter":{"type":["string","null"]},"hasPostedEntries":{"type":"boolean"},"plan":{"type":"string","enum":["free","paid"]},"transactionDeletionEnabled":{"type":"boolean"},"businessType":{"anyOf":[{"$ref":"#/components/schemas/BusinessType"},{"type":"null"}]},"taxBasis":{"anyOf":[{"$ref":"#/components/schemas/TaxBasis"},{"type":"null"}]},"booksStartDate":{"type":["string","null"]},"setupDismissedAt":{"type":["string","null"]},"version":{"type":"integer"}},"required":["id","clerkOrgId","name","legalName","email","phone","address","baseCurrency","timeZone","fiscalYearStartMonth","invoicePrefix","nextInvoiceNumber","creditNotePrefix","defaultTermsDays","invoiceFooter","hasPostedEntries","plan","transactionDeletionEnabled","businessType","taxBasis","booksStartDate","setupDismissedAt","version"],"additionalProperties":false},"CompleteReconciliationInput":{"type":"object","properties":{"version":{"type":"integer"},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["version"]},"ConnectionStatus":{"type":"string","enum":["active","error","revoked","disabled"]},"ConnectSimpleFinInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"setupToken":{"type":"string","minLength":16,"maxLength":4000},"syncIntervalMinutes":{"default":360,"type":"integer","minimum":60,"maximum":1440}},"required":["name","setupToken"]},"ContactDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"isCustomer":{"type":"boolean"},"isVendor":{"type":"boolean"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"billingAddress":{"$ref":"#/components/schemas/Address"},"notes":{"type":["string","null"]},"isArchived":{"type":"boolean"},"version":{"type":"integer"},"createdAt":{"type":"string"}},"required":["id","name","isCustomer","isVendor","email","phone","billingAddress","notes","isArchived","version","createdAt"],"additionalProperties":false},"CopiedTaxFormMappingsDto":{"type":"object","properties":{"taxYear":{"type":"integer"},"lines":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleCLineDto"},"description":"Every line an account can be mapped to."},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/AccountType"},"isActive":{"type":"boolean"},"lineCode":{"description":"Code of the line this account reports on in `taxYear`; null when none is set.","type":["string","null"]}},"required":["id","code","name","type","isActive","lineCode"],"additionalProperties":false},"description":"Income and expense accounts (archived ones included), by code."},"copied":{"type":"integer","description":"Accounts that got a line from `fromYear`."}},"required":["taxYear","lines","accounts","copied"],"additionalProperties":false},"CreateAccountInput":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":20},"name":{"type":"string","minLength":1,"maxLength":120},"type":{"$ref":"#/components/schemas/AccountType"},"role":{"anyOf":[{"type":"string","enum":["bank","credit_card","owner_equity","owner_draws"]},{"type":"null"}]},"parentId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"scheduleCLine":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}]}},"required":["code","name","type"]},"CreateBankAccountInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"kind":{"type":"string","enum":["bank","credit_card"]},"ledgerAccountId":{"$ref":"#/components/schemas/Uuid"},"newLedgerAccount":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":20},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["code","name"]}},"required":["name","kind"]},"CreateContactInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"isCustomer":{"default":true,"type":"boolean"},"isVendor":{"default":false,"type":"boolean"},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"billingAddress":{"$ref":"#/components/schemas/AddressInput"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"required":["name"]},"CreateCreditNoteInput":{"type":"object","properties":{"contactId":{"$ref":"#/components/schemas/Uuid"},"invoiceId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"issueDate":{"$ref":"#/components/schemas/PlainDateString"},"reason":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"lines":{"minItems":1,"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/DocumentLineInput"}},"documentDiscount":{"anyOf":[{"$ref":"#/components/schemas/DiscountInput"},{"type":"null"}]}},"required":["contactId","issueDate","lines"]},"CreateInvoiceInput":{"type":"object","properties":{"contactId":{"$ref":"#/components/schemas/Uuid"},"issueDate":{"$ref":"#/components/schemas/PlainDateString"},"dueDate":{"$ref":"#/components/schemas/PlainDateString"},"termsDays":{"type":"integer","minimum":0,"maximum":365},"lines":{"minItems":1,"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/DocumentLineInput"}},"documentDiscount":{"anyOf":[{"$ref":"#/components/schemas/DiscountInput"},{"type":"null"}]},"memo":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"footer":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"paymentUrl":{"anyOf":[{"type":"string","maxLength":2000,"format":"starts_with","pattern":"^https:\\/\\/.*"},{"type":"null"}]},"onlinePaymentsDisabled":{"type":"boolean"}},"required":["contactId","issueDate","lines"]},"CreateItemInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"kind":{"default":"service","type":"string","enum":["service","product"]},"unitPrice":{"default":"0","$ref":"#/components/schemas/NonNegativeDecimalString"},"incomeAccountId":{"$ref":"#/components/schemas/Uuid"},"defaultTaxRateIds":{"default":[],"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"required":["name","incomeAccountId"]},"CreateLedgerImportInput":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":255},"content":{"type":"string","minLength":1,"maxLength":10485760}},"required":["fileName","content"]},"CreateManualBankTransactionInput":{"type":"object","properties":{"bankAccountId":{"$ref":"#/components/schemas/Uuid"},"date":{"$ref":"#/components/schemas/PlainDateString"},"amount":{"$ref":"#/components/schemas/DecimalString"},"description":{"type":"string","minLength":1,"maxLength":500},"memo":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["bankAccountId","date","amount","description"]},"CreateManualJournalInput":{"type":"object","properties":{"date":{"$ref":"#/components/schemas/PlainDateString"},"memo":{"default":"","type":"string","maxLength":1000},"cashTreatment":{"type":"string","enum":["include","exclude"]},"lines":{"minItems":2,"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/JournalLineInput"}},"post":{"default":false,"type":"boolean"},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["date","cashTreatment","lines"]},"CreatePaymentInput":{"type":"object","properties":{"contactId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"date":{"$ref":"#/components/schemas/PlainDateString"},"amount":{"$ref":"#/components/schemas/PositiveDecimalString"},"method":{"default":"other","type":"string","enum":["cash","check","card","ach","wire","other"]},"reference":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"memo":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"depositAccountId":{"$ref":"#/components/schemas/Uuid"},"isRefundableDeposit":{"default":false,"type":"boolean"},"allocations":{"default":[],"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/PaymentAllocationInput"}},"bankTransactionId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["date","amount","depositAccountId"]},"CreatePurchaseInput":{"type":"object","properties":{"date":{"$ref":"#/components/schemas/PlainDateString"},"contactId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"paidFromAccountId":{"$ref":"#/components/schemas/Uuid"},"direction":{"default":"outflow","type":"string","enum":["outflow","inflow"]},"reference":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"memo":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"lines":{"minItems":1,"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/PurchaseLineInput"}},"attachmentIds":{"default":[],"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"bankTransactionId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["date","paidFromAccountId","lines"]},"CreateRefundInput":{"type":"object","properties":{"sourceType":{"type":"string","enum":["payment","credit_note"]},"sourceId":{"$ref":"#/components/schemas/Uuid"},"date":{"$ref":"#/components/schemas/PlainDateString"},"amount":{"$ref":"#/components/schemas/PositiveDecimalString"},"fromAccountId":{"$ref":"#/components/schemas/Uuid"},"method":{"default":"other","type":"string","enum":["cash","check","card","ach","wire","other"]},"reference":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"memo":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["sourceType","sourceId","date","amount","fromAccountId"]},"CreateRuleInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"priority":{"default":100,"type":"integer","minimum":1,"maximum":10000},"bankAccountId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"direction":{"default":"any","type":"string","enum":["any","in","out"]},"matchField":{"default":"description","type":"string","enum":["description","payee","any"]},"matchType":{"default":"contains","type":"string","enum":["contains","starts_with","equals"]},"pattern":{"type":"string","minLength":1,"maxLength":200},"amountMin":{"anyOf":[{"$ref":"#/components/schemas/PositiveDecimalString"},{"type":"null"}]},"amountMax":{"anyOf":[{"$ref":"#/components/schemas/PositiveDecimalString"},{"type":"null"}]},"accountId":{"$ref":"#/components/schemas/Uuid"},"contactId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"memo":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["name","pattern","accountId"]},"CreateScheduleInput":{"type":"object","properties":{"fromInvoiceId":{"$ref":"#/components/schemas/Uuid"},"contactId":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string","minLength":1,"maxLength":120},"frequency":{"$ref":"#/components/schemas/Frequency"},"anchorDate":{"$ref":"#/components/schemas/PlainDateString"},"endDate":{"anyOf":[{"$ref":"#/components/schemas/PlainDateString"},{"type":"null"}]},"termsDays":{"type":"integer","minimum":0,"maximum":365},"sendEmail":{"default":false,"type":"boolean"},"emailTo":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"template":{"$ref":"#/components/schemas/RecurringTemplateInput"},"copyPaymentUrl":{"default":false,"type":"boolean"}},"required":["name","frequency","anchorDate"]},"CreateTaxRateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"rate":{"type":"string","pattern":"^0(\\.\\d{1,6})?$"},"agency":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["name","rate"]},"CreateWebhookEndpointInput":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2000},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"events":{"default":[],"maxItems":47,"type":"array","items":{"$ref":"#/components/schemas/WebhookEventType"}}},"required":["url"]},"CreditNoteDto":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/DocumentStatus"},"contactId":{"type":"string"},"contactName":{"type":"string"},"invoiceId":{"type":["string","null"]},"invoiceNumber":{"type":["string","null"]},"customerSnapshot":{"$ref":"#/components/schemas/CustomerSnapshotDto"},"issueDate":{"$ref":"#/components/schemas/PlainDateString"},"reason":{"type":["string","null"]},"documentDiscount":{"anyOf":[{"$ref":"#/components/schemas/Discount"},{"type":"null"}]},"currency":{"type":"string"},"subtotal":{"$ref":"#/components/schemas/DecimalString"},"discountTotal":{"$ref":"#/components/schemas/DecimalString"},"netTotal":{"$ref":"#/components/schemas/DecimalString"},"taxTotal":{"$ref":"#/components/schemas/DecimalString"},"total":{"$ref":"#/components/schemas/DecimalString"},"taxSummary":{"type":"array","items":{"$ref":"#/components/schemas/TaxSummaryDto"}},"amountUsed":{"$ref":"#/components/schemas/DecimalString"},"balance":{"$ref":"#/components/schemas/DecimalString"},"journalEntryId":{"type":["string","null"]},"voidJournalEntryId":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"lines":{"type":"array","items":{"$ref":"#/components/schemas/DocumentLineDto"}},"allocations":{"type":"array","items":{"$ref":"#/components/schemas/AllocationDto"}},"version":{"type":"integer"},"createdAt":{"type":"string"}},"required":["id","number","status","contactId","invoiceId","customerSnapshot","issueDate","reason","documentDiscount","currency","subtotal","discountTotal","netTotal","taxTotal","total","taxSummary","amountUsed","balance","journalEntryId","voidJournalEntryId","voidReason","lines","version","createdAt"],"additionalProperties":false},"CsvColumnName":{"type":"string","maxLength":200},"CsvMapping":{"type":"object","properties":{"date":{"minLength":1,"$ref":"#/components/schemas/CsvColumnName"},"description":{"minLength":1,"$ref":"#/components/schemas/CsvColumnName"},"memo":{"anyOf":[{"$ref":"#/components/schemas/CsvColumnName"},{"type":"null"}]},"reference":{"anyOf":[{"$ref":"#/components/schemas/CsvColumnName"},{"type":"null"}]},"amounts":{"type":"object","properties":{"amount":{"anyOf":[{"$ref":"#/components/schemas/CsvColumnName"},{"type":"null"}]},"debit":{"anyOf":[{"$ref":"#/components/schemas/CsvColumnName"},{"type":"null"}]},"credit":{"anyOf":[{"$ref":"#/components/schemas/CsvColumnName"},{"type":"null"}]},"invert":{"type":"boolean"}},"additionalProperties":false},"dateOrder":{"default":"MDY","type":"string","enum":["YMD","MDY","DMY"]}},"required":["date","description","amounts","dateOrder"],"additionalProperties":false},"CsvMappingInput":{"type":"object","properties":{"date":{"minLength":1,"$ref":"#/components/schemas/CsvColumnName"},"description":{"minLength":1,"$ref":"#/components/schemas/CsvColumnName"},"memo":{"anyOf":[{"$ref":"#/components/schemas/CsvColumnName"},{"type":"null"}]},"reference":{"anyOf":[{"$ref":"#/components/schemas/CsvColumnName"},{"type":"null"}]},"amounts":{"type":"object","properties":{"amount":{"anyOf":[{"$ref":"#/components/schemas/CsvColumnName"},{"type":"null"}]},"debit":{"anyOf":[{"$ref":"#/components/schemas/CsvColumnName"},{"type":"null"}]},"credit":{"anyOf":[{"$ref":"#/components/schemas/CsvColumnName"},{"type":"null"}]},"invert":{"type":"boolean"}}},"dateOrder":{"default":"MDY","type":"string","enum":["YMD","MDY","DMY"]}},"required":["date","description","amounts"]},"CurrencyCode":{"type":"string","pattern":"^[A-Z]{3}$"},"CustomerBalanceDto":{"type":"object","properties":{"contactId":{"type":"string"},"openInvoices":{"type":"array","items":{"$ref":"#/components/schemas/OpenInvoiceDto"}},"unappliedPayments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"date":{"$ref":"#/components/schemas/PlainDateString"},"unappliedAmount":{"$ref":"#/components/schemas/DecimalString"},"reference":{"type":["string","null"]},"isRefundableDeposit":{"type":"boolean"}},"required":["id","date","unappliedAmount","reference","isRefundableDeposit"],"additionalProperties":false}},"openCreditNotes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"issueDate":{"$ref":"#/components/schemas/PlainDateString"},"balance":{"$ref":"#/components/schemas/DecimalString"}},"required":["id","number","issueDate","balance"],"additionalProperties":false}},"totalReceivable":{"$ref":"#/components/schemas/DecimalString"},"totalCredits":{"$ref":"#/components/schemas/DecimalString"}},"required":["contactId","openInvoices","unappliedPayments","openCreditNotes","totalReceivable","totalCredits"],"additionalProperties":false},"CustomerSnapshotDto":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"address":{"$ref":"#/components/schemas/Address"}},"required":["name"],"additionalProperties":false},"DecimalString":{"type":"string","maxLength":32,"pattern":"^-?\\d+(\\.\\d+)?$","description":"decimal string"},"DeleteWebhookEndpointsIdResponse":{"type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"],"additionalProperties":false},"Discount":{"type":"object","properties":{"type":{"type":"string","enum":["percent","fixed"]},"value":{"$ref":"#/components/schemas/NonNegativeDecimalString"}},"required":["type","value"],"additionalProperties":false},"DiscountInput":{"type":"object","properties":{"type":{"type":"string","enum":["percent","fixed"]},"value":{"$ref":"#/components/schemas/NonNegativeDecimalString"}},"required":["type","value"]},"DiscoveredAccountDto":{"type":"object","properties":{"providerAccountId":{"type":"string"},"name":{"type":"string"},"orgName":{"type":["string","null"]},"currency":{"type":"string"},"balance":{"anyOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"balanceDate":{"type":["string","null"]},"bankAccountId":{"type":["string","null"]}},"required":["providerAccountId","name","orgName","currency","balance","balanceDate","bankAccountId"],"additionalProperties":false},"DocumentLineDto":{"type":"object","properties":{"id":{"type":"string"},"lineNo":{"type":"integer"},"itemId":{"type":["string","null"]},"description":{"type":"string"},"quantity":{"type":"string"},"unitPrice":{"type":"string"},"discount":{"anyOf":[{"$ref":"#/components/schemas/Discount"},{"type":"null"}]},"incomeAccountId":{"type":"string"},"incomeAccountName":{"type":"string"},"taxRateIds":{"type":"array","items":{"type":"string"}},"taxes":{"type":"array","items":{"$ref":"#/components/schemas/LineTaxDto"}},"gross":{"$ref":"#/components/schemas/DecimalString"},"lineDiscount":{"$ref":"#/components/schemas/DecimalString"},"documentDiscountShare":{"$ref":"#/components/schemas/DecimalString"},"net":{"$ref":"#/components/schemas/DecimalString"},"taxTotal":{"$ref":"#/components/schemas/DecimalString"},"total":{"$ref":"#/components/schemas/DecimalString"}},"required":["id","lineNo","itemId","description","quantity","unitPrice","discount","incomeAccountId","taxRateIds","taxes","gross","lineDiscount","documentDiscountShare","net","taxTotal","total"],"additionalProperties":false},"DocumentLineInput":{"type":"object","properties":{"itemId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"description":{"type":"string","minLength":1,"maxLength":1000},"quantity":{"default":"1","$ref":"#/components/schemas/NonNegativeDecimalString"},"unitPrice":{"$ref":"#/components/schemas/DecimalString"},"discount":{"anyOf":[{"$ref":"#/components/schemas/DiscountInput"},{"type":"null"}]},"incomeAccountId":{"$ref":"#/components/schemas/Uuid"},"taxRateIds":{"default":[],"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"required":["description","unitPrice","incomeAccountId"]},"DocumentLineInputOutput":{"type":"object","properties":{"itemId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"description":{"type":"string","minLength":1,"maxLength":1000},"quantity":{"default":"1","$ref":"#/components/schemas/NonNegativeDecimalString"},"unitPrice":{"$ref":"#/components/schemas/DecimalString"},"discount":{"anyOf":[{"$ref":"#/components/schemas/Discount"},{"type":"null"}]},"incomeAccountId":{"$ref":"#/components/schemas/Uuid"},"taxRateIds":{"default":[],"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"required":["description","quantity","unitPrice","incomeAccountId","taxRateIds"],"additionalProperties":false},"DocumentPreviewDto":{"type":"object","properties":{"lines":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"quantity":{"type":"string"},"unitPrice":{"type":"string"},"discount":{"anyOf":[{"$ref":"#/components/schemas/Discount"},{"type":"null"}]},"incomeAccountId":{"type":"string"},"taxRateIds":{"type":"array","items":{"type":"string"}},"taxes":{"type":"array","items":{"$ref":"#/components/schemas/LineTaxDto"}},"gross":{"$ref":"#/components/schemas/DecimalString"},"lineDiscount":{"$ref":"#/components/schemas/DecimalString"},"documentDiscountShare":{"$ref":"#/components/schemas/DecimalString"},"net":{"$ref":"#/components/schemas/DecimalString"},"taxTotal":{"$ref":"#/components/schemas/DecimalString"},"total":{"$ref":"#/components/schemas/DecimalString"}},"required":["description","quantity","unitPrice","discount","incomeAccountId","taxRateIds","taxes","gross","lineDiscount","documentDiscountShare","net","taxTotal","total"],"additionalProperties":false}},"subtotal":{"$ref":"#/components/schemas/DecimalString"},"discountTotal":{"$ref":"#/components/schemas/DecimalString"},"netTotal":{"$ref":"#/components/schemas/DecimalString"},"taxTotal":{"$ref":"#/components/schemas/DecimalString"},"total":{"$ref":"#/components/schemas/DecimalString"},"taxSummary":{"type":"array","items":{"$ref":"#/components/schemas/TaxSummaryDto"}}},"required":["lines","subtotal","discountTotal","netTotal","taxTotal","total","taxSummary"],"additionalProperties":false},"DocumentStatus":{"type":"string","enum":["draft","issued","paid","void"]},"EmailMessageDto":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"invoiceId":{"type":["string","null"]},"toEmail":{"type":"string"},"fromEmail":{"type":["string","null"]},"replyTo":{"type":["string","null"]},"templateVersion":{"type":["number","null"]},"subject":{"type":"string"},"status":{"$ref":"#/components/schemas/EmailStatus"},"providerMessageId":{"type":["string","null"]},"attempts":{"type":"integer"},"lastError":{"type":["string","null"]},"isResend":{"type":"boolean"},"requestedBy":{"type":"string"},"queuedAt":{"type":"string"},"sentAt":{"type":["string","null"]},"deliveredAt":{"type":["string","null"]},"failedAt":{"type":["string","null"]}},"required":["id","kind","invoiceId","toEmail","subject","status","providerMessageId","attempts","lastError","isResend","requestedBy","queuedAt","sentAt","deliveredAt","failedAt"],"additionalProperties":false},"EmailStatus":{"type":"string","enum":["queued","sending","sent","delivered","bounced","complained","failed","uncertain","suppressed"]},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Stable machine-readable code; see the error table in the guide."},"message":{"type":"string","description":"A sentence for people. Wording may change."},"details":{"description":"Validation issues or other context."},"requestId":{"type":"string","description":"Quote this when asking for help."}}}}},"ExcludeInput":{"type":"object","properties":{"version":{"type":"integer"},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["version","reason"]},"FailedJobRetryDto":{"type":"object","properties":{"requestedAt":{"type":"string"},"dispatchedAt":{"type":["string","null"]}},"required":["requestedAt","dispatchedAt"],"additionalProperties":false},"Frequency":{"type":"string","enum":["weekly","biweekly","monthly","quarterly","semiannually","yearly"]},"GeneralLedgerDto":{"type":"object","properties":{"accountId":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/AccountType"},"from":{"$ref":"#/components/schemas/PlainDateString"},"to":{"$ref":"#/components/schemas/PlainDateString"},"currency":{"type":"string"},"opening":{"$ref":"#/components/schemas/DecimalString"},"lines":{"type":"array","items":{"$ref":"#/components/schemas/GeneralLedgerLineDto"}},"lineCount":{"type":"integer"},"closing":{"$ref":"#/components/schemas/DecimalString"},"totalDebit":{"$ref":"#/components/schemas/DecimalString"},"totalCredit":{"$ref":"#/components/schemas/DecimalString"},"nextCursor":{"type":["string","null"]},"note":{"type":"string"}},"required":["accountId","code","name","type","from","to","currency","opening","lines","lineCount","closing","totalDebit","totalCredit","nextCursor","note"],"additionalProperties":false},"GeneralLedgerLineDto":{"type":"object","properties":{"entryId":{"type":"string"},"entryNumber":{"anyOf":[{"type":"integer"},{"type":"null"}]},"date":{"$ref":"#/components/schemas/PlainDateString"},"memo":{"type":"string"},"lineMemo":{"type":["string","null"]},"sourceType":{"$ref":"#/components/schemas/JournalSourceType"},"sourceId":{"type":["string","null"]},"contactId":{"type":["string","null"]},"debit":{"$ref":"#/components/schemas/DecimalString"},"credit":{"$ref":"#/components/schemas/DecimalString"},"running":{"$ref":"#/components/schemas/DecimalString"}},"required":["entryId","entryNumber","date","memo","lineMemo","sourceType","sourceId","contactId","debit","credit","running"],"additionalProperties":false},"GetAccountsResponse":{"type":"array","items":{"$ref":"#/components/schemas/AccountDto"}},"GetAttachmentsResponse":{"type":"array","items":{"$ref":"#/components/schemas/AttachmentDto"}},"GetAuditResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AuditEventDto"}},"nextCursor":{"type":["string","null"]},"total":{"type":"integer"}},"required":["items","nextCursor"],"additionalProperties":false},"GetBankingAccountsResponse":{"type":"array","items":{"$ref":"#/components/schemas/BankAccountDto"}},"GetBankingConnectionsIdDiscoverResponse":{"type":"array","items":{"$ref":"#/components/schemas/DiscoveredAccountDto"}},"GetBankingConnectionsResponse":{"type":"array","items":{"$ref":"#/components/schemas/BankConnectionDto"}},"GetBankingImportsResponse":{"type":"array","items":{"$ref":"#/components/schemas/ImportBatchDto"}},"GetBankingReconciliationsResponse":{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationDto"}},"GetBankingRulesResponse":{"type":"array","items":{"$ref":"#/components/schemas/RuleDto"}},"GetBankingTransactionsIdCandidatesResponse":{"type":"array","items":{"$ref":"#/components/schemas/MatchCandidateDto"}},"GetBankingTransactionsIdInvoicesResponse":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceCandidateDto"}},"GetCompanyEmailSendersResponse":{"type":"array","items":{"$ref":"#/components/schemas/SenderIdentityDto"}},"GetContactsResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ContactDto"}},"nextCursor":{"type":["string","null"]},"total":{"type":"integer"}},"required":["items","nextCursor"],"additionalProperties":false},"GetCreditNotesResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CreditNoteDto"}},"nextCursor":{"type":["string","null"]},"total":{"type":"integer"}},"required":["items","nextCursor"],"additionalProperties":false},"GetImportsLedgerResponse":{"type":"array","items":{"$ref":"#/components/schemas/LedgerImportDto"}},"GetInvoicesIdEmailsResponse":{"type":"array","items":{"$ref":"#/components/schemas/EmailMessageDto"}},"GetInvoicesResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceDto"}},"nextCursor":{"type":["string","null"]},"total":{"type":"integer"}},"required":["items","nextCursor"],"additionalProperties":false},"GetItemsResponse":{"type":"array","items":{"$ref":"#/components/schemas/ItemDto"}},"GetJournalResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/JournalEntryDto"}},"nextCursor":{"type":["string","null"]},"total":{"type":"integer"}},"required":["items","nextCursor"],"additionalProperties":false},"GetPaymentsResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PaymentDto"}},"nextCursor":{"type":["string","null"]},"total":{"type":"integer"}},"required":["items","nextCursor"],"additionalProperties":false},"GetPeriodsResponse":{"type":"array","items":{"$ref":"#/components/schemas/PeriodDto"}},"GetProcessorChargesResponse":{"type":"array","items":{"$ref":"#/components/schemas/ProcessorChargeDto"}},"GetProcessorConnectionResponse":{"anyOf":[{"$ref":"#/components/schemas/ProcessorConnectionDto"},{"type":"null"}]},"GetProcessorPayoutsResponse":{"type":"array","items":{"$ref":"#/components/schemas/ProcessorPayoutDto"}},"GetPurchasesResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseDto"}},"nextCursor":{"type":["string","null"]},"total":{"type":"integer"}},"required":["items","nextCursor"],"additionalProperties":false},"GetRecurringResponse":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleDto"}},"GetRefundsResponse":{"type":"array","items":{"$ref":"#/components/schemas/RefundDto"}},"GetTaxRatesResponse":{"type":"array","items":{"$ref":"#/components/schemas/TaxRateDto"}},"GetWebhookEndpointsIdDeliveriesResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDeliveryDto"}},"nextCursor":{"type":["string","null"]},"total":{"type":"integer"}},"required":["items","nextCursor"],"additionalProperties":false},"GetWebhookEndpointsResponse":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpointDto"}},"IdempotencyKey":{"type":"string","minLength":8,"maxLength":128},"ImportBatchDto":{"type":"object","properties":{"id":{"type":"string"},"bankAccountId":{"type":"string"},"source":{"type":"string","enum":["csv","simplefin"]},"fileName":{"type":["string","null"]},"status":{"type":"string","enum":["previewed","committed","discarded","failed"]},"mapping":{"anyOf":[{"$ref":"#/components/schemas/CsvMapping"},{"type":"null"}]},"headers":{"type":"array","items":{"type":"string"}},"rowCount":{"type":"integer"},"importedCount":{"type":"integer"},"duplicateCount":{"type":"integer"},"errorCount":{"type":"integer"},"windowStart":{"anyOf":[{"$ref":"#/components/schemas/PlainDateString"},{"type":"null"}]},"windowEnd":{"anyOf":[{"$ref":"#/components/schemas/PlainDateString"},{"type":"null"}]},"alreadyCommitted":{"type":"boolean"},"createdAt":{"type":"string"},"committedAt":{"type":["string","null"]},"rows":{"type":"array","items":{"$ref":"#/components/schemas/ImportRowDto"}}},"required":["id","bankAccountId","source","fileName","status","mapping","rowCount","importedCount","duplicateCount","errorCount","windowStart","windowEnd","createdAt","committedAt"],"additionalProperties":false},"ImportCashComponentInput":{"type":"object","properties":{"accountId":{"$ref":"#/components/schemas/Uuid"},"amount":{"$ref":"#/components/schemas/DecimalString"}},"required":["accountId","amount"]},"ImportCashComponentInputOutput":{"type":"object","properties":{"accountId":{"$ref":"#/components/schemas/Uuid"},"amount":{"$ref":"#/components/schemas/DecimalString"}},"required":["accountId","amount"],"additionalProperties":false},"ImportRowDto":{"type":"object","properties":{"rowNo":{"type":"integer"},"status":{"type":"string","enum":["ok","duplicate","error"]},"error":{"type":["string","null"]},"date":{"anyOf":[{"$ref":"#/components/schemas/PlainDateString"},{"type":"null"}]},"amount":{"anyOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"description":{"type":["string","null"]},"memo":{"type":["string","null"]},"reference":{"type":["string","null"]},"duplicateOf":{"type":["string","null"]},"raw":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["rowNo","status","error","date","amount","description","memo","reference","duplicateOf","raw"],"additionalProperties":false},"InboxPageDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/BankTransactionDto"}},"nextCursor":{"type":["string","null"]},"counts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer"}},"suggestedCount":{"type":"integer"}},"required":["items","nextCursor","counts","suggestedCount"],"additionalProperties":false},"InvoiceBrandingInput":{"type":"object","properties":{"layout":{"type":"string","enum":["classic","modern"]},"accentColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"paperSize":{"type":"string","enum":["LETTER","A4"]},"showQuantity":{"default":true,"type":"boolean"},"showUnitPrice":{"default":true,"type":"boolean"},"showLineTax":{"default":true,"type":"boolean"},"logo":{"anyOf":[{"type":"string","maxLength":350000,"pattern":"^data:image\\/(png|jpeg);base64,[A-Za-z0-9+/]+=*$"},{"type":"null"}]},"defaultFooter":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"defaultNotes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"paymentInstructions":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"required":["layout","accentColor","paperSize","logo","defaultFooter","defaultNotes","paymentInstructions"]},"InvoiceBrandingInputOutput":{"type":"object","properties":{"layout":{"type":"string","enum":["classic","modern"]},"accentColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"paperSize":{"type":"string","enum":["LETTER","A4"]},"showQuantity":{"default":true,"type":"boolean"},"showUnitPrice":{"default":true,"type":"boolean"},"showLineTax":{"default":true,"type":"boolean"},"logo":{"anyOf":[{"type":"string","maxLength":350000,"pattern":"^data:image\\/(png|jpeg);base64,[A-Za-z0-9+/]+=*$"},{"type":"null"}]},"defaultFooter":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"defaultNotes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"paymentInstructions":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"required":["layout","accentColor","paperSize","showQuantity","showUnitPrice","showLineTax","logo","defaultFooter","defaultNotes","paymentInstructions"],"additionalProperties":false},"InvoiceCandidateDto":{"type":"object","properties":{"invoiceId":{"type":"string"},"number":{"type":"string"},"contactId":{"type":"string"},"contactName":{"type":"string"},"issueDate":{"$ref":"#/components/schemas/PlainDateString"},"dueDate":{"$ref":"#/components/schemas/PlainDateString"},"total":{"$ref":"#/components/schemas/DecimalString"},"balanceDue":{"$ref":"#/components/schemas/DecimalString"},"isOverdue":{"type":"boolean"},"reason":{"type":"string","enum":["exact","customer","close"]},"score":{"type":"number"}},"required":["invoiceId","number","contactId","contactName","issueDate","dueDate","total","balanceDue","isOverdue","reason","score"],"additionalProperties":false},"InvoiceDto":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/DocumentStatus"},"isOverdue":{"type":"boolean"},"contactId":{"type":"string"},"contactName":{"type":"string"},"customerSnapshot":{"$ref":"#/components/schemas/CustomerSnapshotDto"},"issueDate":{"$ref":"#/components/schemas/PlainDateString"},"dueDate":{"$ref":"#/components/schemas/PlainDateString"},"termsDays":{"type":"integer"},"memo":{"type":["string","null"]},"footer":{"type":["string","null"]},"paymentUrl":{"type":["string","null"]},"onlinePaymentsDisabled":{"type":"boolean"},"documentDiscount":{"anyOf":[{"$ref":"#/components/schemas/Discount"},{"type":"null"}]},"currency":{"type":"string"},"subtotal":{"$ref":"#/components/schemas/DecimalString"},"discountTotal":{"$ref":"#/components/schemas/DecimalString"},"netTotal":{"$ref":"#/components/schemas/DecimalString"},"taxTotal":{"$ref":"#/components/schemas/DecimalString"},"total":{"$ref":"#/components/schemas/DecimalString"},"taxSummary":{"type":"array","items":{"$ref":"#/components/schemas/TaxSummaryDto"}},"amountSettled":{"$ref":"#/components/schemas/DecimalString"},"balanceDue":{"$ref":"#/components/schemas/DecimalString"},"journalEntryId":{"type":["string","null"]},"voidJournalEntryId":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"recurringScheduleId":{"type":["string","null"]},"recurringOccurrenceIndex":{"anyOf":[{"type":"integer"},{"type":"null"}]},"hasPublicLink":{"type":"boolean"},"currentPdfAttachmentId":{"type":["string","null"]},"issuedAt":{"type":["string","null"]},"lastSentAt":{"type":["string","null"]},"lines":{"type":"array","items":{"$ref":"#/components/schemas/DocumentLineDto"}},"allocations":{"type":"array","items":{"$ref":"#/components/schemas/AllocationDto"}},"version":{"type":"integer"},"createdAt":{"type":"string"}},"required":["id","number","status","isOverdue","contactId","customerSnapshot","issueDate","dueDate","termsDays","memo","footer","paymentUrl","onlinePaymentsDisabled","documentDiscount","currency","subtotal","discountTotal","netTotal","taxTotal","total","taxSummary","amountSettled","balanceDue","journalEntryId","voidJournalEntryId","voidReason","recurringScheduleId","recurringOccurrenceIndex","hasPublicLink","currentPdfAttachmentId","issuedAt","lastSentAt","lines","version","createdAt"],"additionalProperties":false},"InvoiceEmailPreviewDto":{"type":"object","properties":{"from":{"type":"string"},"replyTo":{"type":["string","null"]},"subject":{"type":"string"},"message":{"type":"string"},"text":{"type":"string"},"html":{"type":"string"},"templateVersion":{"type":"integer"}},"required":["from","replyTo","subject","message","text","html","templateVersion"],"additionalProperties":false},"InvoiceEmailPreviewInput":{"type":"object","properties":{"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"subject":{"type":"string","maxLength":250},"message":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"presentation":{"$ref":"#/components/schemas/InvoicePresentationInput"},"usePlatformSender":{"type":"boolean"}}},"InvoiceEmailTemplateInput":{"type":"object","properties":{"subject":{"type":"string","maxLength":250},"message":{"type":"string","maxLength":5000},"signature":{"type":"string","maxLength":2000},"replyTo":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]}},"required":["subject","message","signature","replyTo"]},"InvoiceEmailTemplateInputOutput":{"type":"object","properties":{"subject":{"type":"string","maxLength":250},"message":{"type":"string","maxLength":5000},"signature":{"type":"string","maxLength":2000},"replyTo":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]}},"required":["subject","message","signature","replyTo"],"additionalProperties":false},"InvoicePdfDto":{"type":"object","properties":{"attachmentId":{"type":"string"},"downloadPath":{"type":"string","description":"Path of the download: `/api/v1/attachments/{attachmentId}/download` for API keys (the app gets its own `/api/...` path)."}},"required":["attachmentId","downloadPath"],"additionalProperties":false},"InvoicePdfVersionDto":{"type":"object","properties":{"version":{"type":"integer"},"attachmentId":{"type":"string"},"reason":{"type":"string","description":"Why it was made: `on_demand`, `manual`, `design_updated` or `email_snapshot`."},"createdAt":{"type":"string"},"sha256":{"type":["string","null"]}},"required":["version","attachmentId","reason","createdAt","sha256"],"additionalProperties":false},"InvoicePdfVersionsDto":{"type":"array","items":{"$ref":"#/components/schemas/InvoicePdfVersionDto"}},"InvoicePresentationDto":{"type":"object","properties":{"branding":{"$ref":"#/components/schemas/InvoiceBrandingInputOutput"},"email":{"$ref":"#/components/schemas/InvoiceEmailTemplateInputOutput"},"version":{"type":"integer","minimum":0}},"required":["branding","email","version"],"additionalProperties":false},"InvoicePresentationInput":{"type":"object","properties":{"branding":{"$ref":"#/components/schemas/InvoiceBrandingInput"},"email":{"$ref":"#/components/schemas/InvoiceEmailTemplateInput"}},"required":["branding","email"]},"IssueCreditNoteInput":{"type":"object","properties":{"version":{"type":"integer"},"applyToInvoiceId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["version"]},"IssueInvoiceInput":{"type":"object","properties":{"version":{"type":"integer"},"issueDate":{"$ref":"#/components/schemas/PlainDateString"},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["version"]},"ItemDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"kind":{"type":"string","enum":["service","product"]},"unitPrice":{"$ref":"#/components/schemas/NonNegativeDecimalString"},"incomeAccountId":{"type":"string"},"defaultTaxRateIds":{"type":"array","items":{"type":"string"}},"isActive":{"type":"boolean"},"version":{"type":"integer"}},"required":["id","name","description","kind","unitPrice","incomeAccountId","defaultTaxRateIds","isActive","version"],"additionalProperties":false},"JobStatusDto":{"type":"object","properties":{"queues":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"created":{"type":"number"},"active":{"type":"number"},"retry":{"type":"number"},"failed":{"type":"number"},"completed":{"type":"number"}},"required":["name","created","active","retry","failed","completed"],"additionalProperties":false}},"failedJobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"createdOn":{"type":"string"},"completedOn":{"type":["string","null"]},"retryCount":{"type":"number"},"output":{},"data":{},"retryable":{"type":"boolean"},"retry":{"anyOf":[{"$ref":"#/components/schemas/FailedJobRetryDto"},{"type":"null"}]}},"required":["id","name","createdOn","completedOn","retryCount","output","data","retryable","retry"],"additionalProperties":false}},"outboxPending":{"type":"number"},"outboxOldestAgeSeconds":{"type":["number","null"]},"staleConnections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"lastSuccessAt":{"type":["string","null"]},"lastError":{"type":["string","null"]}},"required":["id","name","lastSuccessAt","lastError"],"additionalProperties":false}},"emailProblems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"invoiceId":{"type":["string","null"]},"toEmail":{"type":"string"},"status":{"type":"string"},"lastError":{"type":["string","null"]},"queuedAt":{"type":"string"}},"required":["id","invoiceId","toEmail","status","lastError","queuedAt"],"additionalProperties":false}},"workerHeartbeatAt":{"type":["string","null"]},"processorEventProblems":{"type":"array","items":{"$ref":"#/components/schemas/ProcessorEventProblemDto"}}},"required":["queues","failedJobs","outboxPending","outboxOldestAgeSeconds","staleConnections","emailProblems","workerHeartbeatAt","processorEventProblems"],"additionalProperties":false},"JournalEntryDto":{"type":"object","properties":{"id":{"type":"string"},"entryNumber":{"anyOf":[{"type":"integer"},{"type":"null"}]},"date":{"$ref":"#/components/schemas/PlainDateString"},"memo":{"type":"string"},"status":{"$ref":"#/components/schemas/JournalStatus"},"sourceType":{"type":"string"},"sourceId":{"type":["string","null"]},"currency":{"type":"string"},"cashTreatment":{"$ref":"#/components/schemas/CashTreatment"},"cashComponents":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ImportCashComponentInputOutput"}},{"type":"null"}]},"reversesEntryId":{"type":["string","null"]},"reversedByEntryId":{"type":["string","null"]},"postedAt":{"type":["string","null"]},"postedBy":{"type":["string","null"]},"createdBy":{"type":"string"},"createdAt":{"type":"string"},"version":{"type":"integer"},"totalDebit":{"$ref":"#/components/schemas/DecimalString"},"totalCredit":{"$ref":"#/components/schemas/DecimalString"},"lines":{"type":"array","items":{"$ref":"#/components/schemas/JournalLineDto"}}},"required":["id","entryNumber","date","memo","status","sourceType","sourceId","currency","cashTreatment","cashComponents","reversesEntryId","reversedByEntryId","postedAt","postedBy","createdBy","createdAt","version","totalDebit","totalCredit","lines"],"additionalProperties":false},"JournalLineDto":{"type":"object","properties":{"id":{"type":"string"},"lineNo":{"type":"integer"},"accountId":{"type":"string"},"accountCode":{"type":"string"},"accountName":{"type":"string"},"debit":{"$ref":"#/components/schemas/DecimalString"},"credit":{"$ref":"#/components/schemas/DecimalString"},"memo":{"type":["string","null"]},"contactId":{"type":["string","null"]}},"required":["id","lineNo","accountId","debit","credit","memo","contactId"],"additionalProperties":false},"JournalLineInput":{"type":"object","properties":{"accountId":{"$ref":"#/components/schemas/Uuid"},"debit":{"$ref":"#/components/schemas/NonNegativeDecimalString"},"credit":{"$ref":"#/components/schemas/NonNegativeDecimalString"},"memo":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"contactId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]}},"required":["accountId"]},"JournalSourceType":{"type":"string","enum":["manual","opening_balance","invoice","invoice_void","credit_note","credit_note_void","payment","payment_void","allocation","allocation_reversal","refund","refund_void","purchase","purchase_void","transfer","bank_categorization","reversal","adjustment","processor_fee","processor_payout","import"]},"JournalStatus":{"type":"string","enum":["draft","posted"]},"LedgerCsvMapping":{"type":"object","properties":{"date":{"minLength":1,"$ref":"#/components/schemas/CsvColumnName"},"account":{"minLength":1,"$ref":"#/components/schemas/CsvColumnName"},"description":{"anyOf":[{"$ref":"#/components/schemas/CsvColumnName"},{"type":"null"}]},"memo":{"anyOf":[{"$ref":"#/components/schemas/CsvColumnName"},{"type":"null"}]},"reference":{"anyOf":[{"$ref":"#/components/schemas/CsvColumnName"},{"type":"null"}]},"group":{"anyOf":[{"$ref":"#/components/schemas/CsvColumnName"},{"type":"null"}]},"grouping":{"anyOf":[{"type":"string","enum":["sequence","date-description"]},{"type":"null"}]},"amounts":{"type":"object","properties":{"amount":{"anyOf":[{"$ref":"#/components/schemas/CsvColumnName"},{"type":"null"}]},"debit":{"anyOf":[{"$ref":"#/components/schemas/CsvColumnName"},{"type":"null"}]},"credit":{"anyOf":[{"$ref":"#/components/schemas/CsvColumnName"},{"type":"null"}]},"invert":{"type":"boolean"}},"additionalProperties":false},"dateOrder":{"default":"MDY","type":"string","enum":["YMD","MDY","DMY"]}},"required":["date","account","amounts","dateOrder"],"additionalProperties":false},"LedgerCsvMappingInput":{"type":"object","properties":{"date":{"minLength":1,"$ref":"#/components/schemas/CsvColumnName"},"account":{"minLength":1,"$ref":"#/components/schemas/CsvColumnName"},"description":{"anyOf":[{"$ref":"#/components/schemas/CsvColumnName"},{"type":"null"}]},"memo":{"anyOf":[{"$ref":"#/components/schemas/CsvColumnName"},{"type":"null"}]},"reference":{"anyOf":[{"$ref":"#/components/schemas/CsvColumnName"},{"type":"null"}]},"group":{"anyOf":[{"$ref":"#/components/schemas/CsvColumnName"},{"type":"null"}]},"grouping":{"anyOf":[{"type":"string","enum":["sequence","date-description"]},{"type":"null"}]},"amounts":{"type":"object","properties":{"amount":{"anyOf":[{"$ref":"#/components/schemas/CsvColumnName"},{"type":"null"}]},"debit":{"anyOf":[{"$ref":"#/components/schemas/CsvColumnName"},{"type":"null"}]},"credit":{"anyOf":[{"$ref":"#/components/schemas/CsvColumnName"},{"type":"null"}]},"invert":{"type":"boolean"}}},"dateOrder":{"default":"MDY","type":"string","enum":["YMD","MDY","DMY"]}},"required":["date","account","amounts"]},"LedgerImportAccountDto":{"type":"object","properties":{"source":{"type":"string"},"lineCount":{"type":"integer"},"debitTotal":{"$ref":"#/components/schemas/DecimalString"},"creditTotal":{"$ref":"#/components/schemas/DecimalString"},"accountId":{"type":["string","null"]},"problem":{"type":["string","null"]}},"required":["source","lineCount","debitTotal","creditTotal","accountId","problem"],"additionalProperties":false},"LedgerImportDto":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"type":"string"},"status":{"type":"string","enum":["previewed","committed","discarded"]},"mapping":{"anyOf":[{"$ref":"#/components/schemas/LedgerCsvMapping"},{"type":"null"}]},"rowCount":{"type":"integer"},"entryCount":{"type":"integer"},"readyCount":{"type":"integer"},"importedCount":{"type":"integer"},"duplicateCount":{"type":"integer"},"errorCount":{"type":"integer"},"windowStart":{"anyOf":[{"$ref":"#/components/schemas/PlainDateString"},{"type":"null"}]},"windowEnd":{"anyOf":[{"$ref":"#/components/schemas/PlainDateString"},{"type":"null"}]},"createdAt":{"type":"string"},"committedAt":{"type":["string","null"]},"headers":{"type":"array","items":{"type":"string"}},"recognizedFormat":{"anyOf":[{"type":"string","enum":["wave_transactions","wave_ledger"]},{"type":"null"}]},"alreadyCommitted":{"type":"boolean"},"accounts":{"type":"array","items":{"$ref":"#/components/schemas/LedgerImportAccountDto"}},"entries":{"type":"array","items":{"$ref":"#/components/schemas/LedgerImportEntryDto"}},"entriesTruncated":{"type":"boolean"}},"required":["id","fileName","status","mapping","rowCount","entryCount","readyCount","importedCount","duplicateCount","errorCount","windowStart","windowEnd","createdAt","committedAt"],"additionalProperties":false},"LedgerImportEntryDto":{"type":"object","properties":{"key":{"type":"string"},"cashKey":{"type":["string","null"]},"cashReviewRequired":{"type":"boolean"},"cashComponents":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ImportCashComponentInputOutput"}},{"type":"null"}]},"rowNos":{"type":"array","items":{"type":"integer"}},"date":{"anyOf":[{"$ref":"#/components/schemas/PlainDateString"},{"type":"null"}]},"description":{"type":"string"},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["ok","duplicate","error"]},"error":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"rowNo":{"type":"integer"},"account":{"type":"string"},"debit":{"$ref":"#/components/schemas/DecimalString"},"credit":{"$ref":"#/components/schemas/DecimalString"},"memo":{"type":["string","null"]}},"required":["rowNo","account","debit","credit","memo"],"additionalProperties":false}}},"required":["key","cashKey","cashReviewRequired","cashComponents","rowNos","date","description","reference","status","error","lines"],"additionalProperties":false},"LineTaxDto":{"type":"object","properties":{"taxRateId":{"type":"string"},"name":{"type":"string"},"rate":{"type":"string"},"amount":{"$ref":"#/components/schemas/DecimalString"}},"required":["taxRateId","name","rate","amount"],"additionalProperties":false},"LinkProviderAccountsInput":{"type":"object","properties":{"version":{"type":"integer"},"links":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"providerAccountId":{"type":"string","minLength":1,"maxLength":200},"bankAccountId":{"$ref":"#/components/schemas/Uuid"},"create":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"kind":{"type":"string","enum":["bank","credit_card"]},"ledgerAccountId":{"$ref":"#/components/schemas/Uuid"},"newLedgerAccount":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":20},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["code","name"]}},"required":["name","kind"]}},"required":["providerAccountId"]}}},"required":["version","links"]},"MatchCandidateDto":{"type":"object","properties":{"targetType":{"type":"string","enum":["payment","purchase","refund","journal_entry","bank_transaction","processor_payout"]},"targetId":{"type":"string"},"date":{"$ref":"#/components/schemas/PlainDateString"},"amount":{"$ref":"#/components/schemas/DecimalString"},"description":{"type":"string"},"detail":{"type":["string","null"]},"bankAccountName":{"type":["string","null"]},"undeposited":{"type":"boolean"},"score":{"type":"number"}},"required":["targetType","targetId","date","amount","description","detail","score"],"additionalProperties":false},"MatchInput":{"type":"object","properties":{"version":{"type":"integer"},"targets":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"targetType":{"type":"string","enum":["payment","purchase","refund","journal_entry","processor_payout"]},"targetId":{"$ref":"#/components/schemas/Uuid"}},"required":["targetType","targetId"]}},"fee":{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/PositiveDecimalString"},"accountId":{"$ref":"#/components/schemas/Uuid"}},"required":["amount","accountId"]},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["version","targets"]},"MeDto":{"type":"object","properties":{"apiVersion":{"type":"string"},"company":{"$ref":"#/components/schemas/CompanyDto"},"role":{"$ref":"#/components/schemas/MembershipRole"},"auth":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"api_key"},"keyId":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"access":{"$ref":"#/components/schemas/ApiKeyAccess"},"expiresAt":{"type":["string","null"]}},"required":["type","keyId","name","access","expiresAt"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"session"},"userId":{"type":"string"}},"required":["type","userId"],"additionalProperties":false}]},"rateLimit":{"anyOf":[{"$ref":"#/components/schemas/RateLimitDto"},{"type":"null"}]}},"required":["apiVersion","company","role","auth","rateLimit"],"additionalProperties":false},"MembershipRole":{"type":"string","enum":["admin","member"]},"NonNegativeDecimalString":{"type":"string","maxLength":32,"pattern":"^\\d+(\\.\\d+)?$"},"OpeningBalanceLineInput":{"type":"object","properties":{"accountId":{"$ref":"#/components/schemas/Uuid"},"balance":{"$ref":"#/components/schemas/DecimalString"}},"required":["accountId","balance"]},"OpeningBalancesInput":{"type":"object","properties":{"date":{"$ref":"#/components/schemas/PlainDateString"},"lines":{"minItems":1,"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/OpeningBalanceLineInput"}},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["date","lines"]},"OpenInvoiceDto":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"issueDate":{"$ref":"#/components/schemas/PlainDateString"},"dueDate":{"$ref":"#/components/schemas/PlainDateString"},"total":{"$ref":"#/components/schemas/DecimalString"},"balanceDue":{"$ref":"#/components/schemas/DecimalString"},"isOverdue":{"type":"boolean"}},"required":["id","number","issueDate","dueDate","total","balanceDue","isOverdue"],"additionalProperties":false},"OutstandingInvoiceRowDto":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"contactId":{"type":"string"},"contactName":{"type":"string"},"issueDate":{"$ref":"#/components/schemas/PlainDateString"},"dueDate":{"$ref":"#/components/schemas/PlainDateString"},"total":{"$ref":"#/components/schemas/DecimalString"},"balanceDue":{"$ref":"#/components/schemas/DecimalString"},"daysOverdue":{"type":"integer"},"bucket":{"$ref":"#/components/schemas/AgingBucket"}},"required":["id","number","contactId","contactName","issueDate","dueDate","total","balanceDue","daysOverdue","bucket"],"additionalProperties":false},"OutstandingInvoicesDto":{"type":"object","properties":{"asOf":{"$ref":"#/components/schemas/PlainDateString"},"currency":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/OutstandingInvoiceRowDto"}},"aging":{"type":"object","properties":{"current":{"$ref":"#/components/schemas/DecimalString"},"d1_30":{"$ref":"#/components/schemas/DecimalString"},"d31_60":{"$ref":"#/components/schemas/DecimalString"},"d61_90":{"$ref":"#/components/schemas/DecimalString"},"d90plus":{"$ref":"#/components/schemas/DecimalString"}},"required":["current","d1_30","d31_60","d61_90","d90plus"],"additionalProperties":false},"total":{"$ref":"#/components/schemas/DecimalString"},"note":{"type":"string"}},"required":["asOf","currency","items","aging","total","note"],"additionalProperties":false},"PageCursor":{"type":"string","maxLength":2000},"PatchBankingConnectionsIdBody":{"type":"object","properties":{"version":{"type":"integer"},"name":{"type":"string","minLength":1,"maxLength":120},"syncIntervalMinutes":{"type":"integer","minimum":60,"maximum":1440},"status":{"type":"string","enum":["active","disabled"]}},"required":["version"]},"PaymentAllocationInput":{"type":"object","properties":{"invoiceId":{"$ref":"#/components/schemas/Uuid"},"amount":{"$ref":"#/components/schemas/PositiveDecimalString"}},"required":["invoiceId","amount"]},"PaymentDto":{"type":"object","properties":{"id":{"type":"string"},"contactId":{"type":["string","null"]},"contactName":{"type":["string","null"]},"date":{"$ref":"#/components/schemas/PlainDateString"},"currency":{"type":"string"},"amount":{"$ref":"#/components/schemas/DecimalString"},"method":{"type":"string"},"reference":{"type":["string","null"]},"memo":{"type":["string","null"]},"depositAccountId":{"type":"string"},"depositAccountName":{"type":"string"},"isRefundableDeposit":{"type":"boolean"},"status":{"type":"string","enum":["posted","void"]},"amountAllocated":{"$ref":"#/components/schemas/DecimalString"},"amountRefunded":{"$ref":"#/components/schemas/DecimalString"},"unappliedAmount":{"$ref":"#/components/schemas/DecimalString"},"journalEntryId":{"type":"string"},"voidJournalEntryId":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"bankTransactionId":{"type":["string","null"]},"processorChargeId":{"type":["string","null"]},"allocations":{"type":"array","items":{"$ref":"#/components/schemas/AllocationDto"}},"version":{"type":"integer"},"createdAt":{"type":"string"}},"required":["id","contactId","date","currency","amount","method","reference","memo","depositAccountId","isRefundableDeposit","status","amountAllocated","amountRefunded","unappliedAmount","journalEntryId","voidJournalEntryId","voidReason","bankTransactionId","processorChargeId","allocations","version","createdAt"],"additionalProperties":false},"PendingReviewSummaryDto":{"type":"object","properties":{"from":{"anyOf":[{"$ref":"#/components/schemas/PlainDateString"},{"type":"null"}]},"to":{"$ref":"#/components/schemas/PlainDateString"},"currency":{"type":"string"},"count":{"type":"integer"},"moneyIn":{"$ref":"#/components/schemas/DecimalString"},"moneyOut":{"$ref":"#/components/schemas/DecimalString"}},"required":["from","to","currency","count","moneyIn","moneyOut"],"additionalProperties":false},"PeriodDto":{"type":"object","properties":{"id":{"type":"string"},"startDate":{"$ref":"#/components/schemas/PlainDateString"},"endDate":{"$ref":"#/components/schemas/PlainDateString"},"status":{"type":"string","enum":["open","closed"]},"closedAt":{"type":["string","null"]},"closedBy":{"type":["string","null"]},"reopenedAt":{"type":["string","null"]},"reopenedBy":{"type":["string","null"]},"reason":{"type":["string","null"]},"version":{"type":"integer"}},"required":["id","startDate","endDate","status","closedAt","closedBy","reopenedAt","reopenedBy","reason","version"],"additionalProperties":false},"PlainDateString":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"PlatformFeeDto":{"type":"object","properties":{"plan":{"type":"string","enum":["free","paid"]},"cardTotalPercent":{"type":"string"},"achTotalPercent":{"type":"string"}},"required":["plan","cardTotalPercent","achTotalPercent"],"additionalProperties":false},"PositiveDecimalString":{"$ref":"#/components/schemas/NonNegativeDecimalString"},"PostBankingConnectionsIdDisconnectBody":{"type":"object","properties":{"version":{"type":"integer"}},"required":["version"]},"PostBankingConnectionsIdReconnectBody":{"type":"object","properties":{"version":{"type":"integer"},"setupToken":{"type":"string","minLength":16,"maxLength":4000}},"required":["version","setupToken"]},"PostBankingReconciliationsIdReopenBody":{"type":"object","properties":{"version":{"type":"integer"},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["version","reason"]},"PostCompanyEmailSendersIdCancelResponse":{"type":"array","items":{"$ref":"#/components/schemas/SenderIdentityDto"}},"PostCompanyEmailSendersSelectBody":{"type":"object","properties":{"id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["id"]},"PostCompanyEmailSendersSelectResponse":{"type":"array","items":{"$ref":"#/components/schemas/SenderIdentityDto"}},"PostInvoicesIdPdfBody":{"type":"object","properties":{"regenerate":{"default":false,"type":"boolean"},"applyCurrentDesign":{"default":false,"type":"boolean"}}},"PostInvoicesIdPublicLinkBody":{"type":"object","properties":{"action":{"default":"get","type":"string","enum":["get","rotate","revoke"]}}},"PostInvoicesPreviewBody":{"type":"object","properties":{"lines":{"minItems":1,"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/DocumentLineInput"}},"documentDiscount":{"anyOf":[{"$ref":"#/components/schemas/DiscountInput"},{"type":"null"}]}},"required":["lines"]},"PostJournalInput":{"type":"object","properties":{"version":{"type":"integer"},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["version"]},"PostMappingsYearCopyBody":{"type":"object","properties":{"fromYear":{"type":"integer","minimum":2000,"maximum":2100}},"required":["fromYear"]},"PostPeriodsIdCloseBody":{"type":"object","properties":{"version":{"type":"integer"},"reason":{"type":"string","maxLength":500}},"required":["version"]},"PostProcessorConnectionDisconnectBody":{"type":"object","properties":{"version":{"type":"integer"}},"required":["version"]},"PostRecurringIdCancelBody":{"type":"object","properties":{"version":{"type":"integer"},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["version","reason"]},"PostRecurringIdPauseBody":{"type":"object","properties":{"version":{"type":"integer"}},"required":["version"]},"PreviewCsvInput":{"type":"object","properties":{"bankAccountId":{"$ref":"#/components/schemas/Uuid"},"fileName":{"type":"string","minLength":1,"maxLength":255},"content":{"type":"string","minLength":1,"maxLength":5242880},"mapping":{"$ref":"#/components/schemas/CsvMappingInput"}},"required":["bankAccountId","fileName","content"]},"ProcessorChargeDetailDto":{"type":"object","properties":{"id":{"type":"string"},"provider":{"$ref":"#/components/schemas/ProcessorProvider"},"providerPaymentIntentId":{"type":["string","null"]},"providerChargeId":{"type":["string","null"]},"invoiceId":{"type":["string","null"]},"invoiceNumber":{"type":["string","null"]},"contactId":{"type":["string","null"]},"contactName":{"type":["string","null"]},"origin":{"type":"string","enum":["evenbooks","external"]},"method":{"type":"string","enum":["card","ach","unknown"]},"status":{"$ref":"#/components/schemas/ProcessorChargeStatus"},"currency":{"type":"string"},"amount":{"$ref":"#/components/schemas/DecimalString"},"processorFee":{"$ref":"#/components/schemas/DecimalString"},"platformFee":{"$ref":"#/components/schemas/DecimalString"},"platformFeeRefunded":{"$ref":"#/components/schemas/DecimalString"},"amountRefunded":{"$ref":"#/components/schemas/DecimalString"},"amountDisputed":{"$ref":"#/components/schemas/DecimalString"},"refundableAmount":{"$ref":"#/components/schemas/DecimalString"},"paymentId":{"type":["string","null"]},"feeJournalEntryId":{"type":["string","null"]},"payerEmail":{"type":["string","null"]},"description":{"type":["string","null"]},"failureMessage":{"type":["string","null"]},"succeededAt":{"type":["string","null"]},"createdAt":{"type":"string"},"version":{"type":"integer"},"refunds":{"type":"array","items":{"$ref":"#/components/schemas/ProcessorRefundDto"},"description":"Refunds, disputes and dispute reversals against this payment, oldest first."}},"required":["id","provider","providerPaymentIntentId","providerChargeId","invoiceId","invoiceNumber","contactId","contactName","origin","method","status","currency","amount","processorFee","platformFee","platformFeeRefunded","amountRefunded","amountDisputed","refundableAmount","paymentId","feeJournalEntryId","payerEmail","description","failureMessage","succeededAt","createdAt","version","refunds"],"additionalProperties":false},"ProcessorChargeDto":{"type":"object","properties":{"id":{"type":"string"},"provider":{"$ref":"#/components/schemas/ProcessorProvider"},"providerPaymentIntentId":{"type":["string","null"]},"providerChargeId":{"type":["string","null"]},"invoiceId":{"type":["string","null"]},"invoiceNumber":{"type":["string","null"]},"contactId":{"type":["string","null"]},"contactName":{"type":["string","null"]},"origin":{"type":"string","enum":["evenbooks","external"]},"method":{"type":"string","enum":["card","ach","unknown"]},"status":{"$ref":"#/components/schemas/ProcessorChargeStatus"},"currency":{"type":"string"},"amount":{"$ref":"#/components/schemas/DecimalString"},"processorFee":{"$ref":"#/components/schemas/DecimalString"},"platformFee":{"$ref":"#/components/schemas/DecimalString"},"platformFeeRefunded":{"$ref":"#/components/schemas/DecimalString"},"amountRefunded":{"$ref":"#/components/schemas/DecimalString"},"amountDisputed":{"$ref":"#/components/schemas/DecimalString"},"refundableAmount":{"$ref":"#/components/schemas/DecimalString"},"paymentId":{"type":["string","null"]},"feeJournalEntryId":{"type":["string","null"]},"payerEmail":{"type":["string","null"]},"description":{"type":["string","null"]},"failureMessage":{"type":["string","null"]},"succeededAt":{"type":["string","null"]},"createdAt":{"type":"string"},"version":{"type":"integer"}},"required":["id","provider","providerPaymentIntentId","providerChargeId","invoiceId","invoiceNumber","contactId","contactName","origin","method","status","currency","amount","processorFee","platformFee","platformFeeRefunded","amountRefunded","amountDisputed","refundableAmount","paymentId","feeJournalEntryId","payerEmail","description","failureMessage","succeededAt","createdAt","version"],"additionalProperties":false},"ProcessorChargeStatus":{"type":"string","enum":["pending","processing","succeeded","failed","canceled"]},"ProcessorConnectionDto":{"type":"object","properties":{"id":{"type":"string"},"provider":{"$ref":"#/components/schemas/ProcessorProvider"},"providerAccountId":{"type":"string"},"status":{"$ref":"#/components/schemas/ProcessorConnectionStatus"},"chargesEnabled":{"type":"boolean"},"payoutsEnabled":{"type":"boolean"},"detailsSubmitted":{"type":"boolean"},"displayName":{"type":["string","null"]},"origin":{"type":"string","enum":["created","linked"]},"linkedBalance":{"anyOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"linkedAt":{"type":["string","null"]},"clearingAccountId":{"type":"string"},"clearingAccountName":{"type":"string"},"feeAccountId":{"type":"string"},"feeAccountName":{"type":"string"},"payoutBankAccountId":{"type":["string","null"]},"payoutBankAccountName":{"type":["string","null"]},"allowCard":{"type":"boolean"},"allowAch":{"type":"boolean"},"allowPartial":{"type":"boolean"},"minimumPayment":{"$ref":"#/components/schemas/DecimalString"},"autoPostPayouts":{"type":"boolean"},"lastEventAt":{"type":["string","null"]},"lastError":{"type":["string","null"]},"dashboardUrl":{"type":"string"},"platformFee":{"$ref":"#/components/schemas/PlatformFeeDto"},"clearingBalance":{"$ref":"#/components/schemas/DecimalString"},"version":{"type":"integer"},"createdAt":{"type":"string"}},"required":["id","provider","providerAccountId","status","chargesEnabled","payoutsEnabled","detailsSubmitted","displayName","origin","linkedBalance","linkedAt","clearingAccountId","clearingAccountName","feeAccountId","feeAccountName","payoutBankAccountId","payoutBankAccountName","allowCard","allowAch","allowPartial","minimumPayment","autoPostPayouts","lastEventAt","lastError","dashboardUrl","platformFee","clearingBalance","version","createdAt"],"additionalProperties":false},"ProcessorConnectionStatus":{"type":"string","enum":["pending","active","restricted","disconnected"]},"ProcessorEventProblemDto":{"type":"object","properties":{"id":{"type":"number"},"eventType":{"type":"string"},"receivedAt":{"type":"string"},"attempts":{"type":"number"},"lastError":{"type":["string","null"]}},"required":["id","eventType","receivedAt","attempts","lastError"],"additionalProperties":false},"ProcessorPayoutDto":{"type":"object","properties":{"id":{"type":"string"},"providerPayoutId":{"type":"string"},"status":{"type":"string","enum":["pending","in_transit","paid","failed","canceled"]},"currency":{"type":"string"},"amount":{"$ref":"#/components/schemas/DecimalString"},"arrivalDate":{"$ref":"#/components/schemas/PlainDateString"},"description":{"type":["string","null"]},"bankAccountId":{"type":["string","null"]},"bankAccountName":{"type":["string","null"]},"journalEntryId":{"type":["string","null"]},"reversalEntryId":{"type":["string","null"]},"failureMessage":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","providerPayoutId","status","currency","amount","arrivalDate","description","bankAccountId","bankAccountName","journalEntryId","reversalEntryId","failureMessage","createdAt"],"additionalProperties":false},"ProcessorProvider":{"type":"string","enum":["stripe"]},"ProcessorRefundDto":{"type":"object","properties":{"id":{"type":"string"},"chargeId":{"type":"string"},"providerRefundId":{"type":["string","null"]},"providerDisputeId":{"type":["string","null"]},"kind":{"type":"string","enum":["refund","dispute","dispute_reversal"]},"origin":{"type":"string","enum":["evenbooks","external"]},"status":{"type":"string","enum":["pending","succeeded","failed","canceled"]},"amount":{"$ref":"#/components/schemas/DecimalString"},"feeAmount":{"$ref":"#/components/schemas/DecimalString"},"platformFeeRefunded":{"$ref":"#/components/schemas/DecimalString"},"reason":{"type":["string","null"]},"disputeStatus":{"type":["string","null"]},"refundId":{"type":["string","null"]},"paymentId":{"type":["string","null"]},"failureMessage":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","chargeId","providerRefundId","providerDisputeId","kind","origin","status","amount","feeAmount","platformFeeRefunded","reason","disputeStatus","refundId","paymentId","failureMessage","createdAt"],"additionalProperties":false},"ProfitAndLossDto":{"type":"object","properties":{"basis":{"$ref":"#/components/schemas/Basis"},"from":{"$ref":"#/components/schemas/PlainDateString"},"to":{"$ref":"#/components/schemas/PlainDateString"},"currency":{"type":"string"},"income":{"type":"array","items":{"$ref":"#/components/schemas/ReportLineDto"}},"expenses":{"type":"array","items":{"$ref":"#/components/schemas/ReportLineDto"}},"totalIncome":{"$ref":"#/components/schemas/DecimalString"},"totalExpenses":{"$ref":"#/components/schemas/DecimalString"},"netIncome":{"$ref":"#/components/schemas/DecimalString"},"salesTaxCollected":{"$ref":"#/components/schemas/DecimalString"},"note":{"type":"string"}},"required":["basis","from","to","currency","income","expenses","totalIncome","totalExpenses","netIncome","note"],"additionalProperties":false},"PublicLinkStateDto":{"type":"object","properties":{"url":{"type":["string","null"]},"path":{"type":["string","null"]}},"required":["url","path"],"additionalProperties":false},"PurchaseDto":{"type":"object","properties":{"id":{"type":"string"},"date":{"$ref":"#/components/schemas/PlainDateString"},"contactId":{"type":["string","null"]},"contactName":{"type":["string","null"]},"direction":{"type":"string","enum":["outflow","inflow"]},"paidFromAccountId":{"type":"string"},"paidFromAccountName":{"type":"string"},"reference":{"type":["string","null"]},"memo":{"type":["string","null"]},"total":{"$ref":"#/components/schemas/DecimalString"},"currency":{"type":"string"},"status":{"type":"string","enum":["posted","void"]},"journalEntryId":{"type":"string"},"voidJournalEntryId":{"type":["string","null"]},"bankTransactionId":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"lines":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseLineDto"}},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"type":"string"},"contentType":{"type":"string"},"sizeBytes":{"type":"number"}},"required":["id","fileName","contentType","sizeBytes"],"additionalProperties":false}},"version":{"type":"integer"},"createdAt":{"type":"string"}},"required":["id","date","contactId","direction","paidFromAccountId","reference","memo","total","currency","status","journalEntryId","voidJournalEntryId","bankTransactionId","voidReason","lines","version","createdAt"],"additionalProperties":false},"PurchaseLineDto":{"type":"object","properties":{"id":{"type":"string"},"lineNo":{"type":"integer"},"accountId":{"type":"string"},"accountName":{"type":"string"},"accountCode":{"type":"string"},"description":{"type":"string"},"amount":{"$ref":"#/components/schemas/DecimalString"}},"required":["id","lineNo","accountId","description","amount"],"additionalProperties":false},"PurchaseLineInput":{"type":"object","properties":{"accountId":{"$ref":"#/components/schemas/Uuid"},"description":{"default":"","type":"string","maxLength":500},"amount":{"$ref":"#/components/schemas/PositiveDecimalString"}},"required":["accountId","amount"]},"PutMappingsYearBody":{"type":"object","properties":{"entries":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"lineCode":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}]}},"required":["accountId","lineCode"]}}},"required":["entries"]},"QueryBoolean":{"type":"boolean"},"RateLimitDto":{"type":"object","properties":{"perMinute":{"type":"integer"},"perDay":{"type":"integer"}},"required":["perMinute","perDay"],"additionalProperties":false},"ReconciliationDetailDto":{"type":"object","properties":{"id":{"type":"string"},"bankAccountId":{"type":"string"},"bankAccountName":{"type":"string"},"statementStartDate":{"$ref":"#/components/schemas/PlainDateString"},"statementEndDate":{"$ref":"#/components/schemas/PlainDateString"},"statementOpeningBalance":{"$ref":"#/components/schemas/DecimalString"},"statementClosingBalance":{"$ref":"#/components/schemas/DecimalString"},"status":{"type":"string","enum":["in_progress","completed","flagged"]},"clearedBalance":{"$ref":"#/components/schemas/DecimalString"},"discrepancy":{"$ref":"#/components/schemas/DecimalString"},"completedAt":{"type":["string","null"]},"completedBy":{"type":["string","null"]},"flaggedReason":{"type":["string","null"]},"notes":{"type":["string","null"]},"version":{"type":"integer"},"createdAt":{"type":"string"},"lines":{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationLineDto"}},"ledgerBalanceAtEnd":{"$ref":"#/components/schemas/DecimalString"}},"required":["id","bankAccountId","statementStartDate","statementEndDate","statementOpeningBalance","statementClosingBalance","status","clearedBalance","discrepancy","completedAt","completedBy","flaggedReason","notes","version","createdAt","lines","ledgerBalanceAtEnd"],"additionalProperties":false},"ReconciliationDto":{"type":"object","properties":{"id":{"type":"string"},"bankAccountId":{"type":"string"},"bankAccountName":{"type":"string"},"statementStartDate":{"$ref":"#/components/schemas/PlainDateString"},"statementEndDate":{"$ref":"#/components/schemas/PlainDateString"},"statementOpeningBalance":{"$ref":"#/components/schemas/DecimalString"},"statementClosingBalance":{"$ref":"#/components/schemas/DecimalString"},"status":{"type":"string","enum":["in_progress","completed","flagged"]},"clearedBalance":{"anyOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"discrepancy":{"anyOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"completedAt":{"type":["string","null"]},"completedBy":{"type":["string","null"]},"flaggedReason":{"type":["string","null"]},"notes":{"type":["string","null"]},"version":{"type":"integer"},"createdAt":{"type":"string"}},"required":["id","bankAccountId","statementStartDate","statementEndDate","statementOpeningBalance","statementClosingBalance","status","clearedBalance","discrepancy","completedAt","completedBy","flaggedReason","notes","version","createdAt"],"additionalProperties":false},"ReconciliationLineDto":{"type":"object","properties":{"journalLineId":{"type":"string"},"entryId":{"type":"string"},"entryNumber":{"anyOf":[{"type":"integer"},{"type":"null"}]},"date":{"$ref":"#/components/schemas/PlainDateString"},"memo":{"type":"string"},"amount":{"$ref":"#/components/schemas/DecimalString"},"cleared":{"type":"boolean"},"sourceType":{"type":"string"}},"required":["journalLineId","entryId","entryNumber","date","memo","amount","cleared","sourceType"],"additionalProperties":false},"RecordInvoicePaymentInput":{"type":"object","properties":{"version":{"type":"integer"},"invoiceIds":{"minItems":1,"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["version","invoiceIds"]},"RecurringTemplateInput":{"type":"object","properties":{"lines":{"minItems":1,"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/DocumentLineInput"}},"documentDiscount":{"anyOf":[{"$ref":"#/components/schemas/DiscountInput"},{"type":"null"}]},"memo":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"footer":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"paymentUrl":{"anyOf":[{"type":"string","maxLength":2000,"format":"starts_with","pattern":"^https:\\/\\/.*"},{"type":"null"}]}},"required":["lines"]},"RecurringTemplateInputOutput":{"type":"object","properties":{"lines":{"minItems":1,"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/DocumentLineInputOutput"}},"documentDiscount":{"anyOf":[{"$ref":"#/components/schemas/Discount"},{"type":"null"}]},"memo":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"footer":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"paymentUrl":{"anyOf":[{"type":"string","maxLength":2000,"format":"starts_with","pattern":"^https:\\/\\/.*"},{"type":"null"}]}},"required":["lines"],"additionalProperties":false},"RefundDto":{"type":"object","properties":{"id":{"type":"string"},"contactId":{"type":["string","null"]},"sourceType":{"type":"string","enum":["payment","credit_note"]},"paymentId":{"type":["string","null"]},"creditNoteId":{"type":["string","null"]},"date":{"$ref":"#/components/schemas/PlainDateString"},"amount":{"$ref":"#/components/schemas/DecimalString"},"fromAccountId":{"type":"string"},"fromAccountName":{"type":"string"},"method":{"type":"string"},"reference":{"type":["string","null"]},"memo":{"type":["string","null"]},"status":{"type":"string","enum":["posted","void"]},"journalEntryId":{"type":"string"},"voidJournalEntryId":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","contactId","sourceType","paymentId","creditNoteId","date","amount","fromAccountId","method","reference","memo","status","journalEntryId","voidJournalEntryId","createdAt"],"additionalProperties":false},"RefundProcessorChargeInput":{"type":"object","properties":{"version":{"type":"integer"},"amount":{"$ref":"#/components/schemas/PositiveDecimalString"},"reason":{"type":"string","minLength":1,"maxLength":500},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["version","amount","reason"]},"ReopenPeriodInput":{"type":"object","properties":{"version":{"type":"integer"},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["version","reason"]},"ReportLineDto":{"type":"object","properties":{"accountId":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"amount":{"$ref":"#/components/schemas/DecimalString"}},"required":["accountId","code","name","amount"],"additionalProperties":false},"ResumeScheduleInput":{"type":"object","properties":{"version":{"type":"integer"},"mode":{"type":"string","enum":["catch_up","skip"]},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["version","mode"]},"ReverseAllocationInput":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500},"date":{"$ref":"#/components/schemas/PlainDateString"},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["reason"]},"ReverseJournalInput":{"type":"object","properties":{"date":{"$ref":"#/components/schemas/PlainDateString"},"reason":{"type":"string","minLength":1,"maxLength":1000},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["date","reason"]},"ReviewImportedCashInput":{"type":"object","properties":{"version":{"type":"integer"},"reason":{"type":"string","minLength":1,"maxLength":500},"components":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/ImportCashComponentInput"}}},"required":["version","reason","components"]},"RuleDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"priority":{"type":"integer"},"bankAccountId":{"type":["string","null"]},"direction":{"type":"string","enum":["any","in","out"]},"matchField":{"type":"string","enum":["description","payee","any"]},"matchType":{"type":"string","enum":["contains","starts_with","equals","regex"]},"pattern":{"type":"string"},"amountMin":{"anyOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"amountMax":{"anyOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"accountId":{"type":"string"},"accountName":{"type":"string"},"contactId":{"type":["string","null"]},"memo":{"type":["string","null"]},"isActive":{"type":"boolean"},"hitCount":{"type":"integer"},"version":{"type":"integer"}},"required":["id","name","priority","bankAccountId","direction","matchField","matchType","pattern","amountMin","amountMax","accountId","contactId","memo","isActive","hitCount","version"],"additionalProperties":false},"ScheduleCLineDto":{"type":"object","properties":{"code":{"type":"string","description":"Line number, e.g. `1`, `16a`, `27b`; `excluded` keeps a category off Schedule C."},"label":{"type":"string"},"part":{"type":"string","enum":["income","expense","other"]},"note":{"type":"string"}},"required":["code","label","part"],"additionalProperties":false},"ScheduleCSummaryDto":{"type":"object","properties":{"taxYear":{"type":"integer"},"basis":{"$ref":"#/components/schemas/Basis"},"currency":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"label":{"type":"string"},"part":{"type":"string","enum":["income","expense","other"]},"amount":{"$ref":"#/components/schemas/DecimalString"},"accounts":{"type":"array","items":{"$ref":"#/components/schemas/ReportLineDto"}},"note":{"type":"string"}},"required":["code","label","part","amount","accounts"],"additionalProperties":false}},"unmapped":{"type":"array","items":{"$ref":"#/components/schemas/ReportLineDto"}},"uncategorized":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"amount":{"$ref":"#/components/schemas/DecimalString"},"type":{"type":"string","enum":["income","expense"]},"lineCode":{"type":["string","null"]},"lineLabel":{"type":["string","null"]}},"required":["accountId","code","name","amount","type","lineCode","lineLabel"],"additionalProperties":false}},"grossReceipts":{"$ref":"#/components/schemas/DecimalString"},"totalExpenses":{"$ref":"#/components/schemas/DecimalString"},"tentativeProfit":{"$ref":"#/components/schemas/DecimalString"},"note":{"type":"string"}},"required":["taxYear","basis","currency","lines","unmapped","uncategorized","grossReceipts","totalExpenses","tentativeProfit","note"],"additionalProperties":false},"ScheduleDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"$ref":"#/components/schemas/ScheduleStatus"},"contactId":{"type":"string"},"contactName":{"type":"string"},"frequency":{"$ref":"#/components/schemas/Frequency"},"anchorDate":{"$ref":"#/components/schemas/PlainDateString"},"endDate":{"anyOf":[{"$ref":"#/components/schemas/PlainDateString"},{"type":"null"}]},"termsDays":{"type":"integer"},"sendEmail":{"type":"boolean"},"emailTo":{"type":["string","null"]},"templateVersion":{"type":"integer"},"template":{"$ref":"#/components/schemas/RecurringTemplateInputOutput"},"templateTotal":{"$ref":"#/components/schemas/DecimalString"},"lastIssuedIndex":{"anyOf":[{"type":"integer"},{"type":"null"}]},"lastIssuedAt":{"type":["string","null"]},"nextOccurrenceDate":{"anyOf":[{"$ref":"#/components/schemas/PlainDateString"},{"type":"null"}]},"nextRunAt":{"type":["string","null"]},"pausedAt":{"type":["string","null"]},"createdFromInvoiceId":{"type":["string","null"]},"occurrences":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleOccurrenceDto"}},"catchUp":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleOccurrenceDto"}},"version":{"type":"integer"},"createdAt":{"type":"string"}},"required":["id","name","status","contactId","frequency","anchorDate","endDate","termsDays","sendEmail","emailTo","templateVersion","template","lastIssuedIndex","lastIssuedAt","nextOccurrenceDate","nextRunAt","pausedAt","createdFromInvoiceId","version","createdAt"],"additionalProperties":false},"ScheduleOccurrenceDto":{"type":"object","properties":{"index":{"type":"integer"},"date":{"$ref":"#/components/schemas/PlainDateString"},"invoiceId":{"type":["string","null"]},"invoiceNumber":{"type":["string","null"]},"invoiceStatus":{"type":["string","null"]}},"required":["index","date","invoiceId","invoiceNumber","invoiceStatus"],"additionalProperties":false},"ScheduleRunResultDto":{"type":"object","properties":{"issued":{"type":"array","items":{"type":"string"},"description":"Ids of the invoices issued by this run."},"skippedExisting":{"type":"integer","description":"Due occurrences that already had an invoice."}},"required":["issued","skippedExisting"],"additionalProperties":false},"ScheduleStatus":{"type":"string","enum":["active","paused","cancelled","completed"]},"SenderIdentityDto":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"},"fromEmail":{"type":"string"},"fromName":{"type":"string"},"status":{"type":"string","enum":["pending","verified","failed","disabled"]},"active":{"type":"boolean"},"checkedAt":{"type":["string","null"]},"lastError":{"type":["string","null"]},"records":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["TXT","CNAME"]},"value":{"type":"string"},"purpose":{"type":"string"}},"required":["name","type","value","purpose"],"additionalProperties":false}}},"required":["id","domain","fromEmail","fromName","status","active","checkedAt","lastError","records"],"additionalProperties":false},"SenderSetupInput":{"type":"object","properties":{"domain":{"type":"string","maxLength":253,"pattern":"^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"},"fromEmail":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"fromName":{"type":"string","minLength":1,"maxLength":100}},"required":["domain","fromEmail","fromName"]},"SendInvoiceEmailInput":{"type":"object","properties":{"to":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"message":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"subject":{"type":"string","minLength":1,"maxLength":250},"usePlatformSender":{"type":"boolean"},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["to"]},"SortDirection":{"type":"string","enum":["asc","desc"]},"StartReconciliationInput":{"type":"object","properties":{"bankAccountId":{"$ref":"#/components/schemas/Uuid"},"statementStartDate":{"$ref":"#/components/schemas/PlainDateString"},"statementEndDate":{"$ref":"#/components/schemas/PlainDateString"},"statementOpeningBalance":{"$ref":"#/components/schemas/DecimalString"},"statementClosingBalance":{"$ref":"#/components/schemas/DecimalString"},"notes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["bankAccountId","statementStartDate","statementEndDate","statementOpeningBalance","statementClosingBalance"]},"SyncResultDto":{"type":"object","properties":{"connectionId":{"type":"string"},"ok":{"type":"boolean"},"inserted":{"type":"integer"},"updated":{"type":"integer"},"changed":{"type":"integer"},"windowStart":{"anyOf":[{"$ref":"#/components/schemas/PlainDateString"},{"type":"null"}]},"windowEnd":{"anyOf":[{"$ref":"#/components/schemas/PlainDateString"},{"type":"null"}]},"error":{"type":["string","null"]},"warnings":{"type":"array","items":{"type":"string"}}},"required":["connectionId","ok","inserted","updated","changed","windowStart","windowEnd","error","warnings"],"additionalProperties":false},"TaxBasis":{"type":"string","enum":["cash","accrual"]},"TaxFormMappingsDto":{"type":"object","properties":{"taxYear":{"type":"integer"},"lines":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleCLineDto"},"description":"Every line an account can be mapped to."},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/AccountType"},"isActive":{"type":"boolean"},"lineCode":{"description":"Code of the line this account reports on in `taxYear`; null when none is set.","type":["string","null"]}},"required":["id","code","name","type","isActive","lineCode"],"additionalProperties":false},"description":"Income and expense accounts (archived ones included), by code."}},"required":["taxYear","lines","accounts"],"additionalProperties":false},"TaxRateDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"rate":{"type":"string"},"agency":{"type":["string","null"]},"liabilityAccountId":{"type":"string"},"isActive":{"type":"boolean"},"version":{"type":"integer"},"usage":{"type":"object","properties":{"items":{"type":"integer"},"openInvoices":{"type":"integer"}},"required":["items","openInvoices"],"additionalProperties":false}},"required":["id","name","rate","agency","liabilityAccountId","isActive","version"],"additionalProperties":false},"TaxSummaryDto":{"type":"object","properties":{"taxRateId":{"type":"string"},"name":{"type":"string"},"rate":{"type":"string"},"taxable":{"$ref":"#/components/schemas/DecimalString"},"amount":{"$ref":"#/components/schemas/DecimalString"},"liabilityAccountId":{"type":"string"}},"required":["taxRateId","name","rate","taxable","amount","liabilityAccountId"],"additionalProperties":false},"TestInvoiceEmailInput":{"type":"object","properties":{"branding":{"$ref":"#/components/schemas/InvoiceBrandingInput"},"email":{"$ref":"#/components/schemas/InvoiceEmailTemplateInput"},"to":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"idempotencyKey":{"type":"string","minLength":1,"maxLength":200}},"required":["branding","email","to","idempotencyKey"]},"ToggleReconciliationItemsInput":{"type":"object","properties":{"version":{"type":"integer"},"clear":{"default":[],"maxItems":10000,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"unclear":{"default":[],"maxItems":10000,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"required":["version"]},"TransactionsReportDto":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/PlainDateString"},"to":{"$ref":"#/components/schemas/PlainDateString"},"currency":{"type":"string"},"rows":{"type":"array","items":{"$ref":"#/components/schemas/TransactionsReportRowDto"}},"totalDebit":{"$ref":"#/components/schemas/DecimalString"},"totalCredit":{"$ref":"#/components/schemas/DecimalString"},"lineCount":{"type":"integer"},"nextCursor":{"type":["string","null"]},"note":{"type":"string"}},"required":["from","to","currency","rows","totalDebit","totalCredit","lineCount","nextCursor","note"],"additionalProperties":false},"TransactionsReportRowDto":{"type":"object","properties":{"entryId":{"type":"string"},"entryNumber":{"anyOf":[{"type":"integer"},{"type":"null"}]},"date":{"$ref":"#/components/schemas/PlainDateString"},"memo":{"type":"string"},"lineMemo":{"type":["string","null"]},"sourceType":{"$ref":"#/components/schemas/JournalSourceType"},"sourceId":{"type":["string","null"]},"accountId":{"type":"string"},"accountCode":{"type":"string"},"accountName":{"type":"string"},"contactId":{"type":["string","null"]},"contactName":{"type":["string","null"]},"debit":{"$ref":"#/components/schemas/DecimalString"},"credit":{"$ref":"#/components/schemas/DecimalString"}},"required":["entryId","entryNumber","date","memo","lineMemo","sourceType","sourceId","accountId","accountCode","accountName","contactId","contactName","debit","credit"],"additionalProperties":false},"TransferInput":{"type":"object","properties":{"version":{"type":"integer"},"counterpartTransactionId":{"$ref":"#/components/schemas/Uuid"},"otherLedgerAccountId":{"$ref":"#/components/schemas/Uuid"},"memo":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["version"]},"TrialBalanceDto":{"type":"object","properties":{"asOf":{"$ref":"#/components/schemas/PlainDateString"},"currency":{"type":"string"},"rows":{"type":"array","items":{"$ref":"#/components/schemas/TrialBalanceRowDto"}},"totalDebit":{"$ref":"#/components/schemas/DecimalString"},"totalCredit":{"$ref":"#/components/schemas/DecimalString"},"note":{"type":"string"}},"required":["asOf","currency","rows","totalDebit","totalCredit","note"],"additionalProperties":false},"TrialBalanceRowDto":{"type":"object","properties":{"accountId":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/AccountType"},"firstEntryDate":{"$ref":"#/components/schemas/PlainDateString"},"debit":{"$ref":"#/components/schemas/DecimalString"},"credit":{"$ref":"#/components/schemas/DecimalString"}},"required":["accountId","code","name","type","firstEntryDate","debit","credit"],"additionalProperties":false},"UndoReviewInput":{"type":"object","properties":{"version":{"type":"integer"},"reason":{"type":"string","maxLength":500},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["version"]},"UpdateAccountInput":{"type":"object","properties":{"version":{"type":"integer"},"code":{"type":"string","minLength":1,"maxLength":20},"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"parentId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"isActive":{"type":"boolean"}},"required":["version"]},"UpdateBankAccountInput":{"type":"object","properties":{"version":{"type":"integer"},"name":{"type":"string","minLength":1,"maxLength":120},"isActive":{"type":"boolean"}},"required":["version"]},"UpdateCompanyInput":{"type":"object","properties":{"version":{"type":"integer"},"name":{"type":"string","minLength":1,"maxLength":200},"legalName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"address":{"$ref":"#/components/schemas/AddressInput"},"timeZone":{"type":"string","minLength":1,"maxLength":64},"fiscalYearStartMonth":{"type":"integer","minimum":1,"maximum":12},"invoicePrefix":{"type":"string","maxLength":12},"nextInvoiceNumber":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},"creditNotePrefix":{"type":"string","maxLength":12},"defaultTermsDays":{"type":"integer","minimum":0,"maximum":365},"invoiceFooter":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"transactionDeletionEnabled":{"type":"boolean"},"businessType":{"anyOf":[{"$ref":"#/components/schemas/BusinessType"},{"type":"null"}]},"taxBasis":{"anyOf":[{"$ref":"#/components/schemas/TaxBasis"},{"type":"null"}]},"booksStartDate":{"anyOf":[{"$ref":"#/components/schemas/PlainDateString"},{"type":"null"}]},"setupDismissed":{"type":"boolean"}},"required":["version"]},"UpdateContactInput":{"type":"object","properties":{"version":{"type":"integer"},"name":{"type":"string","minLength":1,"maxLength":200},"isCustomer":{"type":"boolean"},"isVendor":{"type":"boolean"},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"billingAddress":{"$ref":"#/components/schemas/AddressInput"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"isArchived":{"type":"boolean"}},"required":["version"]},"UpdateCreditNoteInput":{"type":"object","properties":{"contactId":{"$ref":"#/components/schemas/Uuid"},"invoiceId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"issueDate":{"$ref":"#/components/schemas/PlainDateString"},"reason":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"lines":{"minItems":1,"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/DocumentLineInput"}},"documentDiscount":{"anyOf":[{"$ref":"#/components/schemas/DiscountInput"},{"type":"null"}]},"version":{"type":"integer"}},"required":["version"]},"UpdateDraftJournalInput":{"type":"object","properties":{"version":{"type":"integer"},"date":{"$ref":"#/components/schemas/PlainDateString"},"memo":{"type":"string","maxLength":1000},"cashTreatment":{"type":"string","enum":["include","exclude"]},"lines":{"minItems":2,"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/JournalLineInput"}}},"required":["version"]},"UpdateInvoiceInput":{"type":"object","properties":{"contactId":{"$ref":"#/components/schemas/Uuid"},"issueDate":{"$ref":"#/components/schemas/PlainDateString"},"dueDate":{"$ref":"#/components/schemas/PlainDateString"},"termsDays":{"type":"integer","minimum":0,"maximum":365},"lines":{"minItems":1,"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/DocumentLineInput"}},"documentDiscount":{"anyOf":[{"$ref":"#/components/schemas/DiscountInput"},{"type":"null"}]},"memo":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"footer":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"paymentUrl":{"anyOf":[{"type":"string","maxLength":2000,"format":"starts_with","pattern":"^https:\\/\\/.*"},{"type":"null"}]},"onlinePaymentsDisabled":{"type":"boolean"},"version":{"type":"integer"}},"required":["version"]},"UpdateInvoicePresentationInput":{"type":"object","properties":{"branding":{"$ref":"#/components/schemas/InvoiceBrandingInput"},"email":{"$ref":"#/components/schemas/InvoiceEmailTemplateInput"},"version":{"type":"integer","minimum":0}},"required":["branding","email","version"]},"UpdateItemInput":{"type":"object","properties":{"version":{"type":"integer"},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"kind":{"type":"string","enum":["service","product"]},"unitPrice":{"$ref":"#/components/schemas/NonNegativeDecimalString"},"incomeAccountId":{"$ref":"#/components/schemas/Uuid"},"defaultTaxRateIds":{"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"isActive":{"type":"boolean"}},"required":["version"]},"UpdateLedgerImportInput":{"type":"object","properties":{"mapping":{"$ref":"#/components/schemas/LedgerCsvMappingInput"},"cashOverrides":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-f0-9]{64}$"},"additionalProperties":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/ImportCashComponentInput"}}},"accountMap":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":500},"additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]}}}},"UpdateProcessorConnectionInput":{"type":"object","properties":{"version":{"type":"integer"},"payoutBankAccountId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"allowCard":{"type":"boolean"},"allowAch":{"type":"boolean"},"allowPartial":{"type":"boolean"},"minimumPayment":{"$ref":"#/components/schemas/NonNegativeDecimalString"},"autoPostPayouts":{"type":"boolean"}},"required":["version"]},"UpdateRuleInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"bankAccountId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"pattern":{"type":"string","minLength":1,"maxLength":200},"amountMin":{"anyOf":[{"$ref":"#/components/schemas/PositiveDecimalString"},{"type":"null"}]},"amountMax":{"anyOf":[{"$ref":"#/components/schemas/PositiveDecimalString"},{"type":"null"}]},"accountId":{"$ref":"#/components/schemas/Uuid"},"contactId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"memo":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"priority":{"type":"integer","minimum":1,"maximum":10000},"direction":{"type":"string","enum":["any","in","out"]},"matchField":{"type":"string","enum":["description","payee","any"]},"matchType":{"type":"string","enum":["contains","starts_with","equals"]},"version":{"type":"integer"},"isActive":{"type":"boolean"}},"required":["version"]},"UpdateScheduleInput":{"type":"object","properties":{"version":{"type":"integer"},"name":{"type":"string","minLength":1,"maxLength":120},"endDate":{"anyOf":[{"$ref":"#/components/schemas/PlainDateString"},{"type":"null"}]},"termsDays":{"type":"integer","minimum":0,"maximum":365},"sendEmail":{"type":"boolean"},"emailTo":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"template":{"$ref":"#/components/schemas/RecurringTemplateInput"}},"required":["version"]},"UpdateTaxRateInput":{"type":"object","properties":{"version":{"type":"integer"},"name":{"type":"string","minLength":1,"maxLength":100},"rate":{"type":"string","pattern":"^0(\\.\\d{1,6})?$"},"agency":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"isActive":{"type":"boolean"}},"required":["version"]},"UpdateWebhookEndpointInput":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2000},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"events":{"maxItems":47,"type":"array","items":{"$ref":"#/components/schemas/WebhookEventType"}},"enabled":{"type":"boolean"}}},"Uuid":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"VoidInvoiceInput":{"type":"object","properties":{"version":{"type":"integer"},"reason":{"type":"string","minLength":1,"maxLength":500},"date":{"$ref":"#/components/schemas/PlainDateString"},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["version","reason"]},"VoidPaymentInput":{"type":"object","properties":{"version":{"type":"integer"},"reason":{"type":"string","minLength":1,"maxLength":500},"date":{"$ref":"#/components/schemas/PlainDateString"},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["version","reason"]},"VoidPurchaseInput":{"type":"object","properties":{"version":{"type":"integer"},"reason":{"type":"string","minLength":1,"maxLength":500},"date":{"$ref":"#/components/schemas/PlainDateString"},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["version","reason"]},"VoidRefundInput":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}},"required":["reason"]},"WebhookDeliveryDto":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"endpointId":{"$ref":"#/components/schemas/Uuid"},"eventId":{"$ref":"#/components/schemas/Uuid"},"eventType":{"type":"string"},"entityType":{"type":"string"},"entityId":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/WebhookDeliveryStatus"},"attempts":{"type":"integer"},"nextAttemptAt":{"type":["string","null"]},"lastAttemptAt":{"type":["string","null"]},"lastStatusCode":{"anyOf":[{"type":"integer"},{"type":"null"}]},"lastError":{"type":["string","null"]},"lastResponse":{"type":["string","null"]},"deliveredAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","endpointId","eventId","eventType","entityType","entityId","status","attempts","nextAttemptAt","lastAttemptAt","lastStatusCode","lastError","lastResponse","deliveredAt","createdAt"],"additionalProperties":false},"WebhookDeliveryStatus":{"type":"string","enum":["pending","succeeded","failed"]},"WebhookEndpointDto":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"url":{"type":"string"},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"}},"status":{"$ref":"#/components/schemas/WebhookEndpointStatus"},"disabledReason":{"anyOf":[{"type":"string","enum":["user","failing","key_revoked"]},{"type":"null"}]},"secretPrefix":{"type":"string"},"failingSince":{"type":["string","null"]},"lastSuccessAt":{"type":["string","null"]},"lastFailureAt":{"type":["string","null"]},"createdBy":{"type":"string"},"configuredByApiKey":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","url","description","events","status","disabledReason","secretPrefix","failingSince","lastSuccessAt","lastFailureAt","createdBy","configuredByApiKey","createdAt","updatedAt"],"additionalProperties":false},"WebhookEndpointStatus":{"type":"string","enum":["enabled","disabled"]},"WebhookEndpointWithSecretDto":{"type":"object","properties":{"endpoint":{"$ref":"#/components/schemas/WebhookEndpointDto"},"secret":{"type":"string"}},"required":["endpoint","secret"],"additionalProperties":false},"WebhookEventType":{"type":"string","enum":["invoice.draft_created","invoice.issued","invoice.paid","invoice.voided","invoice.email_sent","invoice.email_failed","invoice.deleted","credit_note.issued","credit_note.applied","credit_note.voided","credit_note.deleted","payment.created","payment.allocated","payment.allocation_reversed","payment.voided","payment.deleted","refund.created","refund.voided","refund.deleted","purchase.created","purchase.voided","purchase.deleted","journal.posted","journal.reversed","journal_entry.deleted","bank_transaction.created","bank_transaction.categorized","bank_transaction.matched","bank_transaction.transfer","bank_transaction.excluded","bank_transaction.review_undone","bank_transaction.deleted","bank_connection.synced","bank_connection.sync_failed","import.committed","contact.created","contact.updated","contact.archived","item.created","item.updated","recurring.issued","reconciliation.completed","period.closed","period.reopened","processor.charge_settled","processor.dispute_opened","processor.payout_posted"]}}}}