{"openapi":"3.1.0","info":{"title":"Rillet Accounting API","version":"v4.0"},"x-mcp-ready":true,"x-readme":{"headers":[{"key":"X-Rillet-API-Version","value":"4"}]},"servers":[{"url":"https://api.rillet.com","description":"Production server url"},{"url":"https://sandbox.api.rillet.com","description":"Test server url"}],"security":[{"bearerAuth":[]}],"paths":{"/accounts":{"get":{"tags":["Chart of Accounts"],"operationId":"list-all-accounts","summary":"Lists all accounts","description":"Returns the chart of accounts for the organization tied to the API credentials.\nUse optional filters (for example updated.gt) to sync only accounts changed since a prior run.\nAccount ids are stable identifiers used when creating journal entries, bills, and other postings.\n","parameters":[{"name":"updated.gt","in":"query","required":false,"description":"Filter accounts updated after this timestamp","schema":{"type":"string","format":"date-time","example":"2023-01-01T00:00:00Z"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["accounts"],"type":"object","properties":{"accounts":{"type":"array","items":{"$ref":"#/components/schemas/Account"}}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Chart of Accounts"],"operationId":"create-an-account","summary":"Creates an account","description":"Adds an account to the chart of accounts for the organization.\nThe account currency is inherited from the organization, its status is ACTIVE, and its default grouping and closing behavior are derived from the selected type and subtype.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAccountRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/subsidiaries":{"get":{"tags":["Subsidiaries"],"operationId":"list-all-subsidiaries","summary":"Lists all subsidiaries","description":"Returns legal-entity subsidiaries for the authenticated organization.\nUse this to discover subsidiary UUIDs before calling endpoints that accept subsidiary_id (contracts, invoices, reports).\nEach subsidiary carries currency and timezone used for localized accounting and reporting.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["subsidiaries"],"type":"object","properties":{"subsidiaries":{"type":"array","items":{"$ref":"#/components/schemas/Subsidiary"}}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/subsidiaries/{subsidiary_id}":{"get":{"tags":["Subsidiaries"],"operationId":"retrieve-a-subsidiary","summary":"Retrieves a subsidiary","description":"Returns one subsidiary by id for the authenticated organization.\nCall list-all-subsidiaries first if you need to resolve which subsidiary id to use.\n","parameters":[{"name":"subsidiary_id","in":"path","required":true,"description":"UUID of the subsidiary to retrieve (must belong to the organization).","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subsidiary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/organizations/self":{"get":{"tags":["Organizations"],"operationId":"retrieve-an-organization","summary":"Retrieves an organization","description":"Returns the organization profile for the API credentials in use (the “current” org).\nUse this to confirm organization id, display name, and other org-level settings in integrations.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/approval-workflows":{"get":{"tags":["Approval Workflows"],"operationId":"list-all-approval-workflows","summary":"Lists all approval workflows","description":"Returns every approval workflow in the organization tied to the API credentials, active and inactive,\ngrouped by the kind of record they apply to and ordered by ascending `priority` within each group.\n\nThis endpoint is not paginated and returns the complete set.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["approval_workflows"],"type":"object","properties":{"approval_workflows":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalWorkflow"}}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/approval-workflows/{approval_workflow_id}":{"get":{"tags":["Approval Workflows"],"operationId":"retrieve-an-approval-workflow","summary":"Retrieves an approval workflow","description":"Returns one approval workflow: the conditions that decide which entries it applies to, and the ordered\nlayers of approvers that must sign off. This is the control definition, not a record of approvals given.\nApproval workflows are not versioned — the response describes the workflow as it stands now, and an\nupdate overwrites it in place.\n","parameters":[{"name":"approval_workflow_id","in":"path","description":"UUID of the approval workflow to be used in this operation.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalWorkflow"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Approval Workflows"],"operationId":"update-an-approval-workflow","summary":"Updates an approval workflow","description":"Replaces an approval workflow's definition. The whole definition is required — a partial body is\nrejected, not merged, and fields this contract does not define are ignored. Send `type` and\n`active` back as read; changing either here is rejected, and combinations the Rillet app cannot\nconfigure are rejected too (see the individual fields).\n\nEntries already awaiting approval are unaffected, because an entry copies the layers it needs when\napproval starts; only entries registered after this call use the new definition. Deadlines and layer\nescalation rules are not part of this contract and are cleared, exactly as saving a workflow in\nRillet clears them.\n","parameters":[{"name":"approval_workflow_id","in":"path","description":"UUID of the approval workflow to be used in this operation.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalWorkflowRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalWorkflow"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/products":{"get":{"tags":["Products"],"operationId":"list-all-products","summary":"Lists all products","description":"Returns sellable products and services for accounts receivable (contracts, invoices).\nSupports pagination and optional filters such as status and currency.\n","parameters":[{"name":"status","in":"query","description":"Optional status filter (allowed values depend on the resource).","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"name":"currency","in":"query","description":"Optional ISO currency code filter.","required":false,"schema":{"$ref":"#/components/schemas/CurrencyCode"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["products","pagination"],"type":"object","properties":{"products":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Products"],"operationId":"create-a-product","summary":"Creates a product","description":"Creates a new product (good or service) that can be referenced on contracts and invoices.\nChoose pricing and revenue behavior consistent with how you bill customers (one-time, recurring, usage, etc.).\n","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/products/{product_id}":{"get":{"tags":["Products"],"operationId":"retrieve-a-product","summary":"Retrieves a product","description":"Returns a single product definition including pricing configuration used on contracts and invoices.\n","parameters":[{"name":"product_id","in":"path","required":true,"description":"UUID of the product to retrieve.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Products"],"operationId":"update-a-product","summary":"Updates a product","description":"Updates a single product definition in the catalog.\nIMPORTANT: This is a full-replace operation (PUT semantics). Include every field expected by ProductRequest;\nomitted fields may be cleared. Call retrieve-a-product first, merge your changes, then submit the full body.\n","parameters":[{"name":"product_id","in":"path","required":true,"description":"UUID of the product to update.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Products"],"operationId":"delete-a-product","summary":"Deletes a product","description":"Permanently removes a product. Ensure no in-flight contracts or invoices require this product before deleting.\n","parameters":[{"name":"product_id","in":"path","required":true,"description":"UUID of the product to delete.","schema":{"type":"string"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/customers":{"get":{"tags":["Customers"],"operationId":"list-all-customers","summary":"Lists all customers","description":"Returns customers for accounts receivable with pagination and optional search or external-reference filters.\n","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"name":"search","in":"query","required":false,"schema":{"type":"string"},"description":"Filter customer by name."},{"name":"external_reference_id","in":"query","required":false,"schema":{"type":"string"},"description":"If this is provided, `external_reference_type` must also be provided.\n"},{"name":"external_reference_type","in":"query","required":false,"schema":{"type":"string"},"description":"If this is provided, `external_reference_id` must also be provided.\n"},{"name":"updated.gt","in":"query","required":false,"description":"Filter customers updated after this timestamp","schema":{"type":"string","format":"date-time","example":"2023-01-01T00:00:00Z"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","enum":["created","updated"],"default":"created"},"description":"the field the customers should be sorted by descending (either created or updated)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["customers"],"type":"object","properties":{"customers":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Customers"],"operationId":"create-a-customer","summary":"Creates a customer","description":"Creates a new customer in the Accounts Receivable catalog.\nRequired fields: name. When providing an address, all of these fields are required:\nline1, city, state (2-letter code e.g. 'TN', 'CA'), zip_code, country.\n","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/customers/{customer_id}":{"get":{"tags":["Customers"],"operationId":"retrieve-a-customer","summary":"Retrieves a customer","description":"Returns a single customer record including billing profile details, which are needed for updates.\n","parameters":[{"name":"customer_id","in":"path","required":true,"description":"UUID of the customer to retrieve.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Customers"],"operationId":"update-a-customer","summary":"Updates a customer","description":"Updates a single customer record in the catalog.\nIMPORTANT: This is a full-replace operation (PUT semantics). All fields must be\nincluded in the request body — omitting any field will set it to null, wiping\nexisting data. Always call retrieve-a-customer first to fetch the current record,\nthen include ALL existing fields in your update request along with your changes.\n","parameters":[{"name":"customer_id","in":"path","description":"UUID of the customer to be used in this operation.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Customers"],"operationId":"delete-a-customer","summary":"Deletes a customer","description":"Permanently deletes a customer. Verify no active contracts or open invoices reference this customer first.\n","parameters":[{"name":"customer_id","in":"path","required":true,"description":"UUID of the customer to delete.","schema":{"type":"string"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/customers/{customer_id}/settings/payment":{"post":{"tags":["Customer Payments"],"operationId":"setup-auto-payment","summary":"Sets up auto-payment","description":"Kicks off the setup of auto-payment for a customer. This will return a URL that the customer must visit to complete the setup. If the customer already has a payment method, this will return a URL to update the payment method.","parameters":[{"name":"customer_id","in":"path","description":"UUID of the customer to be used in this operation.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupUpAutoPaymentRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentSetupResponse"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Customer Payments"],"operationId":"get-payment-method","summary":"Gets payment method","description":"Returns the payment method configured for auto-payment for the given customer.","parameters":[{"name":"customer_id","in":"path","description":"UUID of the customer to be used in this operation.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPaymentMethod"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/contracts":{"post":{"tags":["Contracts"],"operationId":"create-a-contract","summary":"Creates a contract","description":"Rillet supports two contract scope types: FULL and REVENUE_RECOGNITION_ONLY. The selected scope determines how the invoices are created and what information the user needs to provide.\n\nThe FULL scope is used when contract invoices are generated and sent directly from Rillet. In this case, Rillet automatically assigns the invoice numbers.\n\nThe REVENUE_RECOGNITION_ONLY scope is intended for situations where contracts and invoices are issued from another system and only need to be recorded in Rillet for accounting purposes. In this workflow, users must provide the invoice numbers manually. Other fields can be populated based on the data imported from the external system.\n\nFor example, if your organization issues invoices through an external billing platform but tracks financials in Rillet, you should select REVENUE_RECOGNITION_ONLY. If Rillet handles the entire invoicing and sending process, choose the FULL scope.\n","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContractRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpandedContract"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]},"get":{"tags":["Contracts"],"operationId":"list-all-contracts","summary":"Lists all contracts","description":"Returns contracts with pagination and rich filters (subsidiary, customer, status, date ranges).\nUse this to discover contract ids, check lifecycle state, or drive reporting extracts.\n","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/subsidiary_id"},{"name":"status","in":"query","description":"Optional status filter (allowed values depend on the resource).","required":false,"schema":{"$ref":"#/components/schemas/ContractStatus"}},{"name":"start_date.gt","in":"query","description":"Minimum start date value to filter by (exclusive)","schema":{"type":"string","format":"date"},"required":false},{"name":"start_date.gte","in":"query","description":"Minimum start date value to filter by (inclusive)","schema":{"type":"string","format":"date"},"required":false},{"name":"start_date.lt","in":"query","description":"Maximum start date value to filter by (exclusive)","schema":{"type":"string","format":"date"},"required":false},{"name":"start_date.lte","in":"query","description":"Maximum start date value to filter by (inclusive)","schema":{"type":"string","format":"date"},"required":false},{"name":"end_date.gt","in":"query","description":"Minimum end date value to filter by (exclusive)","schema":{"type":"string","format":"date"},"required":false},{"name":"end_date.gte","in":"query","description":"Minimum end date value to filter by (inclusive)","schema":{"type":"string","format":"date"},"required":false},{"name":"end_date.lt","in":"query","description":"Maximum end date value to filter by (exclusive)","schema":{"type":"string","format":"date"},"required":false},{"name":"end_date.lte","in":"query","description":"Maximum end date value to filter by (inclusive)","schema":{"type":"string","format":"date"},"required":false},{"name":"customer_id","in":"query","description":"Optional UUID filter by customer.","schema":{"type":"string","format":"uuid"},"required":false}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["contracts"],"type":"object","properties":{"contracts":{"type":"array","items":{"$ref":"#/components/schemas/Contract"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/contracts/{contract_id}":{"get":{"tags":["Contracts"],"operationId":"retrieve-a-contract","summary":"Retrieves a contract","description":"Returns the expanded contract including items, schedules, and metadata required before updates or amendments.\nAlways retrieve before issuing a full PUT update so you preserve fields you do not intend to clear.\n","parameters":[{"name":"contract_id","in":"path","required":true,"description":"UUID of the contract to retrieve.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpandedContract"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Contracts"],"operationId":"delete-a-contract","summary":"Deletes a contract","description":"Permanently removes a contract when your business rules allow deletion.\nConfirm downstream invoices, revenue schedules, and integrations no longer depend on this contract before deleting it.\n","parameters":[{"name":"contract_id","in":"path","required":true,"description":"UUID of the contract to delete.","schema":{"type":"string"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/contracts/{contract_id}/amendments":{"post":{"tags":["Contracts"],"operationId":"amend-a-contract","summary":"Amends a contract","description":"Applies a contract amendment when you need to add items, retire items, or change pricing/invoicing after go-live.\nUnlike a full PUT update, amendments model business-time changes and preserve historical billing context.\n\nUse preview-contract-amendment to dry-run the financial impact before committing.\n","parameters":[{"name":"contract_id","in":"path","required":true,"description":"UUID of the contract to amend.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AmendContractRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpandedContract"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/contracts/{contract_id}/amendments/preview":{"post":{"tags":["Contracts"],"operationId":"preview-contract-amendment","summary":"Previews contract amendment","description":"Preview a contract that has been amended. This has no effect on the actual contract, only provides a preview of what a contract will look like after it is amended.","parameters":[{"name":"contract_id","in":"path","required":true,"description":"UUID of the contract whose amendment you are previewing.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewContractAmendmentRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpandedContract"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/contracts/{contract_id}/end":{"put":{"tags":["Contracts"],"operationId":"end-an-open-ended-contract","summary":"Ends an open-ended contract","description":"Sets an explicit end date on a contract that previously had no close date (open-ended).\nProvide the final end_date in the request body; downstream invoicing and revenue recognition honor the new boundary.\n","parameters":[{"name":"contract_id","in":"path","required":true,"description":"UUID of the open-ended contract to close.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndOpenEndedContractRequest"}}},"required":true},"responses":{"204":{"description":"NO CONTENT"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/draft-contracts/{draft_contract_id}":{"parameters":[{"name":"draft_contract_id","in":"path","description":"UUID of the draft contract to be used in this operation.","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"tags":["Draft Contracts"],"operationId":"retrieve-a-draft-contract","summary":"Retrieves a draft contract","description":"Returns a draft contract by id, including its line items and any attached external references.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftContract"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]},"put":{"tags":["Draft Contracts"],"operationId":"update-a-draft-contract","summary":"Updates a draft contract","description":"Replaces the draft contract identified by `draft_contract_id` with the supplied payload. The body shape\nmatches `POST /draft-contracts` — items and external_references on the existing record are fully replaced.\nReturns 404 if the id is not a draft contract in the organization.\n","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDraftContractRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftContract"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]},"delete":{"tags":["Draft Contracts"],"operationId":"delete-a-draft-contract","summary":"Deletes a draft contract","description":"Permanently removes a draft contract along with its line items and external references. Use this to programmatically reject a draft contract instead of doing it from the Rillet UI.","responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/draft-contracts":{"get":{"tags":["Draft Contracts"],"operationId":"list-all-draft-contracts","summary":"Lists all draft contracts","description":"Returns draft contracts with cursor pagination. Draft contracts are staged records that appear in the Rillet UI under\n\"Draft\" for a human to approve or reject before they become active contracts.\n","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/subsidiary_id"},{"name":"customer_id","in":"query","description":"Optional UUID filter by customer.","schema":{"type":"string","format":"uuid"},"required":false}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["draft_contracts"],"type":"object","properties":{"draft_contracts":{"type":"array","items":{"$ref":"#/components/schemas/DraftContract"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Draft Contracts"],"operationId":"create-a-draft-contract","summary":"Creates a draft contract","description":"Stages a contract in the \"draft\" holding state instead of creating it directly as an active contract.\nDraft contracts appear in the Rillet UI under \"Draft\" for a human to approve or reject.\n\n## Deduplication\n\n**To prevent duplicate draft contracts on retry, supply at least one `external_references` entry with a\nstable `(type, id)` pair.** When you POST again with any matching `(type, id)` pair, the prior draft record\nis replaced with the new payload.\n\nDraft contracts created without any `external_references` are not deduplicated — every POST creates a new\nrecord.\n\n## External reference types\n\nEach reference's `type` must match a slug already defined under Rillet Settings → External References for\nthe organization; unknown slugs return a 400. References attached at create time are preserved when the\ndraft contract is promoted to an active contract.\n\n## Promotion\n\nPromotion to an active contract happens through the Rillet UI. The public API does not currently expose a\nprogrammatic promotion endpoint.\n","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDraftContractRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftContract"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/contract-items/{contract_item_id}/usage":{"patch":{"tags":["Contract Items"],"operationId":"upsert-a-usage-record","summary":"Upserts a usage record","parameters":[{"name":"contract_item_id","in":"path","required":true,"description":"UUID of the contract line item that carries the usage-priced product.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageRecords"}}},"required":true},"description":"Creates usage records on dates where previously no usage was recorded. Overwrites usage records on dates where usage was previously recorded already.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageRecords"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Contract Items"],"operationId":"list-all-contract-item-usage-records","summary":"Lists all contract item usage records","description":"Returns historical usage quantities for a contract item, newest first, with optional pagination cursors.\nUse before upsert-a-usage-record or delete-a-usage-record to understand existing coverage for each date.\n","parameters":[{"name":"contract_item_id","in":"path","required":true,"description":"UUID of the contract line item whose usage rows are being listed.","schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UsageRecords"},{"type":"object","properties":{"pagination":{"$ref":"#/components/schemas/Pagination"}}}]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Contract Items"],"operationId":"delete-a-usage-record","summary":"Deletes a usage record","description":"Removes the usage entry for a single contract item on a specific calendar date.\nThis is narrower than upsert-a-usage-record and is ideal when you need to wipe a mistaken day without resending the entire usage payload.\n","parameters":[{"name":"contract_item_id","in":"path","required":true,"description":"UUID of the contract line item whose usage row should be removed.","schema":{"type":"string"}},{"name":"date","in":"query","description":"Calendar date of the usage row to delete (ISO-8601 format).","schema":{"type":"string","format":"date"},"required":true}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/invoices":{"get":{"tags":["Invoices"],"operationId":"list-all-invoices","summary":"Lists all invoices","description":"Returns AR invoices with pagination plus filters for subsidiary, customer, overdue state, and audit timestamps.\nUse invoice ids from this feed with retrieve-an-invoice before performing full updates.\n","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/subsidiary_id"},{"name":"overdue","in":"query","required":false,"schema":{"type":"boolean"},"description":"Filter for overdue invoices."},{"name":"customer_id","in":"query","description":"Optional UUID filter by customer.","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"updated.gt","in":"query","required":false,"description":"Filter invoices updated after this timestamp","schema":{"type":"string","format":"date-time","example":"2023-01-01T00:00:00Z"}},{"name":"status","in":"query","required":false,"description":"Filter invoices by payment status.","schema":{"$ref":"#/components/schemas/InvoiceStatus"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["invoices"],"type":"object","properties":{"invoices":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Invoices"],"operationId":"create-an-invoice","summary":"Creates an invoice","description":"Rillet supports two invoice scope types: FULL and REVENUE_RECOGNITION_ONLY. The selected scope determines how the invoice is created and what information the user needs to provide.\n\nThe FULL scope is used when the invoice is generated and sent directly from Rillet. In this case, Rillet automatically assigns the invoice number.\n\nThe REVENUE_RECOGNITION_ONLY scope is intended for situations where the invoice is issued from another system and only needs to be recorded in Rillet for accounting purposes. In this workflow, users must provide the invoice number manually. Other fields can be populated based on the data imported from the external system.\n\nFor example, if your organization issues invoices through an external billing platform but tracks financials in Rillet, you should select REVENUE_RECOGNITION_ONLY. If Rillet handles the entire invoicing and sending process, choose the FULL scope.\n","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvoiceRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/invoices/{invoice_id}":{"get":{"tags":["Invoices"],"operationId":"retrieve-an-invoice","summary":"Retrieves an invoice","description":"Returns invoice details including line items, tax breakdown, and linkage to contracts or customers.\nUse Accept application/json for structured data; application/pdf is only for human-readable exports when enabled.\n","parameters":[{"name":"invoice_id","in":"path","required":true,"description":"UUID of the invoice to retrieve.","schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"description":"Response format preference; default is application/json.","schema":{"enum":["application/pdf","application/json"],"default":"application/json"}}],"responses":{"200":{"description":"OK","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Invoices"],"operationId":"delete-an-invoice","summary":"Deletes an invoice","description":"Permanently removes an invoice when your policy allows it (for example draft or voided states).\nConfirm no downstream payments or revenue postings still depend on this invoice.\n","parameters":[{"name":"invoice_id","in":"path","required":true,"description":"UUID of the invoice to delete.","schema":{"type":"string"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Invoices"],"operationId":"update-an-invoice","summary":"Updates an invoice","description":"IMPORTANT: This is a full-replace operation (PUT semantics). All fields must be\nincluded in the request body — omitting any field will set it to null, wiping\nexisting data. Always call retrieve-an-invoice first to fetch the current record,\nthen include ALL existing fields in your update request along with your changes.\n","parameters":[{"name":"invoice_id","in":"path","description":"UUID of the invoice to be used in this operation.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInvoiceRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/invoices/{invoice_id}/taxes":{"post":{"tags":["Invoices"],"operationId":"update-taxes-for-an-invoice","summary":"Updates invoice taxes","description":"Recalculates or replaces tax lines on an existing invoice using the supplied tax payload.\nUse after changing taxable addresses or when integrating an external tax engine result.\n","parameters":[{"name":"invoice_id","in":"path","required":true,"description":"UUID of the invoice whose taxes should be recomputed.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTaxesRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/invoice-payments":{"get":{"tags":["Invoice payments"],"operationId":"list-all-invoices-payments","summary":"Lists all invoice payments","description":"Pages every customer payment recorded against invoices across the organization, independent of which invoice it settled.\nUse updated.gt and sort_by when syncing integrations; follow the pagination cursor until no next page remains.\n","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"name":"updated.gt","in":"query","required":false,"description":"Filter payments updated after this timestamp","schema":{"type":"string","format":"date-time","example":"2023-01-01T00:00:00Z"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","enum":["created","updated"],"default":"created"},"description":"the field the payments should be sorted by descending (either created or updated)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["payments","pagination"],"type":"object","properties":{"payments":{"type":"array","items":{"$ref":"#/components/schemas/InvoicePayment"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/invoices/{invoice_id}/payments":{"get":{"tags":["Invoice payments"],"operationId":"list-all-invoice-payments","summary":"Lists payments for a given invoice","description":"Returns every payment attempt tied to a single invoice, including successful, uncleared, and failed rows with their public status.\nPair with retrieve-an-invoice when reconciling an account statement against what Rillet already applied.\n","parameters":[{"name":"invoice_id","in":"path","description":"UUID of the invoice to be used in this operation.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["payments"],"type":"object","properties":{"payments":{"type":"array","items":{"$ref":"#/components/schemas/InvoicePayment"}}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Invoice payments"],"operationId":"create-an-invoice-payment","summary":"Creates an invoice payment","description":"Records a manual cash receipt against an open invoice by amount, effective date, and a GL account code that maps to a funded cash account.\nRillet resolves the account code to a cash account before posting, so verify chart-of-accounts mapping when automations fail validation.\n","parameters":[{"name":"invoice_id","in":"path","description":"UUID of the invoice to be used in this operation.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicePaymentRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicePayment"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/invoices/{invoice_id}/payments/{payment_id}":{"delete":{"tags":["Invoice payments"],"operationId":"delete-an-invoice-payment","summary":"Deletes an invoice payment","description":"Reverses a previously recorded uncleared invoice payment, restoring the invoice balance accordingly.\nOnly uncleared payments can be deleted; cleared or reconciled payments are rejected.\nTreat this as a corrective action with the same controls you apply to voiding treasury transactions in your close process.\n","parameters":[{"name":"invoice_id","in":"path","description":"UUID of the invoice to be used in this operation.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"payment_id","in":"path","description":"UUID of the payment to be used in this operation.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Invoice payments"],"operationId":"update-an-invoice-payment","summary":"Updates an invoice payment","description":"Replaces the amount, date, and cash account on an existing uncleared invoice payment.\nOnly uncleared payments can be updated; cleared or reconciled payments are rejected.\nThis is a full-replace operation (PUT semantics) — include all fields in the request body.\n","parameters":[{"name":"invoice_id","in":"path","description":"UUID of the invoice to be used in this operation.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"payment_id","in":"path","description":"UUID of the payment to be used in this operation.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicePaymentRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicePayment"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/invoices/{invoice_id}/sent-status":{"put":{"tags":["Invoices"],"operationId":"update-invoice-sent-status","summary":"Updates invoice sent status","description":"Marks whether an invoice has been delivered to the customer, which downstream workflows use for collections cadence and compliance reporting.\nSet the sent flag true after your billing system or email provider confirms delivery, or false while the document is still internal-only.\n","parameters":[{"name":"invoice_id","in":"path","description":"UUID of the invoice to be used in this operation.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInvoiceSentStatusRequest"}}},"required":true},"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/credit-memos":{"get":{"tags":["Credit Memos"],"operationId":"list-all-credit-memos","summary":"Lists all credit memos","description":"Returns customer credit memos with pagination and filters for application state, customer, and subsidiaries.\nUse credit memo ids with retrieve-a-credit-memo before updates or when applying credits to invoices.\n","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/subsidiary_id"},{"name":"updated.gt","in":"query","required":false,"description":"Filter credit memos updated after this timestamp","schema":{"type":"string","format":"date-time","example":"2023-01-01T00:00:00Z"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["credit_memos"],"type":"object","properties":{"credit_memos":{"type":"array","items":{"$ref":"#/components/schemas/CreditMemo"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Credit Memos"],"operationId":"create-a-credit-memo","summary":"Creates a credit memo","description":"Opens a customer credit memo that reduces receivable exposure before you allocate it to specific invoices.\nCapture subsidiary, customer, line-level reasons, and tax treatment so finance can audit why the balance changed.\n","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCreditMemoRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditMemo"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/credit-memos/{credit_memo_id}":{"get":{"tags":["Credit Memos"],"operationId":"retrieve-a-credit-memo","summary":"Retrieves a credit memo","description":"Loads the full credit memo payload, including remaining balance, applications, and tax metadata you must echo on PUT updates.\nAlways retrieve before editing because update-a-credit-memo replaces the entire resource when fields are omitted.\n","parameters":[{"name":"credit_memo_id","in":"path","description":"UUID of the credit memo to be used in this operation.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditMemo"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Credit Memos"],"operationId":"delete-a-credit-memo","summary":"Deletes a credit memo","description":"Removes a credit memo that should no longer affect AR balances, typically while it is still draft or unused.\nConfirm no invoice applications or downstream revenue adjustments depend on this memo before calling delete.\n","parameters":[{"name":"credit_memo_id","in":"path","description":"UUID of the credit memo to be used in this operation.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Credit Memos"],"operationId":"update-a-credit-memo","summary":"Updates a credit memo","description":"IMPORTANT: This is a full-replace operation (PUT semantics). All fields must be\nincluded in the request body — omitting any field will set it to null, wiping\nexisting data. Always call retrieve-a-credit-memo first to fetch the current record,\nthen include ALL existing fields in your update request along with your changes.\n","parameters":[{"name":"credit_memo_id","in":"path","description":"UUID of the credit memo to be used in this operation.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCreditMemoRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditMemo"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/credit-memos/{credit_memo_id}/taxes":{"post":{"tags":["Credit Memos"],"operationId":"update-taxes-for-a-credit-memo","summary":"Updates credit memo taxes","description":"Refreshes tax quotes on an existing credit memo using the same structured payload as invoice tax updates, stamped with taxesCalculatedAt for auditability.\nUse after line items change or when your tax engine recomputes jurisdiction-specific amounts before issuing the credit to the customer.\n","parameters":[{"name":"credit_memo_id","in":"path","description":"UUID of the credit memo to be used in this operation.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTaxesRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditMemo"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/credit-memos/{credit_memo_id}/applications":{"delete":{"tags":["Credit Memos"],"operationId":"delete-credit-memo-applications","x-skip-mcp":true,"summary":"Unapplies all credit memo applications","description":"Removes every application from this credit memo, reverting all invoice allocations.\n","parameters":[{"name":"credit_memo_id","in":"path","description":"UUID of the credit memo to be used in this operation.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Credit Memos"],"operationId":"apply-credit-memo","x-skip-mcp":true,"summary":"Reconciles credit memo applications","description":"Full reconcile of credit memo applications. The request body represents the desired set: missing applications are removed, new applications inserted, and existing applications updated when amount or application_date differ.\n","parameters":[{"name":"credit_memo_id","in":"path","description":"UUID of the credit memo to be used in this operation.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyCreditMemoRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditMemo"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/vendors":{"get":{"tags":["Vendors"],"operationId":"list-all-vendors","summary":"Lists all vendors","description":"Returns vendors with pagination and optional status or currency filters.\nVendor ids feed bill creation, vendor credits, and payment workflows.\n","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"name":"updated.gt","in":"query","required":false,"description":"Filter vendors updated after this timestamp","schema":{"type":"string","format":"date-time","example":"2023-01-01T00:00:00Z"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["vendors","pagination"],"type":"object","properties":{"vendors":{"type":"array","items":{"$ref":"#/components/schemas/VendorResponse"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Vendors"],"operationId":"create-a-vendor","summary":"Creates a vendor","description":"Adds a vendor master record the accounts-payable team can select on bills, vendor credits, and payments.\nCapture legal name, remit-to address, default currency, and payment terms so downstream bills inherit correct due dates and banking instructions.\n","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorResponse"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/vendors/{vendor_id}":{"get":{"tags":["Vendors"],"operationId":"retrieve-a-vendor","summary":"Retrieves a vendor","description":"Fetches the full vendor profile including identifiers you must echo back on PUT updates.\nUse before editing to avoid wiping optional fields, and when validating tax or payment metadata during bill entry.\n","parameters":[{"name":"vendor_id","in":"path","description":"UUID of the vendor to be used in this operation.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorResponse"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Vendors"],"operationId":"update-a-vendor","summary":"Updates a vendor","description":"IMPORTANT: This is a full-replace operation (PUT semantics). All fields must be\nincluded in the request body — omitting any field will set it to null, wiping\nexisting data. Always call retrieve-a-vendor first to fetch the current record,\nthen include ALL existing fields in your update request along with your changes.\n","parameters":[{"name":"vendor_id","in":"path","description":"UUID of the vendor to be used in this operation.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorResponse"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Vendors"],"operationId":"delete-a-vendor","summary":"Deletes a vendor","description":"Removes a vendor you no longer expect to pay. Confirm no open bills, credits, or scheduled payments still reference this vendor to avoid orphaned payables.\n","parameters":[{"name":"vendor_id","in":"path","description":"UUID of the vendor to be used in this operation.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/vendor-credits":{"get":{"tags":["Vendor Credits"],"operationId":"list-all-vendor-credits","summary":"Lists all vendor credits","description":"Returns vendor credits with pagination and filters for vendor, subsidiary, and freshness.\nCredits represent vendor-issued balance reductions you can later apply to bills using apply-vendor-credit.\n","parameters":[{"name":"vendor_id","in":"query","description":"Optional UUID filter by vendor.","required":false,"schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/subsidiary_id"},{"name":"updated.gt","in":"query","required":false,"description":"Filter vendor credits updated after this timestamp","schema":{"type":"string","format":"date-time","example":"2023-01-01T00:00:00Z"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["vendor_credits","pagination"],"properties":{"vendor_credits":{"type":"array","items":{"$ref":"#/components/schemas/VendorCredit"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Vendor Credits"],"operationId":"create-a-vendor-credit","summary":"Creates a vendor credit","description":"Records a new vendor credit memo amount that reduces future payables without yet touching specific bills.\nAfter creation, use apply-vendor-credit to allocate the balance across one or more open bills.\n","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVendorCreditRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorCredit"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/vendor-credits/{vendor_credit_id}":{"get":{"tags":["Vendor Credits"],"operationId":"retrieve-a-vendor-credit","summary":"Retrieves a vendor credit","description":"Loads a single vendor credit including remaining balance and application history.\nRetrieve before updating or applying so you know how much capacity is left to allocate to bills.\n","parameters":[{"name":"vendor_credit_id","in":"path","description":"UUID of the vendor credit to be used in this operation.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorCredit"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Vendor Credits"],"operationId":"update-a-vendor-credit","summary":"Updates a vendor credit","description":"IMPORTANT: This is a full-replace operation (PUT semantics). All fields must be\nincluded in the request body — omitting any field will set it to null, wiping\nexisting data. Always call retrieve-a-vendor-credit first to fetch the current record,\nthen include ALL existing fields in your update request along with your changes.\n","parameters":[{"name":"vendor_credit_id","in":"path","description":"UUID of the vendor credit to be used in this operation.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateVendorCreditRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorCredit"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Vendor Credits"],"operationId":"delete-a-vendor-credit","summary":"Deletes a vendor credit","description":"Permanently removes a vendor credit that should not remain in the subledger.\nEnsure no applications or downstream reconciliations still rely on this credit before deleting.\n","parameters":[{"name":"vendor_credit_id","in":"path","description":"UUID of the vendor credit to be used in this operation.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/vendor-credits/{vendor_credit_id}/applications":{"post":{"tags":["Vendor Credit Applications"],"operationId":"apply-vendor-credit","summary":"Applies a vendor credit to bills","description":"Allocates an existing vendor credit balance against specific open bills, reducing net amounts payable similar to a targeted vendor payment.\nUse after reviewing retrieve-a-vendor-credit so you apply only the remaining unapplied balance.\n","parameters":[{"name":"vendor_credit_id","in":"path","description":"UUID of the vendor credit to be used in this operation.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyVendorCreditRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorCredit"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/bills":{"get":{"tags":["Bills"],"operationId":"list-all-bills","summary":"Lists all bills","description":"Returns AP bills with pagination plus filters for vendor, subsidiary, approval state, and balances due.\nUse bill ids with retrieve-a-bill before performing full updates or attaching documents.\n","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/subsidiary_id"},{"name":"updated.gt","in":"query","required":false,"description":"Filter bills updated after this timestamp","schema":{"type":"string","format":"date-time","example":"2023-01-01T00:00:00Z"}},{"name":"vendor_id","in":"query","required":false,"description":"Filter bills by vendor.","schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","required":false,"description":"Filter bills by payment status.","schema":{"$ref":"#/components/schemas/BillStatus"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["bills","pagination"],"properties":{"bills":{"type":"array","items":{"$ref":"#/components/schemas/Bill"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Bills"],"operationId":"create-a-bill","summary":"Creates a bill","description":"Accrues a new accounts-payable bill against a vendor with subsidiary context, line items, and due dates your approval workflow consumes.\nAttach supporting metadata now so matching payments, amortization schedules, and document uploads stay aligned with the payable.\n","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBillRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bill"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/bills/{bill_id}":{"get":{"tags":["Bills"],"operationId":"retrieve-a-bill","summary":"Retrieves a bill","description":"Returns the authoritative bill record including vendor linkage, approval state, open balance, and document references.\nFetch before update-a-bill because PUT semantics require you to resubmit every field to avoid nulling omitted values.\n","parameters":[{"name":"bill_id","in":"path","description":"UUID of the bill to be used in this operation.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bill"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Bills"],"operationId":"update-a-bill","summary":"Updates a bill","description":"IMPORTANT: This is a full-replace operation (PUT semantics). All fields must be\nincluded in the request body — omitting any field will set it to null, wiping\nexisting data. Always call retrieve-a-bill first to fetch the current record,\nthen include ALL existing fields in your update request along with your changes.\n","parameters":[{"name":"bill_id","in":"path","description":"UUID of the bill to be used in this operation.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBillRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bill"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Bills"],"operationId":"upload-document","summary":"Uploads a document","description":"Attaches a document (PDF, JPEG, or PNG) such as an invoice, contract, or receipt to an existing bill using multipart form data with a single file part.\nCall after the bill exists so approvers and auditors can open the evidence directly from the payable record.\n","parameters":[{"name":"bill_id","in":"path","description":"UUID of the bill to be used in this operation.","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}},"encoding":{"file":{"contentType":"application/pdf, image/jpeg, image/png"}}}}},"responses":{"204":{"description":"No content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Bills"],"operationId":"delete-a-bill","summary":"Deletes a bill","description":"Removes a bill that should no longer drive AP balances, typically while it remains in draft or was created in error.\nVerify no posted payments, accrual journals, or vendor credit applications still reference the bill before deleting.\n","parameters":[{"name":"bill_id","in":"path","description":"UUID of the bill to be used in this operation.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/bills/{bill_id}/payments":{"get":{"tags":["Bill Payments"],"operationId":"list-bill-payments","summary":"Lists bill payments","description":"Enumerates disbursements recorded against a specific bill, useful when reconciling vendor statements to internal cash movements.\nCombine with retrieve-a-bill to understand remaining balance after each payment posts.\n","parameters":[{"name":"bill_id","in":"path","description":"UUID of the bill to be used in this operation.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["payments"],"type":"object","properties":{"payments":{"type":"array","items":{"$ref":"#/components/schemas/BillPayment"}}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Bill Payments"],"operationId":"create-a-bill-payment","summary":"Creates a bill payment","description":"Books a cash or scheduled disbursement that settles all or part of a bill, updating the outstanding payable and linking treasury activity.\nProvide funding source details consistent with your configured payment rails so downstream bank reconciliation stays accurate.\n\nIMPORTANT: Notice this operation has a redundancy between the `bill_id` path parameter and the `billId` attribute in the request body, which takes precedence and is used in internal logic. When executing this operation, both IDs must match, otherwise the request will be rejected. This is a legacy redundancy and will be removed in future versions of this operation.\n","parameters":[{"name":"bill_id","in":"path","description":"UUID of the bill to be used in this operation. Must match the `billId` provided in the request body.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillPaymentRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillPayment"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/bills/{bill_id}/payments/{payment_id}":{"delete":{"tags":["Bill Payments"],"operationId":"delete-a-bill-payment","summary":"Deletes a bill payment","description":"Reverses a previously recorded bill payment when the disbursement failed or was duplicated, restoring the bill balance accordingly.\nTreat this as a corrective action with the same controls you apply to voiding treasury transactions in your close process.\n","parameters":[{"name":"bill_id","in":"path","description":"UUID of the bill to be used in this operation.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"payment_id","in":"path","description":"UUID of the payment to be used in this operation.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/charges":{"get":{"tags":["Charges"],"operationId":"list-all-charges","summary":"Lists all charges","description":"Pages card or out-of-pocket employee charges awaiting policy review, subsidiary allocation, or conversion into reimbursable payables.\nFilter by subsidiary_id or updated.gt when syncing corporate card feeds into downstream expense automation.\n","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/subsidiary_id"},{"name":"updated.gt","in":"query","required":false,"description":"Filter charges updated after this timestamp","schema":{"type":"string","format":"date-time","example":"2023-01-01T00:00:00Z"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["charges","pagination"],"properties":{"charges":{"type":"array","items":{"$ref":"#/components/schemas/Charge"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Charges"],"operationId":"create-a-charge","summary":"Create a charge","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChargeRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Charge"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/charges/{charge_id}":{"get":{"tags":["Charges"],"operationId":"retrieve-a-charge","summary":"Retrieves a charge","description":"Fetches a single charge with merchant metadata, amounts, and workflow state so reviewers can decide coding before reimbursement.\nUse this after list-all-charges surfaces an id that needs manual inspection or attachment to a bill.\n","parameters":[{"name":"charge_id","in":"path","description":"UUID of the charge to be used in this operation.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Charge"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Charges"],"operationId":"delete-a-charge","summary":"Deletes a charge","description":"Drops a charge that should not influence spend reporting, for example duplicate imports from a card processor feed.\nEnsure finance agrees the underlying bank activity will not be re-imported before removing the charge permanently.\n","parameters":[{"name":"charge_id","in":"path","description":"UUID of the charge to be used in this operation.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Charges"],"operationId":"upload-charge-document","summary":"Uploads a document to a charge","description":"Attaches a receipt (PDF, JPEG, or PNG) to an existing charge using multipart form data with a single file part.\n","parameters":[{"name":"charge_id","in":"path","description":"UUID of the charge to be used in this operation.","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}},"encoding":{"file":{"contentType":"application/pdf, image/jpeg, image/png"}}}}},"responses":{"204":{"description":"No content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/reimbursements":{"post":{"tags":["Reimbursements"],"operationId":"create-a-reimbursement","summary":"Create a reimbursement","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReimbursementRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reimbursement"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]},"get":{"tags":["Reimbursements"],"operationId":"list-all-reimbursements","summary":"Lists all reimbursements","description":"Surfaces reimbursement requests created from approved charges or manual submissions, including subsidiary and freshness filters for payroll sync.\nUse pagination cursors for large populations and pair with retrieve-a-reimbursement when a row needs detailed audit context.\n","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/subsidiary_id"},{"name":"updated.gt","in":"query","required":false,"description":"Filter reimbursements updated after this timestamp","schema":{"type":"string","format":"date-time","example":"2023-01-01T00:00:00Z"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["reimbursements","pagination"],"properties":{"reimbursements":{"type":"array","items":{"$ref":"#/components/schemas/Reimbursement"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/reimbursements/{reimbursement_id}":{"get":{"tags":["Reimbursements"],"operationId":"retrieve-a-reimbursement","summary":"Retrieves a reimbursement","description":"Returns the full reimbursement packet with employee linkage, funding instructions, and approval history for a single id.\nHelpful when validating totals before releasing ACH batches or answering employee support tickets.\n","parameters":[{"name":"reimbursement_id","in":"path","description":"UUID of the reimbursement to be used in this operation.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reimbursement"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Reimbursements"],"operationId":"delete-a-reimbursement","summary":"Deletes a reimbursement","description":"Removes a reimbursement that was created prematurely or duplicated during intake so it no longer blocks payroll totals.\nConfirm no outbound payments or GL accruals were posted against the reimbursement before deleting it.\n","parameters":[{"name":"reimbursement_id","in":"path","description":"UUID of the reimbursement to be used in this operation.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Reimbursements"],"operationId":"upload-reimbursement-document","summary":"Uploads a document to a reimbursement","description":"Attaches a receipt (PDF, JPEG, or PNG) to an existing reimbursement using multipart form data with a single file part.\n","parameters":[{"name":"reimbursement_id","in":"path","description":"UUID of the reimbursement to be used in this operation.","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}},"encoding":{"file":{"contentType":"application/pdf, image/jpeg, image/png"}}}}},"responses":{"204":{"description":"No content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/journal-entries":{"post":{"tags":["Journal Entries"],"operationId":"create-a-journal-entry","summary":"Creates a journal entry","description":"Posts a balanced manual journal entry with explicit debit and credit lines, posting date, and subsidiary scope for GL corrections.\nPrefer dedicated AR or AP APIs when the business event already exists; reserve this for adjustments your automation cannot model yet.\n","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJournalEntryRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalEntry"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]},"get":{"tags":["Journal Entries"],"operationId":"list-all-journal-entries","summary":"Lists all journal entries","description":"Returns GL journal entries with rich filtering (subsidiary, account, date range, reconciliation state).\nUse entry ids with retrieve-a-journal-entry before attempting updates or deletes.\n","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/subsidiary_id"},{"name":"book_id","in":"query","required":false,"description":"Book ID to filter journal entries by. Primary books return primary entries only; adjustment-overlay books return primary and adjustment entries.","schema":{"type":"string","format":"uuid"}},{"name":"updated.gt","in":"query","required":false,"description":"Filter journal entries updated after this timestamp","schema":{"type":"string","format":"date-time","example":"2023-01-01T00:00:00Z"}},{"name":"date.gte","in":"query","required":false,"description":"Filter journal entries with a posting date on or after this date (inclusive)","schema":{"type":"string","format":"date","example":"2023-12-01"}},{"name":"date.lte","in":"query","required":false,"description":"Filter journal entries with a posting date on or before this date (inclusive)","schema":{"type":"string","format":"date","example":"2023-12-31"}},{"name":"account_ids","in":"query","required":false,"description":"Filter journal entries that have at least one line item posting to any of these account ids (comma-separated)","schema":{"type":"array","items":{"type":"string","format":"uuid"}},"style":"form","explode":false,"example":["11111111-1111-1111-1111-111111111111","22222222-2222-2222-2222-222222222222"]},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","enum":["created","updated"],"default":"created"},"description":"the field the journal entries should be sorted by descending (either created or updated)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["journal_entries"],"type":"object","properties":{"journal_entries":{"type":"array","items":{"$ref":"#/components/schemas/JournalEntry"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/journal-entries/{journal_entry_id}":{"get":{"tags":["Journal Entries"],"operationId":"retrieve-a-journal-entry","summary":"Retrieves a journal entry","description":"Retrieves a journal entry with every line, account reference, and reconciliation flag needed for close review or downstream edits.\nCall before update-a-journal-entry so you can merge new edits with existing lines without accidentally dropping balances.\n","parameters":[{"name":"journal_entry_id","in":"path","description":"UUID of the journal entry to be used in this operation.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalEntry"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Journal Entries"],"operationId":"update-a-journal-entry","summary":"Updates a journal entry","description":"Replaces the lines and header metadata on an existing manual journal entry, subject to the same balancing rules as creation.\nAlways include the complete line list retrieved beforehand because partial payloads can clear fields the API treats as optional.\n","parameters":[{"name":"journal_entry_id","in":"path","description":"UUID of the journal entry to be used in this operation.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateJournalEntryRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalEntry"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Journal Entries"],"operationId":"delete-a-journal-entry","summary":"Deletes a journal entry","description":"Deletes a manual journal entry that should be excluded from the ledger, typically prior to period lock while corrections remain allowed.\nVerify dependent reconciliations or downstream consolidations no longer rely on the entry before removal.\n","parameters":[{"name":"journal_entry_id","in":"path","description":"UUID of the journal entry to be used in this operation.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/bank-accounts":{"get":{"tags":["Bank accounts"],"operationId":"list-all-bank-accounts","summary":"Lists all bank accounts","description":"Returns cash bank accounts configured for the organization, optionally filtered by subsidiary.\nBank account ids anchor transaction import, reconciliation, and treasury automations.\n","parameters":[{"$ref":"#/components/parameters/subsidiary_id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["accounts"],"type":"object","properties":{"accounts":{"type":"array","items":{"$ref":"#/components/schemas/BankAccount"}}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Bank accounts"],"operationId":"create-a-bank-account","summary":"Creates a bank account","description":"Registers a treasury bank account with currency, institution identifiers, and linkage to the GL cash account used during transaction import.\nAccurate mapping here ensures invoice payments, bill payments, and bank feeds all post to the same cash subledger.\n","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBankAccountRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankAccount"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/bank-accounts/{bank_account_id}":{"get":{"tags":["Bank accounts"],"operationId":"retrieve-a-bank-account","summary":"Retrieves a bank account","description":"Returns configuration and status for a single bank account, including identifiers downstream connectors need when refreshing balances.\nUse before deleting or updating metadata so you preserve institution codes and default subsidiary routing.\n","parameters":[{"name":"bank_account_id","in":"path","description":"UUID of the bank account to be used in this operation.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankAccount"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Bank accounts"],"operationId":"delete-a-bank-account","summary":"Deletes a bank account","description":"Removes a bank account definition when the entity closed the account or you mistakenly created a duplicate connector mapping.\nEnsure no scheduled payments or open reconciliation batches still target this bank account before deletion.\n","parameters":[{"name":"bank_account_id","in":"path","description":"UUID of the bank account to be used in this operation.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/bank-transactions":{"get":{"tags":["Bank Transactions"],"operationId":"list-all-bank-transactions","summary":"Lists all bank transactions","description":"Streams imported or manually entered cash activity for reconciliation, optionally scoped by bank account, subsidiary, or updated-since filters.\nPair results with retrieve-a-bank-transaction when you need memo-level detail before marking items cleared.\n","parameters":[{"name":"bank_account_id","in":"query","required":false,"description":"Filter by bank account","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/subsidiary_id"},{"name":"updated.gt","in":"query","required":false,"description":"Filter bank transactions updated after this timestamp","schema":{"type":"string","format":"date-time","example":"2023-01-01T00:00:00Z"}},{"name":"date.gte","in":"query","required":false,"description":"Filter bank transactions with date on or after this date","schema":{"type":"string","format":"date","example":"2023-01-01"}},{"name":"date.lte","in":"query","required":false,"description":"Filter bank transactions with date on or before this date","schema":{"type":"string","format":"date","example":"2023-12-31"}},{"name":"sort_by","in":"query","description":"Field to sort results by (see enum values).","required":false,"schema":{"type":"string","enum":["created","updated"]}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["bank_transactions","pagination"],"type":"object","properties":{"bank_transactions":{"type":"array","items":{"$ref":"#/components/schemas/BankTransaction"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Bank Transactions"],"operationId":"create-a-bank-transaction","summary":"Creates a bank transaction","description":"Inserts a single bank feed line such as a wire, ACH, or adjustment when automated imports miss a statement row.\nSpecify the hosting bank account and value dates so cash reporting matches what treasury already booked externally.\n","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBankTransactionRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankTransaction"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/bank-transactions/{bank_transaction_id}":{"get":{"tags":["Bank Transactions"],"operationId":"retrieve-a-bank-transaction","summary":"Retrieves a bank transaction","description":"Fetches one bank transaction with counterparty text, amounts, and reconciliation flags used by cash teams during month-end.\nUse before update-a-bank-transaction to preserve memos or matched invoice references embedded in the payload.\n","parameters":[{"name":"bank_transaction_id","in":"path","description":"UUID of the bank transaction to be used in this operation.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankTransaction"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Bank Transactions"],"operationId":"update-a-bank-transaction","summary":"Updates a bank transaction","description":"Adjusts memo, categorization, or reconciliation metadata on an existing bank transaction without re-importing the entire feed batch.\nSupply the full body expected by the schema so optional fields you intend to keep are not unintentionally cleared.\n","parameters":[{"name":"bank_transaction_id","in":"path","description":"UUID of the bank transaction to be used in this operation.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBankTransactionRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankTransaction"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Bank Transactions"],"operationId":"delete-a-bank-transaction","summary":"Deletes a bank transaction","description":"Removes a bank transaction row that was imported twice or created in error before it affects reconciled cash balances.\nConfirm treasury agrees the underlying bank activity will not return on the next feed pull before deleting.\n","parameters":[{"name":"bank_transaction_id","in":"path","description":"UUID of the bank transaction to be used in this operation.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tax-rates":{"get":{"tags":["Tax rates"],"operationId":"list-all-tax-rates","summary":"Lists all tax rates","description":"Returns all available tax rates. Use the returned IDs when creating bills with specific tax codes.","parameters":[{"name":"country","in":"query","required":false,"description":"Two-letter country code (ISO 3166-1 alpha-2). If provided, only tax rates for that country are returned.","schema":{"$ref":"#/components/schemas/CountryCode"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["tax_rates"],"type":"object","properties":{"tax_rates":{"type":"array","items":{"$ref":"#/components/schemas/TaxRateResource"}}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/reports/arr-waterfall":{"get":{"tags":["Reports"],"operationId":"retrieve-waterfall-report","summary":"Retrieves ARR waterfall report","description":"Returns the ARR waterfall dataset for the requested month with optional breakdown dimensions, subsidiary filters, and pagination cursors for large tenants.\nFinance teams use this to explain beginning ARR, new business, expansion, contraction, and churn between periods.\n","parameters":[{"$ref":"#/components/parameters/month"},{"$ref":"#/components/parameters/status"},{"$ref":"#/components/parameters/breakdown"},{"$ref":"#/components/parameters/subsidiary_id"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevenueWaterfall"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/books":{"get":{"tags":["Books"],"operationId":"list-all-books","summary":"Lists all books","description":"Returns all accounting books available to the authenticated organization.\nSuccessful responses always contain at least one book and list the primary book first.\nOnly primary and adjustment-overlay book IDs can be used with report and journal-entry endpoints that accept a book_id.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["books"],"type":"object","properties":{"books":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/LedgerBook"}}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/books/periods/last-closed":{"get":{"tags":["Books periods"],"operationId":"retrieve-last-book-closed-period","summary":"Retrieves last book closed period","description":"Returns the most recently closed accounting period for book-close workflows, including closed-on timestamps your automation can cache.\nWhen no period has ever been closed the API responds with HTTP 404, so treat a missing resource as \"not yet closed\" rather than an outage.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Book"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/health":{"get":{"tags":["Health"],"operationId":"health","summary":"Returns service health","description":"Lightweight liveness probe that returns HTTP 200 when the service process is running, without exercising downstream databases or queues.\nUse for load balancer health checks where you only need to know the JVM responded.\n","responses":{"200":{"description":"OK"}},"parameters":[]}},"/api-key":{"get":{"tags":["API Key"],"operationId":"get-api-key-information","summary":"Gets API key information","description":"Confirms the caller’s API key is recognized and returns basic identity metadata such as organization context when authentication succeeds.\nIntegrations should call this during bootstrap or rotation to distinguish invalid keys from broader connectivity failures.\n","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized"}},"parameters":[]}},"/fields":{"get":{"tags":["Fields"],"operationId":"get-fields","summary":"Gets custom fields","description":"Retrieves custom field definitions and their pick-list values for the organization.\nUse the returned field ids with create-field-value and update-field-value when enriching core entities.\n","parameters":[{"name":"updated.gt","in":"query","required":false,"description":"Filter fields updated after this timestamp","schema":{"type":"string","format":"date-time","example":"2023-01-01T00:00:00Z"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldsResponse"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Fields"],"operationId":"create-field","summary":"Creates a field","description":"Defines a new custom field (text, number, pick list, etc.) that can be attached to supported Rillet entities for reporting and automation.\nAfter creation, use create-field-value to seed allowed pick-list entries or default values teams should see in the UI.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFieldRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Field"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/fields/{id}":{"parameters":[{"name":"id","in":"path","description":"UUID of the id to be used in this operation.","required":true,"schema":{"type":"string","format":"uuid"}}],"put":{"tags":["Fields"],"operationId":"update-field","summary":"Updates a field","description":"Changes labels, validation rules, or visibility metadata on an existing custom field without recreating historical values.\nCoordinate with stakeholders before renaming because downstream integrations often key off the human-readable label.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFieldRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Field"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/fields/{id}/values":{"parameters":[{"name":"id","in":"path","description":"UUID of the id to be used in this operation.","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"tags":["Fields"],"operationId":"create-field-value","summary":"Creates a field value","description":"Adds a selectable value to a pick-list style custom field so users and APIs can tag entities with consistent taxonomy.\nValues inherit the field’s scope, so create them after the parent field exists and before importing records that reference the new code.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFieldValueRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Field"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/fields/{fieldId}/values/{fieldValueId}":{"parameters":[{"name":"fieldId","in":"path","description":"UUID of the field to be used in this operation.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"fieldValueId","in":"path","description":"UUID of the fieldValue to be used in this operation.","required":true,"schema":{"type":"string","format":"uuid"}}],"put":{"tags":["Fields"],"operationId":"update-field-value","summary":"Updates a field value","description":"Renames or reorders a pick-list entry while preserving its underlying id so historical records stay linked to the same option.\nPrefer this over delete-and-recreate when auditing requires stable references across reporting periods.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFieldValueRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Field"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]},"delete":{"tags":["Fields"],"operationId":"delete-field-value","summary":"Deletes a field value","description":"Retires a pick-list option that should no longer be selectable while keeping older records intact for read-only history.\nConfirm no automation or validation rules still require the value before removal to avoid breaking bulk imports.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Field"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/reports/trial-balance":{"get":{"tags":["Reports"],"operationId":"retrieve-trial-balance-report","summary":"Retrieves trial balance report","description":"Returns a trial balance report for the specified date range.\nRequired parameters: from_date and to_date (ISO-8601 format YYYY-MM-DD). Both must be provided or the call will fail.\nExample: from_date=2024-01-01, to_date=2024-12-31.\n","parameters":[{"$ref":"#/components/parameters/fromDate"},{"$ref":"#/components/parameters/toDate"},{"$ref":"#/components/parameters/subsidiary_id"},{"name":"book_id","in":"query","required":false,"description":"Book ID to report on. Primary books return primary-only figures; adjustment-overlay books return the combined primary and adjustment view.","schema":{"type":"string","format":"uuid","nullable":true}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrialBalanceReport"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/reports/balance-sheet":{"get":{"tags":["Reports"],"operationId":"retrieve-balance-sheet-report","summary":"Retrieves balance sheet report","description":"Returns a balance sheet report as of the specified date.\nRequired parameter: as_of_date (ISO-8601 format YYYY-MM-DD). Must be provided or the call will fail.\nExample: as_of_date=2024-12-31.\n","parameters":[{"$ref":"#/components/parameters/asOfDate"},{"$ref":"#/components/parameters/subsidiary_id"},{"$ref":"#/components/parameters/breakdownBy"},{"name":"book_id","in":"query","required":false,"description":"Book ID to report on. Primary books return primary-only figures; adjustment-overlay books return the combined primary and adjustment view.","schema":{"type":"string","format":"uuid","nullable":true}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BalanceSheetReport"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/reports/income-statement":{"get":{"tags":["Reports"],"operationId":"retrieve-income-statement-report","summary":"Retrieves income statement report","description":"Returns an income statement (profit and loss) report for the specified date range.","parameters":[{"$ref":"#/components/parameters/fromDate"},{"$ref":"#/components/parameters/toDate"},{"$ref":"#/components/parameters/subsidiary_id"},{"$ref":"#/components/parameters/breakdownBy"},{"$ref":"#/components/parameters/customFieldId"},{"name":"book_id","in":"query","required":false,"description":"Book ID to report on. Primary books return primary-only figures; adjustment-overlay books return the combined primary and adjustment view.","schema":{"type":"string","format":"uuid","nullable":true}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncomeStatementReport"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/reports/cash-flow-statement":{"get":{"tags":["Reports"],"operationId":"retrieve-cash-flow-statement-report","summary":"Retrieves cash flow statement report","description":"Returns a cash flow statement report for the specified date range.","parameters":[{"$ref":"#/components/parameters/fromDate"},{"$ref":"#/components/parameters/toDate"},{"$ref":"#/components/parameters/subsidiary_id"},{"$ref":"#/components/parameters/breakdownBy"},{"$ref":"#/components/parameters/customFieldId"},{"name":"book_id","in":"query","required":false,"description":"Book ID to report on. Primary books return primary-only figures; adjustment-overlay books return the combined primary and adjustment view.","schema":{"type":"string","format":"uuid","nullable":true}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CashFlowStatementReport"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/reports/executive-pl":{"get":{"tags":["Reports"],"operationId":"retrieve-executive-pl-report","summary":"Retrieves executive P&L report","description":"Returns an executive profit and loss report with margins for the specified date range.","parameters":[{"$ref":"#/components/parameters/fromDate"},{"$ref":"#/components/parameters/toDate"},{"$ref":"#/components/parameters/subsidiary_id"},{"$ref":"#/components/parameters/breakdownBy"},{"$ref":"#/components/parameters/customFieldId"},{"name":"book_id","in":"query","required":false,"description":"Book ID to report on. Primary books return primary-only figures; adjustment-overlay books return the combined primary and adjustment view.","schema":{"type":"string","format":"uuid","nullable":true}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutivePLReport"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/reports/journal-entries":{"get":{"tags":["Reports"],"operationId":"list-reports-journal-entries","summary":"Lists journal entries with reporting currency amounts","description":"Returns journal entries with line item amounts converted to the reporting currency.","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/subsidiary_id"},{"name":"updated.gt","in":"query","required":false,"description":"Filter journal entries updated after this timestamp","schema":{"type":"string","format":"date-time","example":"2023-01-01T00:00:00Z"}},{"name":"date.gte","in":"query","required":false,"description":"Filter journal entries with a posting date on or after this date (inclusive)","schema":{"type":"string","format":"date","example":"2023-12-01"}},{"name":"date.lte","in":"query","required":false,"description":"Filter journal entries with a posting date on or before this date (inclusive)","schema":{"type":"string","format":"date","example":"2023-12-31"}},{"name":"account_ids","in":"query","required":false,"description":"Filter journal entries that have at least one line item posting to any of these account ids (comma-separated)","schema":{"type":"array","items":{"type":"string","format":"uuid"}},"style":"form","explode":false,"example":["11111111-1111-1111-1111-111111111111","22222222-2222-2222-2222-222222222222"]},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","enum":["created","updated"],"default":"created"},"description":"the field the journal entries should be sorted by descending (either created or updated)"},{"name":"book_id","in":"query","required":false,"description":"Book ID to report on. Primary books return primary-only entries; adjustment-overlay books return primary and adjustment entries.","schema":{"type":"string","format":"uuid","nullable":true}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["journal_entries"],"type":"object","properties":{"journal_entries":{"type":"array","items":{"$ref":"#/components/schemas/ReportingJournalEntry"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"parameters":{"limit":{"name":"limit","in":"query","required":false,"description":"Maximum number of rows to return in the page.","schema":{"$ref":"#/components/schemas/PageLimit"}},"cursor":{"name":"cursor","in":"query","required":false,"description":"Pagination cursor to navigate through the full response.","schema":{"$ref":"#/components/schemas/PageCursor"}},"status":{"name":"status","in":"query","required":true,"description":"whether to include committed or active entries","schema":{"$ref":"#/components/schemas/Status"}},"breakdown":{"name":"breakdown","in":"query","required":true,"description":"whether annual or monthly breakdowns","schema":{"$ref":"#/components/schemas/Breakdown"}},"subsidiary_id":{"name":"subsidiary_id","in":"query","required":false,"description":"Subsidiary to be used when filtering data","schema":{"type":"string","format":"uuid"}},"month":{"name":"month","in":"query","required":true,"description":"The month and year to export. Uses ISO-8061 format (YYYY-MM).","schema":{"type":"string","format":"yearMonth"}},"fromDate":{"name":"from_date","in":"query","required":true,"description":"Start date for the report period. Uses ISO-8601 format (YYYY-MM-DD).","schema":{"type":"string","format":"date"},"example":"2024-01-01"},"toDate":{"name":"to_date","in":"query","required":true,"description":"End date for the report period. Uses ISO-8601 format (YYYY-MM-DD).","schema":{"type":"string","format":"date"},"example":"2024-01-31"},"asOfDate":{"name":"as_of_date","in":"query","required":true,"description":"The date for the point-in-time report. Uses ISO-8601 format (YYYY-MM-DD).","schema":{"type":"string","format":"date"},"example":"2024-01-31"},"breakdownBy":{"name":"breakdown_by","in":"query","required":false,"description":"How to break down the report columns. If not specified, returns a single total column.","schema":{"$ref":"#/components/schemas/ReportBreakdownBy"}},"customFieldId":{"name":"custom_field_id","in":"query","required":false,"description":"The ID of the custom field to break down by. Required when breakdown_by is CUSTOM_FIELD.","schema":{"type":"string","format":"uuid"}},"X-Rillet-Signature":{"name":"X-Rillet-Signature","in":"header","schema":{"type":"string"},"required":true,"description":"Signature of the webhook event. Computed using HMAC-SHA256 and AES encrypted with the configured webhook token. The contents of the body are prefixed with the timestamp and id before hashing."},"X-Rillet-Timestamp":{"name":"X-Rillet-Timestamp","in":"header","schema":{"type":"string","format":"date-time"},"required":true,"description":"Timestamp of the webhook event in ISO-8601 format"},"X-Rillet-Id":{"name":"X-Rillet-Id","in":"header","schema":{"type":"string","format":"uuid"},"required":true,"description":"ID of the webhook event"},"X-Rillet-Entity":{"name":"X-Rillet-Entity","in":"header","schema":{"type":"string"},"required":true,"description":"Entity type of the webhook event"},"X-Rillet-Event":{"name":"X-Rillet-Event","in":"header","schema":{"type":"string"},"required":true,"description":"Event type of the webhook event"}},"schemas":{"ApprovalWorkflow":{"type":"object","description":"An approval workflow: the conditions deciding which entries it applies to, and the ordered layers of\napprovers that must sign off.\n","required":["id","name","type","active","priority","condition_group","approval_layers","methods","updated_at"],"properties":{"id":{"type":"string","format":"uuid","example":"0199e21a-14c2-7abc-9d3e-112233445566"},"name":{"type":"string","example":"JE over 50k — Controller then CFO"},"type":{"$ref":"#/components/schemas/ApprovalWorkflowType"},"active":{"type":"boolean","description":"Only active workflows are evaluated. Read-only here: a workflow is activated and deactivated in\nRillet, so this value can change without a definition update.\n"},"priority":{"type":"integer","format":"int32","description":"Evaluation order among the active workflows of the same type, ascending and zero-based — the first\nworkflow whose conditions match is the one applied, and later ones are skipped. Assigned by the\nserver: a workflow is put last when created, and again when reactivated. Not necessarily unique;\nties are resolved by `id`.\n","example":1},"condition_group":{"$ref":"#/components/schemas/ApprovalWorkflowConditionGroup"},"approval_layers":{"type":"array","description":"Layers of approvers in ascending `order`, each one actionable only once the previous is satisfied.\nThe entry is approved when every layer is satisfied. At most five.\n","items":{"$ref":"#/components/schemas/ApprovalWorkflowLayer"}},"methods":{"type":"array","description":"How approvers are asked to act. `IN_APP` is the only method Rillet acts on today; `EMAIL` and\n`SLACK` can appear on workflows configured before they were withdrawn, and no notification is\ndelivered for them.\n","items":{"$ref":"#/components/schemas/ApprovalWorkflowMethod"}},"updated_at":{"type":"string","format":"date-time","description":"ISO 8601 timestamp in UTC timezone (must end with 'Z'). Covers activation and reordering as well as\ndefinition changes.\n"}}},"ApprovalWorkflowRequest":{"type":"object","description":"An approval workflow's definition, as sent when creating or replacing one. A workflow's `type` never\nchanges, and `active` changes only through activation in Rillet, so an update must send both back\nunchanged.\n","required":["name","type","active","condition_group","approval_layers","methods"],"properties":{"name":{"type":"string","example":"JE over 50k — Controller then CFO"},"type":{"$ref":"#/components/schemas/ApprovalWorkflowType","description":"Required, and must equal the workflow's current type — a workflow cannot be moved between types,\nbecause `priority` orders workflows within one type. Only `JOURNAL_ENTRY` is accepted today; the\nother types are rejected until an approval flow evaluates them.\n"},"active":{"type":"boolean","description":"Required, and must equal the workflow's current value — activation is a dedicated operation in\nRillet, so a definition update never changes it. Read the workflow first if you are unsure.\n"},"condition_group":{"$ref":"#/components/schemas/ApprovalWorkflowConditionGroupRequest"},"approval_layers":{"type":"array","minItems":1,"maxItems":5,"items":{"$ref":"#/components/schemas/ApprovalWorkflowLayerRequest"}},"methods":{"type":"array","minItems":1,"description":"Only `[\"IN_APP\"]` is accepted today: `EMAIL` and `SLACK` deliver nothing, so they are rejected\nrather than stored.\n","items":{"$ref":"#/components/schemas/ApprovalWorkflowMethod"}}}},"ApprovalWorkflowType":{"type":"string","description":"The kind of record a workflow applies to. Only `JOURNAL_ENTRY` is evaluated by any approval flow today;\nthe others can appear on workflows configured in the Rillet app.\n","enum":["JOURNAL_ENTRY","CONTRACT","INVOICE","BILL"],"example":"JOURNAL_ENTRY"},"ApprovalWorkflowConditionLogic":{"type":"string","description":"How the workflow's conditions combine: `AND` requires every condition to match, `OR` any of them.\n","enum":["AND","OR"],"example":"AND"},"ApprovalWorkflowMethod":{"type":"string","description":"How approvers are asked to act. Only `IN_APP` is acted on; `EMAIL` and `SLACK` were withdrawn and\ndeliver nothing.\n","enum":["IN_APP","EMAIL","SLACK"],"example":"IN_APP"},"ApprovalWorkflowSourceType":{"type":"string","description":"Whether a journal entry was created by a person (`MANUAL`) or by Rillet from another record such as a\nbill, invoice or amortisation schedule (`SYSTEM`). `ALL` matches either.\n","enum":["MANUAL","SYSTEM","ALL"],"example":"ALL"},"ApprovalWorkflowEqualityOperator":{"type":"string","enum":["EQUALS","NOT_EQUALS"],"example":"EQUALS"},"ApprovalWorkflowCollectionOperator":{"type":"string","description":"How a condition compares against a set of values: `ANY_OF` matches when at least one of them applies,\n`NONE_OF` when none does.\n","enum":["ANY_OF","NONE_OF"],"example":"ANY_OF"},"ApprovalWorkflowNumericOperator":{"type":"string","enum":["GREATER_THAN","GREATER_THAN_OR_EQUALS","LESS_THAN","LESS_THAN_OR_EQUALS","EQUALS"],"example":"GREATER_THAN"},"ApprovalWorkflowConditionGroup":{"type":"object","description":"A set of conditions combined by one logical operator, together with any nested groups, which combine\ninto it the same way. A group carries at least one condition or one nested group. Today a workflow\nalways has a single group with no nested groups; `groups` exists so that combinations such as\n`A AND (B OR C)` can be expressed without reshaping this contract.\n","required":["logic","conditions"],"properties":{"logic":{"$ref":"#/components/schemas/ApprovalWorkflowConditionLogic"},"conditions":{"type":"array","description":"Conditions in this group, exactly as stored. A workflow carries at most five conditions across the\nwhole tree, not five per group.\n\nA journal-entry workflow with no `SOURCE_TYPE` condition applies to manually created entries only,\nwhatever its other conditions say: that restriction is implied rather than stored. Add a\n`SOURCE_TYPE` condition to have a workflow apply to entries Rillet generates from bills, invoices\nor amortisation schedules.\n","items":{"$ref":"#/components/schemas/ApprovalWorkflowCondition"}},"groups":{"type":"array","description":"Nested groups, each combined into this one by `logic`. Nesting is at most three levels deep.\nAlways empty today.\n","items":{"$ref":"#/components/schemas/ApprovalWorkflowConditionGroup"}}}},"ApprovalWorkflowCondition":{"description":"One condition of a workflow. `condition_type` selects the variant.\n","discriminator":{"propertyName":"condition_type","mapping":{"AMOUNT":"#/components/schemas/ApprovalWorkflowAmountCondition","SUBSIDIARY":"#/components/schemas/ApprovalWorkflowSubsidiaryCondition","CREATED_BY_USER":"#/components/schemas/ApprovalWorkflowCreatedByUserCondition","FIELD":"#/components/schemas/ApprovalWorkflowFieldCondition","ACCOUNT":"#/components/schemas/ApprovalWorkflowAccountCondition","SOURCE_TYPE":"#/components/schemas/ApprovalWorkflowSourceTypeCondition"}},"oneOf":[{"$ref":"#/components/schemas/ApprovalWorkflowAmountCondition"},{"$ref":"#/components/schemas/ApprovalWorkflowSubsidiaryCondition"},{"$ref":"#/components/schemas/ApprovalWorkflowCreatedByUserCondition"},{"$ref":"#/components/schemas/ApprovalWorkflowFieldCondition"},{"$ref":"#/components/schemas/ApprovalWorkflowAccountCondition"},{"$ref":"#/components/schemas/ApprovalWorkflowSourceTypeCondition"}],"example":{"id":"0199e21b-be83-7298-a9d6-8c43437117c8","condition_type":"AMOUNT","operator":"GREATER_THAN","threshold":{"type":"MONETARY","amount":{"amount":"50000.00","currency":"USD"}}}},"ApprovalWorkflowAmountCondition":{"type":"object","description":"Matches on the entry's total debit amount.\n","required":["id","condition_type","operator","threshold"],"properties":{"id":{"type":"string","format":"uuid","description":"Identifies the condition. Server-generated, and returned on every read.\n","example":"0199e21b-be83-7298-a9d6-8c43437117c8"},"condition_type":{"type":"string","default":"AMOUNT"},"operator":{"$ref":"#/components/schemas/ApprovalWorkflowNumericOperator"},"threshold":{"$ref":"#/components/schemas/ApprovalWorkflowAmountThreshold"}}},"ApprovalWorkflowAmountConditionRequest":{"type":"object","description":"Matches on the entry's total debit amount.\n","required":["condition_type","operator","threshold"],"properties":{"id":{"type":"string","format":"uuid","description":"Send the id of an existing condition to keep it, or omit it to have a new one generated.\n","example":"0199e21b-be83-7298-a9d6-8c43437117c8"},"condition_type":{"type":"string","default":"AMOUNT"},"operator":{"$ref":"#/components/schemas/ApprovalWorkflowNumericOperator"},"threshold":{"$ref":"#/components/schemas/ApprovalWorkflowAmountThreshold"}}},"ApprovalWorkflowAmountThreshold":{"description":"The amount a condition compares against, either in a specific currency or as a plain number.\n","discriminator":{"propertyName":"type","mapping":{"MONETARY":"#/components/schemas/ApprovalWorkflowMonetaryThreshold","NUMERIC":"#/components/schemas/ApprovalWorkflowNumericThreshold"}},"oneOf":[{"$ref":"#/components/schemas/ApprovalWorkflowMonetaryThreshold"},{"$ref":"#/components/schemas/ApprovalWorkflowNumericThreshold"}],"example":{"type":"MONETARY","amount":{"amount":"50000.00","currency":"USD"}}},"ApprovalWorkflowMonetaryThreshold":{"type":"object","description":"A threshold in one currency. Amounts are compared without conversion, so an entry in another currency\ndoes not match.\n","required":["type","amount"],"properties":{"type":{"type":"string","default":"MONETARY"},"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"}}},"ApprovalWorkflowNumericThreshold":{"type":"object","description":"A threshold without a currency: the entry's amount is compared as a number, whatever its currency.\n","required":["type","value"],"properties":{"type":{"type":"string","default":"NUMERIC"},"value":{"type":"string","description":"Decimal number, using a period (.) as the decimal separator.","example":"50000.00"}}},"ApprovalWorkflowSubsidiaryCondition":{"type":"object","description":"Matches on the entry's subsidiary.\n","required":["id","condition_type","operator","subsidiary_id"],"properties":{"id":{"type":"string","format":"uuid","description":"Identifies the condition. Server-generated, and returned on every read.\n","example":"0199e21b-be83-7298-a9d6-8c43437117c8"},"condition_type":{"type":"string","default":"SUBSIDIARY"},"operator":{"$ref":"#/components/schemas/ApprovalWorkflowEqualityOperator"},"subsidiary_id":{"type":"string","format":"uuid","example":"0199e21b-be83-7298-a9d6-8c43437117c8"}}},"ApprovalWorkflowSubsidiaryConditionRequest":{"type":"object","description":"Matches on the entry's subsidiary.\n","required":["condition_type","operator","subsidiary_id"],"properties":{"id":{"type":"string","format":"uuid","description":"Send the id of an existing condition to keep it, or omit it to have a new one generated.\n","example":"0199e21b-be83-7298-a9d6-8c43437117c8"},"condition_type":{"type":"string","default":"SUBSIDIARY"},"operator":{"$ref":"#/components/schemas/ApprovalWorkflowEqualityOperator"},"subsidiary_id":{"type":"string","format":"uuid","example":"0199e21b-be83-7298-a9d6-8c43437117c8"}}},"ApprovalWorkflowCreatedByUserCondition":{"type":"object","description":"Matches on the user who created the entry or, if it has since been edited, who last edited it — an edit\nstarts a fresh approval, attributed to the editor. Entries Rillet generates itself have no user, so\n`EQUALS` never matches them and `NOT_EQUALS` always does.\n","required":["id","condition_type","operator","user_id"],"properties":{"id":{"type":"string","format":"uuid","description":"Identifies the condition. Server-generated, and returned on every read.\n","example":"0199e21b-be83-7298-a9d6-8c43437117c8"},"condition_type":{"type":"string","default":"CREATED_BY_USER"},"operator":{"$ref":"#/components/schemas/ApprovalWorkflowEqualityOperator"},"user_id":{"type":"string","format":"uuid","example":"0199e21a-9b3d-7cde-8f21-665544332211"}}},"ApprovalWorkflowCreatedByUserConditionRequest":{"type":"object","description":"Matches on the user who created the entry or, if it has since been edited, who last edited it — an edit\nstarts a fresh approval, attributed to the editor. Entries Rillet generates itself have no user, so\n`EQUALS` never matches them and `NOT_EQUALS` always does.\n","required":["condition_type","operator","user_id"],"properties":{"id":{"type":"string","format":"uuid","description":"Send the id of an existing condition to keep it, or omit it to have a new one generated.\n","example":"0199e21b-be83-7298-a9d6-8c43437117c8"},"condition_type":{"type":"string","default":"CREATED_BY_USER"},"operator":{"$ref":"#/components/schemas/ApprovalWorkflowEqualityOperator"},"user_id":{"type":"string","format":"uuid","example":"0199e21a-9b3d-7cde-8f21-665544332211"}}},"ApprovalWorkflowFieldCondition":{"type":"object","description":"Matches on a custom field value, looking at both the entry and its line items. `EQUALS` matches when any\nof them carries the value, `NOT_EQUALS` when none does.\n","required":["id","condition_type","operator","field_id","field_value_id"],"properties":{"id":{"type":"string","format":"uuid","description":"Identifies the condition. Server-generated, and returned on every read.\n","example":"0199e21b-be83-7298-a9d6-8c43437117c8"},"condition_type":{"type":"string","default":"FIELD"},"operator":{"$ref":"#/components/schemas/ApprovalWorkflowEqualityOperator"},"field_id":{"type":"string","format":"uuid","example":"0199e21c-195c-7592-b669-c63d2c0ac735"},"field_value_id":{"type":"string","format":"uuid","example":"0199e21d-2a4f-7111-8c22-aabbccddeeff"}}},"ApprovalWorkflowFieldConditionRequest":{"type":"object","description":"Matches on a custom field value, looking at both the entry and its line items. `EQUALS` matches when any\nof them carries the value, `NOT_EQUALS` when none does.\n","required":["condition_type","operator","field_id","field_value_id"],"properties":{"id":{"type":"string","format":"uuid","description":"Send the id of an existing condition to keep it, or omit it to have a new one generated.\n","example":"0199e21b-be83-7298-a9d6-8c43437117c8"},"condition_type":{"type":"string","default":"FIELD"},"operator":{"$ref":"#/components/schemas/ApprovalWorkflowEqualityOperator"},"field_id":{"type":"string","format":"uuid","example":"0199e21c-195c-7592-b669-c63d2c0ac735"},"field_value_id":{"type":"string","format":"uuid","example":"0199e21d-2a4f-7111-8c22-aabbccddeeff"}}},"ApprovalWorkflowAccountCondition":{"type":"object","description":"Matches on the GL accounts an entry's line items post to. `ANY_OF` matches when a line item posts to any of\nthe listed accounts, `NONE_OF` when none of them is used.\n","required":["id","condition_type","operator","account_ids"],"properties":{"id":{"type":"string","format":"uuid","description":"Identifies the condition. Server-generated, and returned on every read.\n","example":"0199e21b-be83-7298-a9d6-8c43437117c8"},"condition_type":{"type":"string","default":"ACCOUNT"},"operator":{"$ref":"#/components/schemas/ApprovalWorkflowCollectionOperator"},"account_ids":{"type":"array","minItems":1,"description":"The accounts this condition looks for.\n","items":{"type":"string","format":"uuid","example":"0199e21e-3b5a-7222-9d33-bbccddeeff00"}}}},"ApprovalWorkflowAccountConditionRequest":{"type":"object","description":"Matches on the GL accounts an entry's line items post to. `ANY_OF` matches when a line item posts to any of\nthe listed accounts, `NONE_OF` when none of them is used.\n","required":["condition_type","operator","account_ids"],"properties":{"id":{"type":"string","format":"uuid","description":"Send the id of an existing condition to keep it, or omit it to have a new one generated.\n","example":"0199e21b-be83-7298-a9d6-8c43437117c8"},"condition_type":{"type":"string","default":"ACCOUNT"},"operator":{"$ref":"#/components/schemas/ApprovalWorkflowCollectionOperator"},"account_ids":{"type":"array","minItems":1,"description":"The accounts this condition looks for.\n","items":{"type":"string","format":"uuid","example":"0199e21e-3b5a-7222-9d33-bbccddeeff00"}}}},"ApprovalWorkflowSourceTypeCondition":{"type":"object","description":"Matches on how the entry came to exist. A journal-entry workflow with no condition of this type applies\nto manually created entries only. A workflow can carry at most one.\n","required":["id","condition_type","source_type"],"properties":{"id":{"type":"string","format":"uuid","description":"Identifies the condition. Server-generated, and returned on every read.\n","example":"0199e21b-be83-7298-a9d6-8c43437117c8"},"condition_type":{"type":"string","default":"SOURCE_TYPE"},"source_type":{"$ref":"#/components/schemas/ApprovalWorkflowSourceType"}}},"ApprovalWorkflowSourceTypeConditionRequest":{"type":"object","description":"Matches on how the entry came to exist. A journal-entry workflow with no condition of this type applies\nto manually created entries only. A workflow can carry at most one.\n","required":["condition_type","source_type"],"properties":{"id":{"type":"string","format":"uuid","description":"Send the id of an existing condition to keep it, or omit it to have a new one generated.\n","example":"0199e21b-be83-7298-a9d6-8c43437117c8"},"condition_type":{"type":"string","default":"SOURCE_TYPE"},"source_type":{"$ref":"#/components/schemas/ApprovalWorkflowSourceType"}}},"ApprovalWorkflowLayer":{"description":"One layer of approvers. `approver_type` selects the variant.\n","discriminator":{"propertyName":"approver_type","mapping":{"USER":"#/components/schemas/ApprovalWorkflowUserLayer","ROLE":"#/components/schemas/ApprovalWorkflowRoleLayer"}},"oneOf":[{"$ref":"#/components/schemas/ApprovalWorkflowUserLayer"},{"$ref":"#/components/schemas/ApprovalWorkflowRoleLayer"}],"example":{"id":"0199e21e-3b5a-7222-9d33-bbccddeeff00","order":1,"approver_type":"USER","require_all":false,"approver_user_ids":["0199e21a-9b3d-7cde-8f21-665544332211"]}},"ApprovalWorkflowUserLayer":{"type":"object","description":"A layer approved by the named users.\n","required":["id","order","approver_type","require_all","approver_user_ids"],"properties":{"id":{"type":"string","format":"uuid","description":"Identifies the layer. Server-generated, and returned on every read.\n","example":"0199e21e-3b5a-7222-9d33-bbccddeeff00"},"order":{"type":"integer","format":"int32","minimum":1,"description":"Position of the layer in the sequence, starting at 1. Layers are numbered consecutively with no gaps\nor repeats.\n","example":1},"approver_type":{"type":"string","default":"USER"},"require_all":{"type":"boolean","description":"When true, every listed user must approve; when false, one approval satisfies the layer. Workflows\nconfigured in the Rillet app always use false.\n","example":false},"approver_user_ids":{"type":"array","minItems":1,"description":"Users allowed to approve at this layer. Each must be an active member of the organization.\n","items":{"type":"string","format":"uuid","example":"0199e21a-9b3d-7cde-8f21-665544332211"}}}},"ApprovalWorkflowRoleLayer":{"type":"object","description":"A layer approved by anyone holding one of the given roles. Membership is resolved when the approval\nhappens, not when the workflow is saved, so changing who holds a role changes who can approve entries\nalready awaiting approval.\n","required":["id","order","approver_type","require_all","role_ids"],"properties":{"id":{"type":"string","format":"uuid","description":"Identifies the layer. Server-generated, and returned on every read.\n","example":"0199e21f-4c6b-7333-ae44-ccddeeff0011"},"order":{"type":"integer","format":"int32","minimum":1,"description":"Position of the layer in the sequence, starting at 1. Layers are numbered consecutively with no gaps\nor repeats.\n","example":2},"approver_type":{"type":"string","default":"ROLE"},"require_all":{"type":"boolean","description":"When true, each listed role must be represented among the approvals; when false, one approval\nsatisfies the layer. Workflows configured in the Rillet app always use false.\n","example":false},"role_ids":{"type":"array","minItems":1,"description":"Roles allowed to approve at this layer.\n","items":{"type":"string","format":"uuid","example":"7a1b2c3d-4e5f-6789-abcd-ef0123456789"}}}},"ApprovalWorkflowConditionGroupRequest":{"type":"object","description":"A set of conditions combined by one logical operator, together with any nested groups. A group must\ncarry at least one condition or one nested group; a workflow may carry at most five conditions across\nthe whole tree, and nesting at most three levels deep. `groups` must be empty for now: nested\ncombinations are not evaluated yet and are rejected, so a workflow currently has exactly one group.\n","required":["logic","conditions"],"properties":{"logic":{"$ref":"#/components/schemas/ApprovalWorkflowConditionLogic"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalWorkflowConditionRequest"}},"groups":{"type":"array","description":"Nested groups. Rejected while nesting is unsupported.\n","items":{"$ref":"#/components/schemas/ApprovalWorkflowConditionGroupRequest"}}}},"ApprovalWorkflowConditionRequest":{"description":"One condition to write. `condition_type` selects the variant.\n","discriminator":{"propertyName":"condition_type","mapping":{"AMOUNT":"#/components/schemas/ApprovalWorkflowAmountConditionRequest","SUBSIDIARY":"#/components/schemas/ApprovalWorkflowSubsidiaryConditionRequest","CREATED_BY_USER":"#/components/schemas/ApprovalWorkflowCreatedByUserConditionRequest","FIELD":"#/components/schemas/ApprovalWorkflowFieldConditionRequest","ACCOUNT":"#/components/schemas/ApprovalWorkflowAccountConditionRequest","SOURCE_TYPE":"#/components/schemas/ApprovalWorkflowSourceTypeConditionRequest"}},"oneOf":[{"$ref":"#/components/schemas/ApprovalWorkflowAmountConditionRequest"},{"$ref":"#/components/schemas/ApprovalWorkflowSubsidiaryConditionRequest"},{"$ref":"#/components/schemas/ApprovalWorkflowCreatedByUserConditionRequest"},{"$ref":"#/components/schemas/ApprovalWorkflowFieldConditionRequest"},{"$ref":"#/components/schemas/ApprovalWorkflowAccountConditionRequest"},{"$ref":"#/components/schemas/ApprovalWorkflowSourceTypeConditionRequest"}],"example":{"condition_type":"AMOUNT","operator":"GREATER_THAN","threshold":{"type":"MONETARY","amount":{"amount":"50000.00","currency":"USD"}}}},"ApprovalWorkflowLayerRequest":{"description":"One layer of approvers to write. `approver_type` selects the variant.\n","discriminator":{"propertyName":"approver_type","mapping":{"USER":"#/components/schemas/ApprovalWorkflowUserLayerRequest","ROLE":"#/components/schemas/ApprovalWorkflowRoleLayerRequest"}},"oneOf":[{"$ref":"#/components/schemas/ApprovalWorkflowUserLayerRequest"},{"$ref":"#/components/schemas/ApprovalWorkflowRoleLayerRequest"}],"example":{"order":1,"approver_type":"USER","require_all":false,"approver_user_ids":["0199e21a-9b3d-7cde-8f21-665544332211"]}},"ApprovalWorkflowUserLayerRequest":{"type":"object","description":"A layer approved by the named users.\n","required":["order","approver_type","require_all","approver_user_ids"],"properties":{"id":{"type":"string","format":"uuid","description":"Send the id of an existing layer to keep it, or omit it to have a new one generated.\n","example":"0199e21e-3b5a-7222-9d33-bbccddeeff00"},"order":{"type":"integer","format":"int32","minimum":1,"description":"Position of the layer in the sequence. Layers must be numbered consecutively from 1, with no gaps or\nrepeats.\n","example":1},"approver_type":{"type":"string","default":"USER"},"require_all":{"type":"boolean","description":"Whether every listed user must approve. Only `false` is accepted today — requiring every approver\nis not something the Rillet app can configure yet.\n","example":false},"approver_user_ids":{"type":"array","minItems":1,"description":"Users allowed to approve at this layer. Each must be an active member of the organization.\n","items":{"type":"string","format":"uuid","example":"0199e21a-9b3d-7cde-8f21-665544332211"}}}},"ApprovalWorkflowRoleLayerRequest":{"type":"object","description":"A layer approved by anyone holding one of the given roles, resolved when the approval happens.\n","required":["order","approver_type","require_all","role_ids"],"properties":{"id":{"type":"string","format":"uuid","description":"Send the id of an existing layer to keep it, or omit it to have a new one generated.\n","example":"0199e21f-4c6b-7333-ae44-ccddeeff0011"},"order":{"type":"integer","format":"int32","minimum":1,"description":"Position of the layer in the sequence. Layers must be numbered consecutively from 1, with no gaps or\nrepeats.\n","example":2},"approver_type":{"type":"string","default":"ROLE"},"require_all":{"type":"boolean","description":"Whether each listed role must be represented among the approvals. Only `false` is accepted today —\nrequiring every approver is not something the Rillet app can configure yet.\n","example":false},"role_ids":{"type":"array","minItems":1,"description":"Roles allowed to approve at this layer.\n","items":{"type":"string","format":"uuid","example":"7a1b2c3d-4e5f-6789-abcd-ef0123456789"}}}},"Breakdown":{"type":"string","enum":["ARR","MRR"]},"ReportBreakdownBy":{"type":"string","description":"How to break down the report columns. If not specified, returns a single total column.","enum":["SUBSIDIARY","CUSTOM_FIELD"]},"Status":{"type":"string","enum":["ACTIVE","COMMITTED"]},"ContractStatus":{"type":"string","enum":["ACTIVE","IN_EFFECT","CANCELLED","ENDED","AMENDED"]},"InvoiceStatus":{"type":"string","enum":["UNPAID","PAID","PARTIALLY_PAID","UNBILLED","CREDITED","PARTIALLY_CREDITED"]},"BillStatus":{"type":"string","enum":["UNPAID","PAID","PARTIALLY_PAID","CREDITED","PARTIALLY_CREDITED","APPLIED"]},"ReimbursementStatus":{"type":"string","enum":["UNPAID","PAID","PARTIALLY_PAID"]},"ChargeStatus":{"type":"string","enum":["UNPAID","PAID","PARTIALLY_PAID"]},"RevenueWaterfall":{"type":"object","required":["customers"],"properties":{"customers":{"type":"array","items":{"$ref":"#/components/schemas/CustomerRevenue"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}},"CustomerRevenue":{"type":"object","required":["id","name","totals"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"total":{"$ref":"#/components/schemas/Revenue"}}},"Revenue":{"type":"object","required":["year_month","amount"],"properties":{"year_month":{"type":"string","description":"Year and month for the requested report for this revenue total","format":"yearMonth"},"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"}}},"Error":{"type":"object","required":["type","title"],"properties":{"type":{"type":"string","format":"uri","description":"A URI reference that identifies the error type.","example":"https://rillet.io/forbidden"},"title":{"type":"string","description":"Summary of the problem.","example":"Forbidden"},"status":{"type":"integer","description":"The HTTP status code generated by the origin server for this occurrence of the error.","example":403},"detail":{"type":"string","description":"Explanation specific to this occurrence of the error.","example":"User does not have rights to perform this operation."}}},"CurrencyCode":{"type":"string","description":"Currency code following ISO-4217","example":"USD"},"MonetaryAmount":{"type":"object","required":["amount","currency"],"properties":{"amount":{"type":"string","description":"Monetary amount in decimal format, using a period (.) as the decimal separator. (e.g. '1.01' in $ currency represents 1$ and 1 cent.)","example":"1.01"},"currency":{"$ref":"#/components/schemas/CurrencyCode"}}},"RoundedMonetaryAmount":{"type":"object","description":"A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).","x-class-extra-annotation":"@io.rillet.common.infra.validators.IsRoundedAmount","required":["amount","currency"],"properties":{"amount":{"type":"string","description":"Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).","example":"1.01"},"currency":{"$ref":"#/components/schemas/CurrencyCode"}}},"Pagination":{"type":"object","properties":{"next_cursor":{"$ref":"#/components/schemas/PageCursor"}}},"PageCursor":{"type":"string","description":"If defined, a cursor to retrieve the next page.","example":"iLQvkEj3sh3UiweC"},"PageLimit":{"type":"integer","minimum":1,"maximum":100,"default":25},"CountryCode":{"type":"string","description":"Two-letter country code (ISO 3166-1 alpha-2).","example":"US"},"RevenuePattern":{"type":"string","enum":["DAILY","EVEN_PERIOD"],"description":"DAILY means that the revenue is divided equally per day in the revenue period. EVEN_PERIOD means that the revenue is divided equally for each calendar month in the revenue period."},"FixedPrice":{"type":"object","required":["amount"],"properties":{"amount":{"$ref":"#/components/schemas/MonetaryAmount"}}},"RecurringPrice":{"type":"object","required":["interval_months"],"properties":{"interval_months":{"type":"integer","format":"int32","minimum":1,"maximum":12,"example":1}}},"Price":{"discriminator":{"propertyName":"type","mapping":{"FIXED_RECURRING":"#/components/schemas/FixedRecurringPrice","ONE_TIME":"#/components/schemas/OneTimePrice","USAGE":"#/components/schemas/UsagePrice"}},"oneOf":[{"$ref":"#/components/schemas/FixedRecurringPrice"},{"$ref":"#/components/schemas/OneTimePrice"},{"$ref":"#/components/schemas/UsagePrice"}],"example":{"type":"FIXED_RECURRING","amount":{"amount":"10.00","currency":"USD"},"interval_months":1}},"FixedRecurringPrice":{"allOf":[{"$ref":"#/components/schemas/FixedPrice"},{"$ref":"#/components/schemas/RecurringPrice"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","default":"FIXED_RECURRING"}}}]},"OneTimePrice":{"allOf":[{"$ref":"#/components/schemas/FixedPrice"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","default":"ONE_TIME"}}}]},"UsagePrice":{"allOf":[{"$ref":"#/components/schemas/RecurringPrice"},{"type":"object","required":["type","billing_scheme"],"properties":{"type":{"type":"string","default":"USAGE"},"billing_scheme":{"$ref":"#/components/schemas/BillingScheme"}}}]},"BillingScheme":{"discriminator":{"propertyName":"type","mapping":{"PER_UNIT":"#/components/schemas/PerUnitBilling","TIERED":"#/components/schemas/TieredBilling"}},"oneOf":[{"$ref":"#/components/schemas/PerUnitBilling"},{"$ref":"#/components/schemas/TieredBilling"}]},"PerUnitBilling":{"type":"object","required":["type","amount","units"],"properties":{"type":{"type":"string","default":"PER_UNIT"},"amount":{"$ref":"#/components/schemas/MonetaryAmount"},"units":{"type":"integer","format":"int32","minimum":1,"example":1}}},"TieredBilling":{"type":"object","required":["type","mode","tiers"],"properties":{"type":{"type":"string","default":"TIERED"},"mode":{"type":"string","enum":["GRADUATED","METERED"],"description":"In metered tiering, the maximum quantity within a period determines the price. In graduated tiering, pricing changes as the quantity grows – the price from each tier up to the reported quantity is accumulated."},"tiers":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/Tier"}}},"description":"All tiers except for the highest have to define a value for upTo. There cannot be more than one tier with the same upTo value."},"Tier":{"type":"object","required":["up_to"],"properties":{"up_to":{"type":"integer","format":"int32","minimum":1,"example":10},"flat_price":{"$ref":"#/components/schemas/MonetaryAmount"},"per_unit_price":{"$ref":"#/components/schemas/MonetaryAmount"}},"description":"At least one of flatPrice or perUnitPrice has to be defined. flatPrice is the price for the entire tier. perUnitPrice is price for units relevant to the tier."},"TaxRateWithOptionalAmount":{"type":"object","required":["country","description","percentage","type"],"properties":{"percentage":{"type":"string","format":"number","minimum":0,"maximum":100,"example":"0"},"tax_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"country":{"$ref":"#/components/schemas/CountryCode"},"type":{"type":"string","enum":["VAT","SALES_TAX"]},"description":{"type":"string"}}},"TaxRateWithOptionalAmountAndCode":{"allOf":[{"$ref":"#/components/schemas/TaxRateWithOptionalAmount"}],"properties":{"tax_code":{"type":"string","description":"Code of a predefined tax rate. When provided, the rate's percentage, country, type, and description are loaded from the tax rate catalog. Available codes can be fetched from the list tax rates endpoint."}}},"TaxRate":{"allOf":[{"$ref":"#/components/schemas/TaxRateWithOptionalAmount"}],"required":["tax_amount"]},"ExpenseTaxRate":{"allOf":[{"$ref":"#/components/schemas/TaxRate"},{"type":"object","required":["coverage"],"properties":{"tax_code":{"type":"string","description":"Code of a predefined tax rate. When provided, the rate's percentage, country, and description are used instead of the inline values."},"coverage":{"type":"string","enum":["INCLUSIVE","EXCLUSIVE"]}}}]},"Product":{"type":"object","required":["description","id","include_in_arr_mrr","name","price","revenue_pattern","status","account_code"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"English subscription"},"description":{"type":"string","example":"Subscription to english classes"},"price":{"$ref":"#/components/schemas/Price"},"include_in_arr_mrr":{"type":"boolean"},"revenue_pattern":{"$ref":"#/components/schemas/RevenuePattern"},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"status":{"type":"string","enum":["ACTIVE","INACTIVE"]},"account_code":{"$ref":"#/components/schemas/AccountCode"}}},"CreateAccountRequest":{"type":"object","additionalProperties":false,"required":["name","code","type","subtype","intercompany"],"properties":{"name":{"type":"string","minLength":1,"pattern":".*\\S.*","description":"Display name of the account.","example":"My New Account"},"code":{"type":"string","minLength":1,"pattern":"^[A-Za-z0-9.-]+$","description":"Unique account code within the organization. May contain letters, numbers, periods, and dashes.","example":"90909"},"type":{"type":"string","description":"Top-level accounting classification. Must be compatible with subtype.\nAllowed values: ASSET, LIABILITY, EQUITY, EXPENSE, INCOME.\n","enum":["ASSET","LIABILITY","EQUITY","EXPENSE","INCOME"]},"subtype":{"type":"string","description":"Accounting subtype. The following exact values are accepted and must be paired with the indicated type:\n\nASSET: `Accounts Receivable`, `Fixed Assets`, `Accumulated Depreciation`, `Other Current Asset`, `Bank`,\n`Allowance for Doubtful Accounts`, `Unbilled Revenue`, `Prepaid Expense`, `Deferred Commissions`,\n`Right of Use Asset`, `Other Assets`, `Restricted Cash`.\n\nLIABILITY: `Other Current Liability`, `Other Long Term Liability`, `Accounts Payable`, `Credit Card`,\n`Deferred Revenue`, `Accrued Expense`, `Sales Tax Liability`, `Debt`, `Lease Liability`, `Customer Deposits`,\n`Customer Credit`.\n\nEQUITY: `Equity`, `Equity, Compensation`, `Additional Paid In Capital`,\n`Accumulated Other Comprehensive Income`, `Retained Earnings`.\n\nEXPENSE: `Cost of Goods Sold`, `Operating Expense`, `Operating Expense - Personnel`,\n`Operating Expense - Office Expenses`, `Operating Expense - Sales & Marketing`,\n`Operating Expense - Commissions`, `Operating Expense - Research & Development`,\n`Non Operating Expense`, `Non Operating Income`.\n\nINCOME: `Revenue`.\n","enum":["Revenue","Cost of Goods Sold","Operating Expense","Equity","Equity, Compensation","Other Current Liability","Other Long Term Liability","Accounts Payable","Accounts Receivable","Credit Card","Fixed Assets","Accumulated Depreciation","Other Current Asset","Bank","Allowance for Doubtful Accounts","Unbilled Revenue","Deferred Revenue","Prepaid Expense","Deferred Commissions","Right of Use Asset","Other Assets","Restricted Cash","Accrued Expense","Sales Tax Liability","Debt","Lease Liability","Customer Deposits","Customer Credit","Additional Paid In Capital","Accumulated Other Comprehensive Income","Retained Earnings","Operating Expense - Personnel","Operating Expense - Office Expenses","Operating Expense - Sales & Marketing","Operating Expense - Commissions","Operating Expense - Research & Development","Non Operating Expense","Non Operating Income"]},"intercompany":{"type":"boolean","description":"Whether the account is used for intercompany accounting.","example":false}}},"Account":{"type":"object","required":["id","code","name","type","subtype","status","intercompany","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"code":{"$ref":"#/components/schemas/AccountCode"},"name":{"type":"string","example":"Mercury Savings"},"type":{"type":"string","enum":["ASSET","LIABILITY","EQUITY","EXPENSE","INCOME"]},"subtype":{"type":"string","example":"Bank"},"status":{"type":"string","enum":["ACTIVE","INACTIVE"]},"intercompany":{"type":"boolean","example":false},"updated_at":{"type":"string","format":"date-time","description":"ISO 8601 timestamp in UTC timezone (must end with 'Z')"}}},"TaxRateResource":{"type":"object","required":["id","code","country","description","percentage"],"properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string","example":"IE_STANDARD"},"country":{"$ref":"#/components/schemas/CountryCode"},"description":{"type":"string","example":"Standard Rate"},"percentage":{"type":"string","example":"23.0000"}}},"BankAccount":{"type":"object","required":["id","name","currency","bank_name","status"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","description":"The bank account name"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"bank_name":{"type":"string"},"subsidiary_id":{"type":"string","format":"uuid"},"account_code":{"type":"string","description":"The account code found in the Chart of Accounts"},"mask":{"type":"string","description":"Last digits of the bank account number"},"transactions_start_date":{"type":"string","format":"date","nullable":true,"description":"The earliest date from which bank transactions are tracked for this account. Omitted for pre-existing accounts that have no recorded start date."},"status":{"$ref":"#/components/schemas/BankAccountStatus"}}},"BankAccountStatus":{"type":"string","enum":["ACTIVE","INACTIVE"]},"CreateBankAccountRequest":{"type":"object","required":["name","currency","bank_name","subsidiary_id","account_code"],"properties":{"name":{"type":"string","description":"The bank account name"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"bank_name":{"type":"string"},"subsidiary_id":{"type":"string","format":"uuid"},"account_code":{"type":"string","description":"The account code found in the Chart of Accounts"},"mask":{"type":"string","description":"Last digits of the bank account number"},"transactions_start_date":{"type":"string","format":"date","description":"The earliest date from which bank transactions are tracked for this account. Defaults to the date of creation when omitted."}}},"BankTransaction":{"type":"object","required":["id","bank_account_id","subsidiary_id","date","name","merchant","net_amount","fee","pending","excluded"],"properties":{"id":{"type":"string","format":"uuid"},"bank_account_id":{"type":"string","format":"uuid"},"subsidiary_id":{"type":"string","format":"uuid"},"date":{"type":"string","format":"date"},"name":{"type":"string","description":"Transaction description"},"merchant":{"type":"string","description":"Merchant or counterparty name"},"net_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount","description":"Transaction amount with fees subtracted"},"fee":{"$ref":"#/components/schemas/RoundedMonetaryAmount","description":"Fee amount"},"pending":{"type":"boolean","description":"Whether the transaction is still pending"},"excluded":{"type":"boolean","description":"Whether the transaction is excluded from reconciliation"},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}}}},"CreateBankTransactionRequest":{"type":"object","required":["bank_account_id","date","name","merchant","net_amount"],"properties":{"bank_account_id":{"type":"string","format":"uuid"},"date":{"type":"string","format":"date"},"name":{"type":"string","description":"Transaction description"},"merchant":{"type":"string","description":"Merchant or counterparty name"},"net_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount","description":"Transaction amount with fees subtracted"},"fee":{"$ref":"#/components/schemas/RoundedMonetaryAmount","description":"Fee amount. Defaults to zero in the currency of net_amount."},"pending":{"type":"boolean","description":"Whether the transaction is still pending","default":false},"excluded":{"type":"boolean","description":"Whether the transaction is excluded from reconciliation","default":false},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}}}},"UpdateBankTransactionRequest":{"type":"object","required":["bank_account_id","date","name","merchant","net_amount"],"properties":{"date":{"type":"string","format":"date"},"name":{"type":"string","description":"Transaction description"},"merchant":{"type":"string","description":"Merchant or counterparty name"},"net_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount","description":"Transaction amount with fees subtracted"},"fee":{"$ref":"#/components/schemas/RoundedMonetaryAmount","description":"Fee amount"},"pending":{"type":"boolean","description":"Whether the transaction is still pending"},"excluded":{"type":"boolean","description":"Whether the transaction is excluded from reconciliation"},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}}}},"Subsidiary":{"type":"object","required":["id","currency","timezone","trade_name","type"],"properties":{"id":{"type":"string","format":"uuid"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"timezone":{"type":"string","example":"America/New_York"},"trade_name":{"type":"string","example":"Rillet Inc."},"type":{"type":"string","enum":["LEGAL_ENTITY"]}}},"Organization":{"type":"object","required":["id","currency","timezone","trade_name"],"properties":{"id":{"type":"string","format":"uuid"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"timezone":{"type":"string","example":"America/New_York"},"trade_name":{"type":"string","example":"Rillet Inc."}}},"ProductRequest":{"type":"object","required":["description","include_in_arr_mrr","name","price","revenue_pattern","account_code"],"properties":{"name":{"maxLength":250,"minLength":1,"type":"string","example":"English subscription"},"description":{"type":"string","example":"Subscription to english classes"},"price":{"$ref":"#/components/schemas/Price"},"include_in_arr_mrr":{"type":"boolean"},"revenue_pattern":{"$ref":"#/components/schemas/RevenuePattern"},"account_code":{"$ref":"#/components/schemas/AccountCode"},"status":{"type":"string","default":"ACTIVE","enum":["ACTIVE","INACTIVE"]},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}}}},"CustomerRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string","example":"Bob"},"name_on_invoice":{"type":"string","example":"Bob Johnson"},"address":{"$ref":"#/components/schemas/Address"},"shipping_address":{"$ref":"#/components/schemas/Address"},"emails":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/CustomerEmail"}},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"payment_terms":{"type":"integer","format":"int32","minimum":0,"example":0},"send_invoices_automatically":{"type":"boolean","default":false,"description":"When set to true, invoices for this customer will be automatically sent via email on the invoice date."},"send_payment_reminders":{"type":"boolean","default":false,"description":"When set to true, an email will be sent to customers periodically if they have not paid an invoice."},"fields":{"allOf":[{"$ref":"#/components/schemas/FieldAssignments"}],"nullable":true}}},"PaymentSetupResponse":{"type":"object","required":["setup_url"],"properties":{"setup_url":{"type":"string","format":"uri","description":"URL to the payment setup portal"}}},"CustomerPaymentMethod":{"type":"object","required":["chargeable","payment_type"],"properties":{"last_four_digits":{"type":"string","description":"The last four digits of the payment method."},"chargeable":{"type":"boolean","description":"Whether the payment method can be used or not. If false, further action from the customer might be required."},"payment_type":{"type":"string","enum":["CARD","BANK_ACCOUNT","OTHER"]}}},"Discount":{"oneOf":[{"$ref":"#/components/schemas/AmountDiscount"},{"$ref":"#/components/schemas/PercentageDiscount"}],"discriminator":{"propertyName":"type","mapping":{"AMOUNT":"#/components/schemas/AmountDiscount","PERCENTAGE":"#/components/schemas/PercentageDiscount"}},"example":{"type":"AMOUNT","amount_off":{"amount":"10.00","currency":"USD"}}},"AmountDiscount":{"type":"object","required":["amount_off"],"properties":{"amount_off":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"type":{"type":"string","default":"AMOUNT"}}},"PercentageDiscount":{"type":"object","required":["percentage_off"],"properties":{"percentage_off":{"type":"number","format":"double","minimum":0,"maximum":100,"example":10},"type":{"type":"string","default":"PERCENTAGE"}}},"Invoicing":{"oneOf":[{"$ref":"#/components/schemas/MonthlyInvoicing"},{"$ref":"#/components/schemas/MonthlyProratedInvoicing"},{"$ref":"#/components/schemas/QuarterlyInvoicing"},{"$ref":"#/components/schemas/SemiAnnualInvoicing"},{"$ref":"#/components/schemas/YearlyInvoicing"}],"discriminator":{"propertyName":"interval","mapping":{"MONTHLY":"#/components/schemas/MonthlyInvoicing","MONTHLY_PRORATED":"#/components/schemas/MonthlyProratedInvoicing","QUARTERLY":"#/components/schemas/QuarterlyInvoicing","SEMI_ANNUAL":"#/components/schemas/SemiAnnualInvoicing","YEARLY":"#/components/schemas/YearlyInvoicing"}}},"MonthlyInvoicing":{"type":"object","required":["payment_terms","interval","day"],"properties":{"payment_terms":{"type":"integer","format":"int32","minimum":0,"example":0},"interval":{"type":"string","default":"MONTHLY"},"day":{"type":"integer","format":"int32","minimum":1,"maximum":31,"example":1}}},"MonthlyProratedInvoicing":{"type":"object","required":["payment_terms","interval","day"],"properties":{"payment_terms":{"type":"integer","format":"int32","minimum":0,"example":0},"interval":{"type":"string","default":"MONTHLY_PRORATED"},"day":{"type":"integer","format":"int32","minimum":1,"maximum":31,"example":1}},"description":"Monthly prorated invoicing is only available for contracts with usage products and a minimum usage commitment.\n"},"QuarterlyInvoicing":{"type":"object","required":["payment_terms","interval","month_day"],"properties":{"payment_terms":{"type":"integer","format":"int32","minimum":0,"example":0},"interval":{"type":"string","default":"QUARTERLY"},"month_day":{"type":"string","pattern":"^--\\d{2}-\\d{2}$","description":"A string in --MM-dd format. Invoices will be created starting on that date and every 3 months.","example":"--01-01"}}},"SemiAnnualInvoicing":{"type":"object","required":["payment_terms","interval","month_day"],"properties":{"payment_terms":{"type":"integer","format":"int32","minimum":0,"example":0},"interval":{"type":"string","default":"SEMI_ANNUAL"},"month_day":{"type":"string","pattern":"^--\\d{2}-\\d{2}$","description":"A string in --MM-dd format. Invoices will be created starting on that date and every 6 months.","example":"--01-01"}}},"YearlyInvoicing":{"type":"object","required":["payment_terms","interval","month_day"],"properties":{"payment_terms":{"type":"integer","format":"int32","minimum":0,"example":0},"interval":{"type":"string","default":"YEARLY"},"month_day":{"type":"string","pattern":"^--\\d{2}-\\d{2}$","description":"A string in --MM-dd format","example":"--01-01"}}},"UsageInvoicingFrequency":{"type":"string","enum":["MONTHLY","QUARTERLY","SEMI_ANNUAL","YEARLY"]},"MinimumCommitmentInvoicingFrequency":{"type":"string","enum":["MONTHLY","MONTHLY_PRORATED","QUARTERLY","SEMI_ANNUAL","YEARLY"],"description":"MONTHLY_PRORATED is only available for CALENDAR usage invoice cycle. It need to be the same as contract level invoicing frequency."},"UsageInvoicing":{"type":"object","required":["frequency","payment_terms","invoice_date","cycle"],"properties":{"frequency":{"$ref":"#/components/schemas/UsageInvoicingFrequency"},"payment_terms":{"$ref":"#/components/schemas/PaymentTerms","description":"Should be the same across different invoicing objects."},"invoice_date":{"$ref":"#/components/schemas/UsageInvoiceDate"},"cycle":{"$ref":"#/components/schemas/UsageInvoiceCycle"}}},"MinimumCommitmentInvoicing":{"type":"object","required":["frequency","payment_terms"],"properties":{"frequency":{"$ref":"#/components/schemas/MinimumCommitmentInvoicingFrequency"},"payment_terms":{"$ref":"#/components/schemas/PaymentTerms","description":"Should be the same across different invoicing objects."}}},"OverageInvoicing":{"oneOf":[{"$ref":"#/components/schemas/OverageMonthlyInvoicing"},{"$ref":"#/components/schemas/OverageMonthlyProratedInvoicing"},{"$ref":"#/components/schemas/OverageQuarterlyInvoicing"},{"$ref":"#/components/schemas/OverageSemiAnnualInvoicing"},{"$ref":"#/components/schemas/OverageYearlyInvoicing"}],"discriminator":{"propertyName":"interval","mapping":{"MONTHLY":"#/components/schemas/OverageMonthlyInvoicing","MONTHLY_PRORATED":"#/components/schemas/OverageMonthlyProratedInvoicing","QUARTERLY":"#/components/schemas/OverageQuarterlyInvoicing","SEMI_ANNUAL":"#/components/schemas/OverageSemiAnnualInvoicing","YEARLY":"#/components/schemas/OverageYearlyInvoicing"}}},"OverageMonthlyInvoicing":{"type":"object","required":["payment_terms","interval"],"properties":{"payment_terms":{"type":"integer","format":"int32","minimum":0,"example":0},"interval":{"type":"string","default":"MONTHLY"}}},"OverageMonthlyProratedInvoicing":{"type":"object","required":["payment_terms","interval"],"properties":{"payment_terms":{"type":"integer","format":"int32","minimum":0,"example":0},"interval":{"type":"string","default":"MONTHLY_PRORATED"}},"description":"Monthly prorated invoicing is only available for contracts with usage products and a minimum usage commitment.\n"},"OverageQuarterlyInvoicing":{"type":"object","required":["payment_terms","interval"],"properties":{"payment_terms":{"type":"integer","format":"int32","minimum":0,"example":0},"interval":{"type":"string","default":"QUARTERLY"}}},"OverageSemiAnnualInvoicing":{"type":"object","required":["payment_terms","interval"],"properties":{"payment_terms":{"type":"integer","format":"int32","minimum":0,"example":0},"interval":{"type":"string","default":"SEMI_ANNUAL"}}},"OverageYearlyInvoicing":{"type":"object","required":["payment_terms","interval"],"properties":{"payment_terms":{"type":"integer","format":"int32","minimum":0,"example":0},"interval":{"type":"string","default":"YEARLY"}}},"ContractItemRequest":{"type":"object","required":["price","product_id","quantity","revenue_pattern"],"properties":{"product_id":{"type":"string","format":"uuid"},"price":{"$ref":"#/components/schemas/Price"},"quantity":{"type":"number","minimum":1,"example":1,"description":"Must be 1 for USAGE prices."},"revenue_pattern":{"$ref":"#/components/schemas/RevenuePattern"},"discount":{"$ref":"#/components/schemas/Discount","description":"Optional discount for contracts that do not have REVENUE_RECOGNITION_ONLY scope."},"tax_rate":{"$ref":"#/components/schemas/TaxRateWithOptionalAmount"},"start_date":{"type":"string","format":"date","description":"Defaults to the contract start date."},"end_date":{"type":"string","format":"date","description":"Defaults to the contract end date."},"external_reference":{"$ref":"#/components/schemas/ExternalReference","description":"A unique ID per contract item, used on the invoice schedule to refer to the contract item."},"fields":{"$ref":"#/components/schemas/FieldAssignments"},"usage_minimum_commitment":{"$ref":"#/components/schemas/UsageCommitment","description":"Usage Minimum commitment for this contract item. Should be skipped if price is not USAGE or minimum commitment is defined at contract level."},"description":{"type":"string","description":"Overrides the product description on invoice lines generated for this item. Use it when the same product needs different wording per contract. When omitted or blank, the product's own description is used.\n"}}},"RevenueRecognitionOnlyContractItemRequest":{"type":"object","required":["price","product_id","revenue_pattern","external_reference"],"properties":{"product_id":{"type":"string","format":"uuid"},"price":{"$ref":"#/components/schemas/MonetaryAmount"},"discount":{"$ref":"#/components/schemas/Discount"},"revenue_pattern":{"$ref":"#/components/schemas/RevenuePattern"},"start_date":{"type":"string","format":"date","description":"Defaults to the contract start date."},"end_date":{"type":"string","format":"date","description":"Defaults to the contract end date."},"external_reference":{"$ref":"#/components/schemas/ExternalReference","description":"A unique ID per contract item, used on the invoice schedule to refer to the contract item."}}},"ContractScope":{"type":"string","enum":["FULL","REVENUE_RECOGNITION_ONLY"],"description":"The \"FULL\" scope includes revenue recognition and invoicing handled in Rillet. With the \"REVENUE_RECOGNITION_ONLY\" scope, invoicing is handled outside Rillet."},"InvoiceScope":{"type":"string","enum":["FULL","REVENUE_RECOGNITION_ONLY"],"description":"The \"FULL\" scope includes revenue recognition and invoicing handled in Rillet. With the \"REVENUE_RECOGNITION_ONLY\" scope, invoicing is handled outside Rillet."},"UsageConfiguration":{"required":["usage_invoicing"],"properties":{"usage_invoicing":{"$ref":"#/components/schemas/UsageInvoicing"},"minimum_commitment_invoicing":{"$ref":"#/components/schemas/MinimumCommitmentInvoicing"},"minimum_commitment_cycle":{"type":"string","enum":["MONTHLY","CONTRACT"],"description":"Determines how often does the minimum commitment reset."},"contract_level_minimum_commitment":{"$ref":"#/components/schemas/UsageCommitment","description":"Minimum commitment that will be shared across all contract items with usage price."}}},"UsageInvoiceDate":{"type":"string","enum":["FIRST_DAY_OF_NEXT_CYCLE","LAST_DAY_OF_CURRENT_CYCLE"],"description":"When the usage invoice is created in relation to the usage cycle."},"UsageInvoiceCycle":{"type":"string","enum":["CALENDAR","SUBSCRIPTION_ANNIVERSARY"],"description":"When does the invoicing pricing cycle reset and results in an invoice. Calendar option is only allowed when usage invoice frequency is Monthly, and contract does not start on the 1st of the Month."},"CreateFullContractRequest":{"type":"object","required":["close_date","items","name","start_date","customer_id","scope"],"properties":{"name":{"type":"string","example":"New API Contract"},"close_date":{"type":"string","format":"date"},"start_date":{"type":"string","format":"date"},"end_date":{"type":"string","format":"date"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/ContractItemRequest"}},"invoicing":{"$ref":"#/components/schemas/Invoicing","description":"Mandatory for contracts with scope different than REVENUE_RECOGNITION_ONLY."},"usage_configuration":{"$ref":"#/components/schemas/UsageConfiguration","description":"Configuration for contracts with usage products."},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"customer_id":{"type":"string","format":"uuid"},"subsidiary_id":{"type":"string","format":"uuid"},"exchange_rate":{"$ref":"#/components/schemas/ExchangeRate","description":"Optional exchange rate for converting the contract currency to the subsidiary currency. If not provided and the contract currency differs from the subsidiary currency, a system default rate will be used."}}},"CreateRevenueRecognitionOnlyContractRequest":{"type":"object","required":["items","name","start_date","customer_id","invoice_schedule","external_references","scope"],"properties":{"name":{"type":"string","example":"New API Contract"},"close_date":{"type":"string","format":"date","description":"Defaults to the start date if not provided."},"start_date":{"type":"string","format":"date"},"end_date":{"type":"string","format":"date"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/RevenueRecognitionOnlyContractItemRequest"}},"invoice_schedule":{"$ref":"#/components/schemas/InvoiceSchedule"},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"customer_id":{"type":"string","format":"uuid"},"subsidiary_id":{"type":"string","format":"uuid"}}},"CreateContractRequest":{"type":"object","discriminator":{"propertyName":"scope","mapping":{"FULL":"#/components/schemas/CreateFullContractRequest","REVENUE_RECOGNITION_ONLY":"#/components/schemas/CreateRevenueRecognitionOnlyContractRequest"}},"oneOf":[{"$ref":"#/components/schemas/CreateFullContractRequest"},{"$ref":"#/components/schemas/CreateRevenueRecognitionOnlyContractRequest"}],"required":["scope"],"properties":{"scope":{"$ref":"#/components/schemas/ContractScope"}}},"UpdateContractRequest":{"type":"object","discriminator":{"propertyName":"scope","mapping":{"FULL":"#/components/schemas/UpdateFullContractRequest","REVENUE_RECOGNITION_ONLY":"#/components/schemas/UpdateRevenueRecognitionOnlyContractRequest"}},"oneOf":[{"$ref":"#/components/schemas/UpdateFullContractRequest"},{"$ref":"#/components/schemas/UpdateRevenueRecognitionOnlyContractRequest"}],"required":["scope"],"properties":{"scope":{"$ref":"#/components/schemas/ContractScope"}}},"UpdateFullContractRequest":{"type":"object","required":["close_date","items","name","start_date"],"properties":{"name":{"type":"string","example":"New API Contract"},"close_date":{"type":"string","format":"date"},"start_date":{"type":"string","format":"date"},"end_date":{"type":"string","format":"date"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/ContractItemRequest"}},"invoicing":{"$ref":"#/components/schemas/Invoicing","description":"Mandatory for contracts with scope different than REVENUE_RECOGNITION_ONLY."},"usage_overage_invoicing":{"$ref":"#/components/schemas/OverageInvoicing","description":"When set, allows the invoicing of usage overages at a separate frequency from the regular invoicing of the contract."},"usage_commitment":{"$ref":"#/components/schemas/UsageCommitment"},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}}}},"UpdateRevenueRecognitionOnlyContractRequest":{"type":"object","required":["items","name","start_date","invoice_schedule","external_references","scope"],"properties":{"name":{"type":"string","example":"New API Contract"},"close_date":{"type":"string","format":"date","description":"Defaults to the start date if not provided."},"start_date":{"type":"string","format":"date"},"end_date":{"type":"string","format":"date"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/RevenueRecognitionOnlyContractItemRequest"}},"invoice_schedule":{"$ref":"#/components/schemas/InvoiceSchedule"},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}}}},"EndOpenEndedContractRequest":{"type":"object","required":["end_date"],"properties":{"end_date":{"type":"string","format":"date"}}},"CreateDraftContractRequest":{"type":"object","required":["subsidiary_id","customer_id","name","amount","close_date","scope","items"],"properties":{"external_references":{"uniqueItems":true,"type":"array","description":"Cross-system identifiers for this draft contract. Each reference's `type` slug must already exist in\nthe org's external reference types (configurable in Rillet Settings).\n\n**Required for deduplication.** Re-posting with any matching `(type, id)` pair replaces the prior draft\nrecord. Draft contracts created without external_references are not deduplicated.\n","items":{"$ref":"#/components/schemas/ExternalReference"}},"subsidiary_id":{"type":"string","format":"uuid"},"customer_id":{"type":"string","format":"uuid","description":"Must reference a customer that already exists in Rillet. Use `POST /customers` first if needed."},"name":{"type":"string","example":"Acme Corp - Annual subscription"},"amount":{"$ref":"#/components/schemas/MonetaryAmount"},"close_date":{"type":"string","format":"date"},"start_date":{"type":"string","format":"date"},"end_date":{"type":"string","format":"date"},"scope":{"$ref":"#/components/schemas/ContractScope"},"items":{"type":"array","minItems":1,"description":"Contract line items. At least one item is required.","items":{"$ref":"#/components/schemas/DraftContractItemRequest"}}}},"DraftContractItemRequest":{"type":"object","required":["product_id","price","quantity"],"properties":{"product_id":{"type":"string","format":"uuid"},"price":{"$ref":"#/components/schemas/Price"},"quantity":{"type":"number","minimum":1,"example":1,"description":"Must be 1 for USAGE prices."},"discount":{"$ref":"#/components/schemas/Discount"},"start_date":{"type":"string","format":"date"},"end_date":{"type":"string","format":"date"}}},"DraftContract":{"type":"object","required":["id","subsidiary_id","customer_id","name","amount","close_date","items","external_references"],"properties":{"id":{"type":"string","format":"uuid"},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"subsidiary_id":{"type":"string","format":"uuid"},"customer_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"amount":{"$ref":"#/components/schemas/MonetaryAmount"},"close_date":{"type":"string","format":"date"},"start_date":{"type":"string","format":"date"},"end_date":{"type":"string","format":"date"},"scope":{"allOf":[{"$ref":"#/components/schemas/ContractScope"}],"nullable":true,"description":"The accounting scope. May be null for draft contracts imported from integrations whose internal scope (e.g.\nRillet-handles-revenue-recognition-only when an external billing system handles invoicing) is not expressible in the public API enum.\nPOST and PUT requests still require an explicit scope.\n"},"items":{"type":"array","items":{"$ref":"#/components/schemas/DraftContractItem"}}}},"DraftContractItem":{"type":"object","required":["id","product_id","price","quantity"],"properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"price":{"$ref":"#/components/schemas/Price"},"quantity":{"type":"string","format":"number"},"discount":{"$ref":"#/components/schemas/Discount"},"start_date":{"type":"string","format":"date"},"end_date":{"type":"string","format":"date"}}},"PreviewContractAmendmentRequest":{"type":"object","required":["items","invoicing","amendment_date"],"properties":{"amendment_date":{"type":"string","format":"date","description":"It cannot be earlier than the previous amendment date if the contract has already been amended."},"items":{"type":"array","minItems":0,"description":"List of new contract items and new versions of amended contract items. Existing contract items that do not appear in the list will remain unchanged.","items":{"$ref":"#/components/schemas/AmendFullContractItemRequest"}},"invoicing":{"$ref":"#/components/schemas/Invoicing","description":"Mandatory for contracts with scope different than REVENUE_RECOGNITION_ONLY."}}},"AmendmentEffectiveFrom":{"type":"string","enum":["AS_OF_AMENDMENT_DATE","END_OF_CURRENT_BILLING_CYCLE"],"description":"Defines when the amendment takes effect. - `AS_OF_AMENDMENT_DATE`: apply changes as of the amendment date - `END_OF_CURRENT_BILLING_CYCLE`: apply at the end of the current billing cycle\n"},"AmendContractRequest":{"type":"object","discriminator":{"propertyName":"scope","mapping":{"FULL":"#/components/schemas/AmendFullContractRequest","REVENUE_RECOGNITION_ONLY":"#/components/schemas/AmendRevenueRecognitionOnlyContractRequest"}},"oneOf":[{"$ref":"#/components/schemas/AmendFullContractRequest"},{"$ref":"#/components/schemas/AmendRevenueRecognitionOnlyContractRequest"}],"required":["scope"],"properties":{"scope":{"$ref":"#/components/schemas/ContractScope"}}},"AmendFullContractRequest":{"type":"object","required":["items","amendment_date","amendment_reason","invoicing"],"properties":{"amendment_date":{"type":"string","format":"date","description":"It cannot be earlier than the previous amendment date if the contract has already been amended."},"amendment_reason":{"type":"string","example":"Amendment requested by user"},"items":{"type":"array","minItems":0,"description":"List of new contract items and new versions of amended contract items. Existing contract items that do not appear in the list will remain unchanged.","items":{"$ref":"#/components/schemas/AmendFullContractItemRequest"}},"invoicing":{"$ref":"#/components/schemas/Invoicing","description":"Mandatory for contracts with scope different than REVENUE_RECOGNITION_ONLY."}}},"AmendRevenueRecognitionOnlyContractRequest":{"type":"object","required":["items","amendment_date","amendment_reason","invoice_schedule"],"properties":{"amendment_date":{"type":"string","format":"date","description":"It cannot be earlier than the previous amendment date if the contract has already been amended."},"amendment_reason":{"type":"string","example":"Amendment requested by user"},"items":{"type":"array","minItems":0,"description":"List of new contract items and new versions of amended contract items. \nExisting contract items that do not appear in the list will remain unchanged. \nIf you want to delete a contract item from the amendment date onwards, use the `TERMINATED_ITEM`.\"\n","items":{"type":"object","discriminator":{"propertyName":"type","mapping":{"NEW_ITEM":"#/components/schemas/RevenueRecognitionOnlyContractNewItemInAmendmentRequest","AMENDING_ITEM":"#/components/schemas/RevenueRecognitionOnlyContractAmendingItemRequest","TERMINATED_ITEM":"#/components/schemas/RevenueRecognitionOnlyContractTerminatedItemRequest"}},"oneOf":[{"$ref":"#/components/schemas/RevenueRecognitionOnlyContractNewItemInAmendmentRequest"},{"$ref":"#/components/schemas/RevenueRecognitionOnlyContractAmendingItemRequest"},{"$ref":"#/components/schemas/RevenueRecognitionOnlyContractTerminatedItemRequest"}],"required":["type"],"properties":{"type":{"type":"string"}}}},"invoice_schedule":{"$ref":"#/components/schemas/InvoiceSchedule"}}},"AmendFullContractItemRequest":{"type":"object","required":["price","product_id","quantity","revenue_pattern","start_date"],"properties":{"product_id":{"type":"string","format":"uuid"},"price":{"$ref":"#/components/schemas/Price"},"quantity":{"type":"number","minimum":1,"example":1,"description":"Must be 1 for USAGE prices."},"revenue_pattern":{"$ref":"#/components/schemas/RevenuePattern"},"discount":{"$ref":"#/components/schemas/Discount"},"tax_rate":{"$ref":"#/components/schemas/TaxRate"},"start_date":{"type":"string","format":"date","description":"Must be on or after the amendment date."},"end_date":{"type":"string","format":"date","description":"Defaults to the contract end date"},"effective_from":{"$ref":"#/components/schemas/AmendmentEffectiveFrom"},"amending":{"type":"string","format":"uuid","description":"Contract item ID that is being amended. If empty, a new item will be created."}}},"RevenueRecognitionOnlyContractAmendingItemRequest":{"type":"object","required":["price","amending_reference"],"properties":{"price":{"$ref":"#/components/schemas/MonetaryAmount"},"discount":{"$ref":"#/components/schemas/Discount"},"revenue_pattern":{"$ref":"#/components/schemas/RevenuePattern"},"amending_reference":{"type":"string","description":"External Reference of the contract item being amended."},"end_date":{"type":"string","format":"date","description":"New end date for the amended (continuing) item. If omitted, the item keeps its current end date. Must be on or after the amendment date."}}},"RevenueRecognitionOnlyContractTerminatedItemRequest":{"type":"object","required":["external_reference"],"properties":{"external_reference":{"type":"string","description":"External Reference of the contract item being terminated."},"end_date":{"type":"string","format":"date","description":"Date the item is terminated on. Revenue is recognized through this date. Must be on or after the amendment date. If omitted, the item is terminated as of the amendment date."}}},"RevenueRecognitionOnlyContractNewItemInAmendmentRequest":{"type":"object","required":["price","product_id","revenue_pattern","external_reference"],"properties":{"product_id":{"type":"string","format":"uuid"},"price":{"$ref":"#/components/schemas/MonetaryAmount"},"discount":{"$ref":"#/components/schemas/Discount"},"revenue_pattern":{"$ref":"#/components/schemas/RevenuePattern"},"start_date":{"type":"string","format":"date","description":"By default is the amendment date. If provided, the date has to be on or after the amendment date."},"end_date":{"type":"string","format":"date","description":"End date for the new item. If omitted, defaults to the contract end date. If provided, must be on or after the item's start date."},"external_reference":{"$ref":"#/components/schemas/ExternalReference","description":null}}},"Address":{"type":"object","required":["city","country","line1","state","zip_code"],"properties":{"line1":{"type":"string","example":"123 Main St"},"line2":{"type":"string","example":"Apt 4B"},"city":{"type":"string","example":"Nashville"},"state":{"type":"string","example":"TN","description":"State or province code (e.g. 'TN', 'CA' for US; 'ON' for Canada). Required when address is provided."},"zip_code":{"type":"string","example":"37201"},"country":{"$ref":"#/components/schemas/CountryCode"}}},"SetupUpAutoPaymentRequest":{"type":"object","optional":["subsidiary_id"],"properties":{"subsidiary_id":{"type":"string","format":"uuid"}}},"CustomerEmail":{"type":"object","required":["email","type"],"properties":{"email":{"type":"string","example":"bobjohnson@somedomain.com"},"type":{"type":"string","enum":["MAIN_SENDER","CC","BCC"]}}},"Customer":{"required":["id","name","updated_at"],"allOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"updated_at":{"type":"string","format":"date-time","description":"ISO 8601 timestamp in UTC timezone (must end with 'Z')"}}},{"$ref":"#/components/schemas/CustomerRequest"}]},"ExpandedContract":{"allOf":[{"$ref":"#/components/schemas/Contract"},{"type":"object","properties":{"invoices":{"type":"array","items":{"$ref":"#/components/schemas/ContractInvoice"}}}}]},"Contract":{"type":"object","required":["close_date","customer_id","id","invoicing","items","name","start_date","status","total_value","subsidiary_id"],"properties":{"id":{"type":"string","format":"uuid"},"customer_id":{"type":"string","format":"uuid"},"subsidiary_id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"New API Contract"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/ContractItem"}},"status":{"$ref":"#/components/schemas/ContractStatus"},"start_date":{"type":"string","format":"date"},"end_date":{"type":"string","format":"date"},"close_date":{"type":"string","format":"date"},"invoicing":{"$ref":"#/components/schemas/Invoicing","description":"Mandatory for contracts with scope different than REVENUE_RECOGNITION_ONLY."},"usage_configuration":{"$ref":"#/components/schemas/UsageConfiguration","description":"Configuration for contracts with usage products."},"total_value":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"exchange_rate":{"$ref":"#/components/schemas/ExchangeRate"}}},"WebhookContract":{"type":"object","required":["close_date","customer_id","id","invoicing","items","name","start_date","status","total_value","subsidiary_id"],"properties":{"id":{"type":"string","format":"uuid"},"customer_id":{"type":"string","format":"uuid"},"subsidiary_id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"New API Contract"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/WebhookContractItem"}},"status":{"$ref":"#/components/schemas/ContractStatus"},"start_date":{"type":"string","format":"date"},"end_date":{"type":"string","format":"date"},"close_date":{"type":"string","format":"date"},"invoicing":{"$ref":"#/components/schemas/Invoicing","description":"Mandatory for contracts with scope different than REVENUE_RECOGNITION_ONLY."},"usage_overage_invoicing":{"$ref":"#/components/schemas/OverageInvoicing","description":"When set, allows the invoicing of usage overages at a separate frequency from the regular invoicing of the contract."},"total_value":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"exchange_rate":{"$ref":"#/components/schemas/ExchangeRate"},"usage_commitment":{"$ref":"#/components/schemas/UsageCommitment"}}},"UsageCommitment":{"type":"object","required":["amount","revenue_account"],"properties":{"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"revenue_account":{"$ref":"#/components/schemas/AccountCode"}}},"ExchangeRate":{"type":"object","required":["base","date","rate","target"],"properties":{"base":{"$ref":"#/components/schemas/CurrencyCode"},"target":{"$ref":"#/components/schemas/CurrencyCode"},"rate":{"type":"string"},"date":{"type":"string","format":"date"}}},"ExternalReference":{"type":"object","required":["type","id"],"properties":{"type":{"type":"string","example":"xyzSystemId"},"id":{"type":"string","example":"234"},"url":{"type":"string","format":"uri","example":"https://xyzsystempage.com/ids/234"}},"description":"For requests, only pre-defined custom IDs are accepted. In responses, an object imported through an integration (e.g. Stripe) would return the provider's object ID."},"ContractItem":{"type":"object","required":["id","price","product_id","quantity","revenue_pattern","start_date","status","total_value","external_references"],"properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"price":{"$ref":"#/components/schemas/Price"},"quantity":{"type":"string","format":"number","minimum":1,"example":"1"},"total_value":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"revenue_pattern":{"$ref":"#/components/schemas/RevenuePattern"},"discount":{"$ref":"#/components/schemas/Discount"},"tax_rate":{"$ref":"#/components/schemas/TaxRate"},"start_date":{"type":"string","format":"date"},"end_date":{"type":"string","format":"date"},"status":{"type":"string","enum":["AMENDED","ACTIVE"]},"amending":{"type":"string","format":"uuid","description":"When set, references the item this item is amending."},"fields":{"$ref":"#/components/schemas/FieldAssignments"},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"usage_minimum_commitment":{"$ref":"#/components/schemas/UsageCommitment","description":"Usage Minimum commitment for this contract item."},"description":{"type":"string","description":"Overrides the product description on invoice lines generated for this item. Null when the product description is used."}}},"WebhookContractItem":{"type":"object","required":["id","price","product_id","quantity","revenue_pattern","start_date","status","total_value","external_references"],"properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"price":{"$ref":"#/components/schemas/Price"},"quantity":{"type":"string","format":"number","minimum":1,"example":"1"},"total_value":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"revenue_pattern":{"$ref":"#/components/schemas/RevenuePattern"},"discount":{"$ref":"#/components/schemas/Discount"},"tax_rate":{"$ref":"#/components/schemas/TaxRate"},"start_date":{"type":"string","format":"date"},"end_date":{"type":"string","format":"date"},"status":{"type":"string","enum":["AMENDED","ACTIVE"]},"amending":{"type":"string","format":"uuid","description":"When set, references the item this item is amending."},"fields":{"$ref":"#/components/schemas/FieldAssignments"},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}}}},"Usage":{"type":"object","required":["date","quantity"],"properties":{"date":{"type":"string","format":"date"},"quantity":{"type":"number","format":"float","minimum":0,"exclusiveMinimum":true,"example":1}}},"UsageRecords":{"type":"object","required":["usage"],"properties":{"usage":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/Usage"}}},"description":"Allows you to update multiple dates at once."},"ContractInvoice":{"type":"object","required":["id","invoice_number","invoice_date","due_date","status","total","taxed_amount","items","external_references"],"properties":{"id":{"type":"string","format":"uuid"},"invoice_number":{"type":"string","example":"INV01"},"invoice_date":{"type":"string","format":"date"},"due_date":{"type":"string","format":"date"},"status":{"$ref":"#/components/schemas/InvoiceStatus"},"total":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"taxed_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/InvoiceItem"}},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}}}},"Invoice":{"type":"object","required":["amount_due","customer_id","due_date","id","invoice_date","invoice_number","items","net_amount","overdue","payment_terms","status","subsidiary_id","subtotal","taxed_amount","total","total_discount","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"subsidiary_id":{"type":"string","format":"uuid"},"invoice_number":{"type":"string","example":"INV01"},"customer_id":{"type":"string","format":"uuid"},"contract_id":{"type":"string","format":"uuid"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/InvoiceItem"}},"due_date":{"type":"string","format":"date"},"invoice_date":{"type":"string","format":"date"},"address":{"$ref":"#/components/schemas/Address","description":"Sender address"},"customer_address":{"$ref":"#/components/schemas/Address"},"shipping_address":{"$ref":"#/components/schemas/Address"},"bank_account":{"$ref":"#/components/schemas/InvoicingBankAccount"},"status":{"$ref":"#/components/schemas/InvoiceStatus"},"net_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"amount_due":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"total":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"payment_terms":{"type":"integer","format":"int32","minimum":0,"example":0},"subtotal":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"total_discount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"purchase_order_number":{"type":"string","example":"1"},"exchange_rate":{"$ref":"#/components/schemas/ExchangeRate"},"taxed_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"memo":{"type":"string"},"overdue":{"type":"boolean"},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"updated_at":{"type":"string","format":"date-time","description":"ISO 8601 timestamp in UTC timezone (must end with 'Z')"},"sent_at":{"type":"string","format":"date-time","description":"ISO 8601 timestamp in UTC timezone (must end with 'Z') marking when the invoice was first sent to the customer\nfrom Rillet (either by a user action or by automation). Null if the invoice has never been sent from Rillet.\n"}}},"InvoiceItem":{"type":"object","required":["description","gross_rate","id","quantity","revenue","taxed_amount","total_amount","total_discount","product_id","external_references"],"properties":{"id":{"type":"string","format":"uuid"},"description":{"type":"string","example":"Description"},"revenue":{"$ref":"#/components/schemas/ItemRevenue"},"total_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"total_discount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"taxed_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"gross_rate":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"quantity":{"type":"string","format":"number","example":"1.0000"},"product_id":{"type":"string","format":"uuid"},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"fields":{"$ref":"#/components/schemas/FieldAssignments"}}},"InvoicePaymentRequest":{"type":"object","required":["amount","date","account_code"],"properties":{"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"date":{"type":"string","format":"date"},"account_code":{"$ref":"#/components/schemas/AccountCode"}}},"InvoicePayment":{"type":"object","required":["id","status","invoice_id","amount","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"enum":["SUCCESSFUL","FAILED","UNCLEARED"]},"invoice_id":{"type":"string","format":"uuid"},"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"date":{"type":"string","format":"date"},"account_code":{"$ref":"#/components/schemas/AccountCode"},"updated_at":{"type":"string","format":"date-time","description":"ISO 8601 timestamp in UTC timezone (must end with 'Z')"}}},"UpdateInvoiceSentStatusRequest":{"type":"object","required":["sent"],"properties":{"sent":{"type":"boolean"}}},"CreditMemo":{"type":"object","required":["address","applications","applied_amount","customer_id","id","credit_memo_date","credit_memo_number","items","net_amount","remaining_amount","status","subsidiary_id","taxed_amount","total","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"subsidiary_id":{"type":"string","format":"uuid"},"credit_memo_number":{"type":"string","example":"CM01"},"customer_id":{"type":"string","format":"uuid"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/CreditMemoItem"}},"credit_memo_date":{"type":"string","format":"date"},"address":{"$ref":"#/components/schemas/Address"},"status":{"enum":["UNAPPLIED","PARTIALLY_APPLIED","APPLIED","REFUNDED"]},"net_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"total":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"applied_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"remaining_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"applications":{"type":"array","items":{"$ref":"#/components/schemas/CreditMemoApplication"}},"exchange_rate":{"$ref":"#/components/schemas/ExchangeRate"},"taxed_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"updated_at":{"type":"string","format":"date-time","description":"ISO 8601 timestamp in UTC timezone (must end with 'Z')"}}},"CreditMemoItem":{"type":"object","required":["description","net_amount","id","quantity","revenue","total_amount","product_id"],"properties":{"id":{"type":"string","format":"uuid"},"description":{"type":"string","example":"Description"},"revenue":{"$ref":"#/components/schemas/ItemRevenue"},"total_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"taxed_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"net_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"quantity":{"type":"string","format":"number","example":"1.0000"},"product_id":{"type":"string","format":"uuid"},"fields":{"$ref":"#/components/schemas/FieldAssignments"}}},"ItemRevenue":{"type":"object","properties":{"period":{"$ref":"#/components/schemas/CalendarPeriod","description":"Represents the period in which the service was rendered. This period is used for revenue recognition – the revenue is spread over this period. If not provided, the period starts and ends on the invoice date."},"pattern":{"$ref":"#/components/schemas/RevenuePattern","description":"If not provided, the one from the product will be used."},"account_code":{"$ref":"#/components/schemas/AccountCode","description":"If not provided, the one from the product will be used."}}},"AccountCode":{"type":"string","description":"The account code found in the Chart of Accounts","example":"11112"},"CalendarPeriod":{"type":"object","required":["end","start"],"properties":{"start":{"type":"string","format":"date"},"end":{"type":"string","format":"date"}}},"InvoicingBankAccount":{"type":"object","required":["id","ach_account","ach_routing","bank_name"],"properties":{"id":{"type":"string","format":"uuid"},"ach_account":{"type":"string"},"ach_routing":{"type":"string"},"bank_name":{"type":"string"},"bank_address":{"type":"string"},"swift_code":{"type":"string"},"payment_instructions":{"type":"string"}}},"JournalEntryRelatedEntity":{"type":"object","required":["id","type"],"properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["CUSTOMER","VENDOR"]}}},"JournalEntry":{"type":"object","required":["id","date","name","currency","items","updated_at","book_id"],"properties":{"id":{"type":"string","format":"uuid"},"book_id":{"type":"string","format":"uuid"},"subsidiary_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"related_entity":{"$ref":"#/components/schemas/JournalEntryRelatedEntity"},"items":{"type":"array","minItems":2,"items":{"$ref":"#/components/schemas/JournalEntryItem"}},"date":{"type":"string","format":"date","description":"The date this journal entry was posted to the general ledger."},"reversal_date":{"type":"string","format":"date"},"attachmentUrl":{"type":"string","format":"uri"},"exchange_rate":{"$ref":"#/components/schemas/ExchangeRate"},"updated_at":{"type":"string","format":"date-time","description":"ISO 8601 timestamp in UTC timezone (must end with 'Z')"}}},"JournalEntryWebhook":{"type":"object","required":["id","date","name","currency","items","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"subsidiary_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"related_entity":{"$ref":"#/components/schemas/JournalEntryRelatedEntity"},"items":{"type":"array","minItems":2,"items":{"$ref":"#/components/schemas/JournalEntryItem"}},"date":{"type":"string","format":"date","description":"The date this journal entry was posted to the general ledger."},"reversal_date":{"type":"string","format":"date"},"attachmentUrl":{"type":"string","format":"uri"},"exchange_rate":{"$ref":"#/components/schemas/ExchangeRate"},"updated_at":{"type":"string","format":"date-time","description":"ISO 8601 timestamp in UTC timezone (must end with 'Z')"}}},"JournalEntryItem":{"type":"object","required":["id","amount","account_id","account_code","side"],"properties":{"id":{"type":"string","format":"uuid"},"description":{"type":"string"},"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"original_transaction_amount":{"allOf":[{"$ref":"#/components/schemas/RoundedMonetaryAmount"}],"nullable":true,"description":"The line amount in its original transaction currency, when the line was booked in a currency other than the entry currency. Null otherwise."},"account_id":{"type":"string","format":"uuid","description":"Immutable account identifier."},"account_code":{"$ref":"#/components/schemas/AccountCode"},"side":{"type":"string","enum":["DEBIT","CREDIT"]},"fields":{"$ref":"#/components/schemas/FieldAssignments"}}},"ReportingJournalEntry":{"type":"object","required":["id","book_id","date","name","items","subsidiary_id"],"properties":{"id":{"type":"string","format":"uuid"},"book_id":{"type":"string","format":"uuid"},"subsidiary_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"related_entity":{"$ref":"#/components/schemas/JournalEntryRelatedEntity"},"items":{"type":"array","minItems":2,"items":{"$ref":"#/components/schemas/ReportingJournalEntryItem"}},"date":{"type":"string","format":"date"},"reversal_date":{"type":"string","format":"date"},"attachmentUrl":{"type":"string","format":"uri"}}},"ReportingJournalEntryItem":{"type":"object","required":["id","local_amount","reporting_amount","account_id","account_code","side"],"properties":{"id":{"type":"string","format":"uuid"},"description":{"type":"string"},"local_amount":{"$ref":"#/components/schemas/MonetaryAmount"},"reporting_amount":{"$ref":"#/components/schemas/MonetaryAmount"},"original_transaction_amount":{"allOf":[{"$ref":"#/components/schemas/MonetaryAmount"}],"nullable":true,"description":"The line amount in its original transaction currency, when the line was booked in a currency other than the entry currency. Null otherwise."},"exchange_rate":{"type":"string","description":"The exchange rate used to convert the amount to reporting currency"},"account_id":{"type":"string","format":"uuid","description":"Immutable account identifier."},"account_code":{"$ref":"#/components/schemas/AccountCode"},"side":{"type":"string","enum":["DEBIT","CREDIT"]},"fields":{"$ref":"#/components/schemas/FieldAssignments"}}},"JournalEntryItemRequest":{"type":"object","required":["amount","account_code","side"],"properties":{"description":{"type":"string"},"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"account_code":{"$ref":"#/components/schemas/AccountCode"},"side":{"type":"string","enum":["DEBIT","CREDIT"]},"fields":{"$ref":"#/components/schemas/FieldAssignments"},"vat_code":{"type":"string","description":"Code or description of an existing VAT rate for the journal entry subsidiary's country. When provided, vat_type is required. VAT is always treated as inclusive."},"vat_type":{"type":"string","description":"VAT reporting type for this journal entry line. Required when vat_code is provided. Accepts Revenue, Revenues, Expense, or Expenses case-insensitively."}}},"CreateJournalEntryRequest":{"allOf":[{"$ref":"#/components/schemas/UpdateJournalEntryRequest"},{"type":"object","required":["date","name","currency","items"],"properties":{"subsidiary_id":{"type":"string","format":"uuid"},"related_entity":{"$ref":"#/components/schemas/JournalEntryRelatedEntity"},"book_id":{"type":"string","format":"uuid"}}}]},"UpdateJournalEntryRequest":{"type":"object","required":["date","name","currency","items"],"properties":{"name":{"type":"string"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"items":{"type":"array","minItems":2,"items":{"$ref":"#/components/schemas/JournalEntryItemRequest"}},"date":{"type":"string","format":"date"},"reversal_date":{"type":"string","format":"date"},"attachmentUrl":{"type":"string","format":"uri"},"exchange_rate":{"$ref":"#/components/schemas/ExchangeRate"}}},"CreateFullInvoiceItemRequest":{"type":"object","required":["description","price"],"properties":{"description":{"type":"string"},"price":{"$ref":"#/components/schemas/InvoiceItemPriceRequest"},"revenue":{"$ref":"#/components/schemas/ItemRevenue"},"tax_rate":{"$ref":"#/components/schemas/TaxRateWithOptionalAmountAndCode"},"fields":{"$ref":"#/components/schemas/FieldAssignments"}}},"UpdateItemTaxesRequest":{"type":"object","required":["id","tax_rate"],"properties":{"id":{"type":"string","format":"uuid"},"tax_rates":{"type":"array","items":{"$ref":"#/components/schemas/TaxRate"}}}},"CreateCreditMemoItemRequest":{"type":"object","required":["description","price"],"properties":{"description":{"type":"string"},"price":{"$ref":"#/components/schemas/CreditMemoItemPriceRequest"},"revenue":{"$ref":"#/components/schemas/ItemRevenue"},"tax_rate":{"$ref":"#/components/schemas/TaxRateWithOptionalAmountAndCode"},"fields":{"$ref":"#/components/schemas/FieldAssignments"}}},"InvoiceItemPriceRequest":{"type":"object","required":["product_id","quantity","amount_per_unit"],"properties":{"product_id":{"type":"string","format":"uuid"},"quantity":{"type":"number"},"discount":{"$ref":"#/components/schemas/Discount"},"amount_per_unit":{"$ref":"#/components/schemas/MonetaryAmount","description":"This amount shows up a *rate* on the invoice, after applying the discount."}}},"CreditMemoItemPriceRequest":{"type":"object","required":["product_id","quantity","amount_per_unit"],"properties":{"product_id":{"type":"string","format":"uuid"},"quantity":{"type":"number","minimum":0},"amount_per_unit":{"$ref":"#/components/schemas/MonetaryAmount","description":"This amount shows up a *rate* on the credit memo, after applying the discount."}}},"UpdateInvoiceRequest":{"type":"object","discriminator":{"propertyName":"scope","mapping":{"FULL":"#/components/schemas/UpdateFullInvoiceRequest","REVENUE_RECOGNITION_ONLY":"#/components/schemas/UpdateRevenueRecognitionOnlyInvoiceRequest"}},"oneOf":[{"$ref":"#/components/schemas/UpdateFullInvoiceRequest"},{"$ref":"#/components/schemas/UpdateRevenueRecognitionOnlyInvoiceRequest"}]},"UpdateFullInvoiceRequest":{"type":"object","required":["invoice_date","items","bank_account_id"],"properties":{"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/CreateFullInvoiceItemRequest"}},"due_date":{"type":"string","format":"date","description":"If not provided, defaults to the invoice date."},"invoice_date":{"type":"string","format":"date"},"purchase_order_number":{"type":"string","example":"1"},"memo":{"type":"string"},"bank_account_id":{"type":"string","format":"uuid","description":"The ID for the bank account that should be shown on the invoice. You can also find the ID in the Rillet UI at /settings/bank-accounts."},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"scope":{"type":"string","default":"FULL"}}},"UpdateRevenueRecognitionOnlyInvoiceRequest":{"type":"object","required":["invoice_date","items"],"properties":{"invoice_date":{"type":"string","format":"date"},"due_date":{"type":"string","format":"date","description":"Defaults to invoice_date if not provided"},"invoice_number":{"type":"string","description":"Optional - updates the invoice number if provided"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/UpdateRevenueRecognitionOnlyInvoiceItemRequest"}},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"exchange_rate":{"$ref":"#/components/schemas/ExchangeRate"},"scope":{"type":"string","default":"REVENUE_RECOGNITION_ONLY"}}},"UpdateRevenueRecognitionOnlyInvoiceItemRequest":{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid","description":"The existing invoice item ID to update. Must match an item on the original invoice."},"description":{"type":"string"},"revenue":{"$ref":"#/components/schemas/ItemRevenue"},"fields":{"$ref":"#/components/schemas/FieldAssignments"}}},"CreateInvoiceRequest":{"type":"object","discriminator":{"propertyName":"scope","mapping":{"FULL":"#/components/schemas/CreateFullInvoiceRequest","REVENUE_RECOGNITION_ONLY":"#/components/schemas/CreateRevenueRecognitionOnlyInvoiceRequest","AR_ONLY":"#/components/schemas/CreateArOnlyInvoiceRequest"}},"oneOf":[{"$ref":"#/components/schemas/CreateFullInvoiceRequest"},{"$ref":"#/components/schemas/CreateRevenueRecognitionOnlyInvoiceRequest"},{"$ref":"#/components/schemas/CreateArOnlyInvoiceRequest"}]},"CreateFullInvoiceRequest":{"type":"object","required":["invoice_date","items","customer_id"],"properties":{"customer_id":{"type":"string","format":"uuid"},"subsidiary_id":{"type":"string","format":"uuid"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/CreateFullInvoiceItemRequest"}},"due_date":{"type":"string","format":"date","description":"If not provided, defaults to the invoice date."},"invoice_date":{"type":"string","format":"date"},"purchase_order_number":{"type":"string","example":"1"},"memo":{"type":"string"},"bank_account_id":{"type":"string","format":"uuid","description":"The ID for the bank account that, should be shown on the invoice. You can find the ID in the UI at /settings/bank-accounts."},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"exchange_rate":{"$ref":"#/components/schemas/ExchangeRate"},"scope":{"type":"string","default":"FULL"}}},"CreateRevenueRecognitionOnlyInvoiceRequest":{"type":"object","required":["customer_id","invoice_date","invoice_number","items","external_references"],"properties":{"customer_id":{"type":"string","format":"uuid"},"due_date":{"type":"string","format":"date","description":"Defaults to invoice_date, if not provided"},"invoice_date":{"type":"string","format":"date"},"invoice_number":{"type":"string"},"tax_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/CreateRevenueRecognitionOnlyInvoiceItemRequest"}},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"subsidiary_id":{"type":"string","format":"uuid"},"exchange_rate":{"$ref":"#/components/schemas/ExchangeRate"},"scope":{"type":"string","default":"REVENUE_RECOGNITION_ONLY"}}},"CreateArOnlyInvoiceRequest":{"type":"object","required":["customer_id","invoice_date","invoice_number","items","external_references"],"properties":{"customer_id":{"type":"string","format":"uuid"},"due_date":{"type":"string","format":"date","description":"Defaults to invoice_date, if not provided"},"invoice_date":{"type":"string","format":"date"},"invoice_number":{"type":"string"},"tax_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/CreateRevenueRecognitionOnlyInvoiceItemRequest"}},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"subsidiary_id":{"type":"string","format":"uuid"},"scope":{"type":"string","default":"AR_ONLY"}}},"CreateRevenueRecognitionOnlyInvoiceItemRequest":{"type":"object","required":["product_id","description","quantity","total_amount","external_references"],"properties":{"product_id":{"type":"string","format":"uuid"},"description":{"type":"string"},"quantity":{"type":"number","minimum":0.00001},"total_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"tax_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"revenue":{"$ref":"#/components/schemas/ItemRevenue"},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"fields":{"$ref":"#/components/schemas/FieldAssignments"}}},"UpdateTaxesRequest":{"type":"object","required":["taxes_calculated_at","items"],"properties":{"taxes_calculated_at":{"type":"string","format":"date-time","description":"ISO 8601 timestamp in UTC timezone (must end with 'Z')"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/UpdateItemTaxesRequest"}}}},"CommitInvoiceTaxesRequest":{"type":"object","required":["invoice_ids"],"properties":{"invoice_ids":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid"}}}},"UpdateCreditMemoRequest":{"type":"object","required":["credit_memo_date","items"],"properties":{"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/CreateCreditMemoItemRequest"}},"credit_memo_date":{"type":"string","format":"date"},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}}}},"CreateCreditMemoRequest":{"type":"object","required":["credit_memo_date","items","customer_id"],"properties":{"credit_memo_number":{"type":"string","pattern":"\\S+"},"customer_id":{"type":"string","format":"uuid"},"subsidiary_id":{"type":"string","format":"uuid"},"credit_memo_date":{"type":"string","format":"date"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/CreateCreditMemoItemRequest"}},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"exchange_rate":{"$ref":"#/components/schemas/ExchangeRate"}}},"ApplyCreditMemoRequest":{"type":"object","required":["applications"],"properties":{"applications":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/CreditMemoApplicationRequest"}}}},"CreditMemoApplicationRequest":{"type":"object","required":["invoice_id","amount","application_date"],"properties":{"invoice_id":{"type":"string","format":"uuid"},"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"application_date":{"type":"string","format":"date"}}},"CreditMemoApplication":{"type":"object","required":["id","credit_memo_id","invoice_id","amount","application_date"],"properties":{"id":{"type":"string","format":"uuid"},"credit_memo_id":{"type":"string","format":"uuid"},"invoice_id":{"type":"string","format":"uuid"},"invoice_number":{"type":"string"},"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"application_date":{"type":"string","format":"date"}}},"VendorRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string","example":"MyVendor"},"account_code":{"$ref":"#/components/schemas/AccountCode"},"address":{"$ref":"#/components/schemas/Address"},"email":{"type":"string","format":"email"},"payment_terms":{"type":"integer","format":"int32","minimum":0,"maximum":180},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"ten_ninety_nine_eligible":{"type":"boolean"},"tax_id":{"type":"string","example":"123"},"fields":{"$ref":"#/components/schemas/FieldAssignments"}}},"VendorResponse":{"allOf":[{"$ref":"#/components/schemas/VendorRequest"},{"type":"object","required":["id","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"updated_at":{"type":"string","format":"date-time"}}}]},"BaseVendorCreditRequest":{"type":"object","required":["credit_number","date","gl_impact_date","line_items"],"properties":{"credit_number":{"type":"string","example":"VC-001"},"date":{"type":"string","format":"date"},"gl_impact_date":{"type":"string","format":"date"},"memo":{"type":"string"},"line_items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/VendorCreditLineItemRequest"}}}},"CreateVendorCreditRequest":{"allOf":[{"$ref":"#/components/schemas/BaseVendorCreditRequest"},{"type":"object","required":["subsidiary_id","vendor_id"],"properties":{"vendor_id":{"type":"string","format":"uuid"},"subsidiary_id":{"type":"string","format":"uuid"}}}]},"UpdateVendorCreditRequest":{"allOf":[{"$ref":"#/components/schemas/BaseVendorCreditRequest"},{"type":"object","required":["vendor_id"],"properties":{"vendor_id":{"type":"string","format":"uuid"}}}]},"VendorCredit":{"allOf":[{"$ref":"#/components/schemas/CreateVendorCreditRequest"},{"type":"object","required":["id","organization_id","status","applied_amount","remaining_amount","applications","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"organization_id":{"type":"string","format":"uuid"},"status":{"$ref":"#/components/schemas/VendorCreditStatus"},"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"applied_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"remaining_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"line_items":{"type":"array","items":{"$ref":"#/components/schemas/VendorCreditLineItem"}},"applications":{"type":"array","items":{"$ref":"#/components/schemas/VendorCreditApplication"}},"updated_at":{"type":"string","format":"date-time","description":"Timestamp when the vendor credit was last modified"}}}]},"VendorCreditLineItemRequest":{"type":"object","required":["account_code","amount"],"properties":{"account_code":{"$ref":"#/components/schemas/AccountCode"},"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"description":{"type":"string"},"tax_rate":{"$ref":"#/components/schemas/ExpenseTaxRate"},"fields":{"$ref":"#/components/schemas/FieldAssignments"}}},"VendorCreditLineItem":{"allOf":[{"$ref":"#/components/schemas/VendorCreditLineItemRequest"},{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid"},"net_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"tax_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"}}}]},"VendorCreditStatus":{"type":"string","enum":["UNAPPLIED","PARTIALLY_APPLIED","REFUNDED","APPLIED"]},"ApplyVendorCreditRequest":{"type":"object","required":["applications"],"properties":{"applications":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/VendorCreditApplicationRequest"}}}},"VendorCreditApplicationRequest":{"type":"object","required":["bill_id","amount"],"properties":{"bill_id":{"type":"string","format":"uuid"},"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"}}},"VendorCreditApplication":{"type":"object","required":["id","vendor_credit_id","bill_id","amount","application_date"],"properties":{"id":{"type":"string","format":"uuid"},"vendor_credit_id":{"type":"string","format":"uuid"},"bill_id":{"type":"string","format":"uuid"},"bill_number":{"type":"string"},"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"application_date":{"type":"string","format":"date"}}},"CreateBillRequest":{"type":"object","required":["vendor_id","expense_number","items","bill_date","due_date"],"properties":{"vendor_id":{"type":"string","format":"uuid"},"expense_number":{"type":"string","example":"B123"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/BillItemRequest"}},"bill_date":{"type":"string","format":"date"},"due_date":{"type":"string","format":"date"},"impact_date":{"type":"string","format":"date"},"subsidiary_id":{"type":"string","format":"uuid"},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"exchange_rate":{"$ref":"#/components/schemas/ExchangeRate"}}},"UpdateBillRequest":{"type":"object","required":["vendor_id","expense_number","items","bill_date","due_date"],"properties":{"vendor_id":{"type":"string","format":"uuid"},"expense_number":{"type":"string","example":"B123"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/BillItemRequest"}},"bill_date":{"type":"string","format":"date"},"due_date":{"type":"string","format":"date"},"impact_date":{"type":"string","format":"date"},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"exchange_rate":{"$ref":"#/components/schemas/ExchangeRate"}}},"Bill":{"allOf":[{"$ref":"#/components/schemas/CreateBillRequest"},{"type":"object","required":["id","status","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"$ref":"#/components/schemas/BillStatus"},"updated_at":{"type":"string","format":"date-time","description":"Timestamp when the bill was last modified"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/BillItem"}}}}]},"BillItemRequest":{"type":"object","required":["account_code","amount"],"properties":{"description":{"type":"string","example":"API Bill"},"account_code":{"$ref":"#/components/schemas/AccountCode"},"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"tax_rate":{"$ref":"#/components/schemas/ExpenseTaxRate"},"service_period":{"$ref":"#/components/schemas/CalendarPeriod"},"fields":{"$ref":"#/components/schemas/FieldAssignments"}}},"BillItem":{"allOf":[{"$ref":"#/components/schemas/BillItemRequest"},{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid"}}}]},"BillPaymentRequest":{"type":"object","required":["amount","date","account_code"],"properties":{"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"date":{"type":"string","format":"date"},"account_code":{"$ref":"#/components/schemas/AccountCode"}}},"BillPayment":{"type":"object","required":["id","status","bill_id","amount"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"enum":["CLEARED","UNCLEARED"]},"bill_id":{"type":"string","format":"uuid"},"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"date":{"type":"string","format":"date"},"account_code":{"$ref":"#/components/schemas/AccountCode"}}},"ChargeRequest":{"type":"object","required":["vendor_id","items","charge_date","credit_card_account_code"],"properties":{"vendor_id":{"type":"string","format":"uuid"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/ChargeItemRequest"}},"charge_date":{"type":"string","format":"date"},"impact_date":{"type":"string","format":"date"},"credit_card_account_code":{"$ref":"#/components/schemas/AccountCode"},"subsidiary_id":{"type":"string","format":"uuid"},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"exchange_rate":{"$ref":"#/components/schemas/ExchangeRate"}}},"Charge":{"allOf":[{"$ref":"#/components/schemas/ChargeRequest"},{"type":"object","required":["id","status","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"$ref":"#/components/schemas/ChargeStatus"},"updated_at":{"type":"string","format":"date-time","description":"Timestamp when the charge was last modified"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/ChargeItem"}}}}]},"ChargeItemRequest":{"type":"object","required":["account_code","amount"],"properties":{"description":{"type":"string","example":"API Charge"},"account_code":{"$ref":"#/components/schemas/AccountCode"},"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"tax_rate":{"$ref":"#/components/schemas/ExpenseTaxRate"},"service_period":{"$ref":"#/components/schemas/CalendarPeriod"},"fields":{"$ref":"#/components/schemas/FieldAssignments"}}},"ChargeItem":{"allOf":[{"$ref":"#/components/schemas/ChargeItemRequest"},{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid"}}}]},"ChargePaymentRequest":{"type":"object","required":["charge_id","amount","date","account_code"],"properties":{"charge_id":{"type":"string","format":"uuid"},"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"date":{"type":"string","format":"date"},"account_code":{"$ref":"#/components/schemas/AccountCode"}}},"ChargePayment":{"type":"object","required":["id","status","expense_id","amount"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"enum":["CLEARED","UNCLEARED"]},"charge_id":{"type":"string","format":"uuid"},"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"date":{"type":"string","format":"date"},"account_code":{"$ref":"#/components/schemas/AccountCode"}}},"CreateReimbursementRequest":{"type":"object","required":["vendor_id","items","reimbursement_date","payable_account_code"],"properties":{"vendor_id":{"type":"string","format":"uuid"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/CreateReimbursementItemRequest"}},"reimbursement_date":{"type":"string","format":"date"},"payable_account_code":{"$ref":"#/components/schemas/AccountCode"},"impact_date":{"type":"string","format":"date","description":"GL impact date. Defaults to reimbursement_date if omitted."},"subsidiary_id":{"type":"string","format":"uuid"},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"exchange_rate":{"$ref":"#/components/schemas/ExchangeRate","description":"Optional exchange rate for converting the reimbursement currency to the subsidiary currency. All reimbursement items must use the same currency. If omitted, Rillet uses the exchange rate available for reimbursement_date. The request fails if no matching exchange rate is available."}}},"CreateReimbursementItemRequest":{"type":"object","required":["account_code","amount"],"properties":{"description":{"type":"string","example":"Travel reimbursement"},"account_code":{"$ref":"#/components/schemas/AccountCode"},"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"tax_rate":{"$ref":"#/components/schemas/ExpenseTaxRate"},"service_period":{"$ref":"#/components/schemas/CalendarPeriod"},"fields":{"$ref":"#/components/schemas/FieldAssignments"}}},"ReimbursementRequest":{"type":"object","required":["vendor_id","items","bill_date"],"properties":{"vendor_id":{"type":"string","format":"uuid"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/ReimbursementItemRequest"}},"reimbursement_date":{"type":"string","format":"date"},"impact_date":{"type":"string","format":"date"},"subsidiary_id":{"type":"string","format":"uuid"},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"exchange_rate":{"$ref":"#/components/schemas/ExchangeRate"}}},"Reimbursement":{"allOf":[{"$ref":"#/components/schemas/ReimbursementRequest"},{"type":"object","required":["id","status","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"$ref":"#/components/schemas/ReimbursementStatus"},"updated_at":{"type":"string","format":"date-time","description":"Timestamp when the reimbursement was last modified"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/ReimbursementItem"}}}}]},"ReimbursementItemRequest":{"type":"object","required":["account_code","amount"],"properties":{"description":{"type":"string","example":"API Reimbursement"},"account_code":{"$ref":"#/components/schemas/AccountCode"},"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"tax_rate":{"$ref":"#/components/schemas/ExpenseTaxRate"},"service_period":{"$ref":"#/components/schemas/CalendarPeriod"},"fields":{"$ref":"#/components/schemas/FieldAssignments"}}},"ReimbursementItem":{"allOf":[{"$ref":"#/components/schemas/ReimbursementItemRequest"},{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid"}}}]},"ReimbursementPaymentRequest":{"type":"object","required":["reimbursement_id","amount","date","account_code"],"properties":{"reimbursement_id":{"type":"string","format":"uuid"},"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"date":{"type":"string","format":"date"},"account_code":{"$ref":"#/components/schemas/AccountCode"}}},"ReimbursementPayment":{"type":"object","required":["id","status","expense_id","amount"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"enum":["CLEARED","UNCLEARED"]},"reimbursement_id":{"type":"string","format":"uuid"},"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"date":{"type":"string","format":"date"},"account_code":{"$ref":"#/components/schemas/AccountCode"}}},"BookKind":{"type":"string","enum":["PRIMARY","SECONDARY"]},"BookMode":{"type":"string","enum":["STANDALONE","ADJUSTMENT_OVERLAY"]},"LedgerBook":{"type":"object","required":["id","name","kind","mode"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"kind":{"$ref":"#/components/schemas/BookKind"},"mode":{"$ref":"#/components/schemas/BookMode"}}},"Book":{"type":"object","required":["id","start","end","status","closed_on"],"properties":{"id":{"type":"string","format":"uuid"},"start":{"type":"string","format":"date","description":"Book period start date (inclusive)","example":"2025-06-01"},"end":{"type":"string","format":"date","description":"Book period end date (inclusive)","example":"2025-06-30"},"status":{"enum":["OPEN","CLOSED"],"example":"CLOSED"},"closed_on":{"type":"string","format":"date","description":"Date on which book was closed","example":"2025-07-05"}}},"InvoiceSchedule":{"type":"object","properties":{"invoices":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceScheduleInvoice"}}}},"InvoiceScheduleInvoice":{"type":"object","required":["invoice_date","invoice_number","items","external_references"],"properties":{"due_date":{"type":"string","format":"date","description":"Defaults to invoice_date, if not provided"},"invoice_date":{"type":"string","format":"date"},"invoice_number":{"type":"string"},"tax_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/InvoiceScheduleInvoiceItem"}},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}}}},"InvoiceScheduleInvoiceItem":{"type":"object","required":["description","contract_item_reference","quantity","total_amount","external_references"],"properties":{"description":{"type":"string"},"contract_item_reference":{"type":"string","description":"Refers to the ID of the contract item's external_reference."},"quantity":{"type":"string","format":"number","minimum":0.00001},"total_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"tax_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"discount_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}}}},"FieldsResponse":{"type":"object","required":["fields"],"properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/Field"}}}},"CreateFieldRequest":{"type":"object","required":["name","values"],"properties":{"name":{"type":"string","description":"The name of the field."},"values":{"type":"array","items":{"$ref":"#/components/schemas/CreateFieldRequestValue"}}}},"CreateFieldRequestValue":{"type":"object","required":["name"],"properties":{"name":{"type":"string"}}},"UpdateFieldRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"settings":{"$ref":"#/components/schemas/FieldSettingsMap"}}},"CreateFieldValueRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string"}}},"UpdateFieldValueRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string"}}},"SetFieldValueDeactivatedRequest":{"type":"object","required":["deactivated"],"properties":{"deactivated":{"type":"boolean","description":"Whether the field value should be deactivated."}}},"FieldSettingsMap":{"type":"object","description":"The settings of the field. EXPENSES: Applies to Bills, Credit Card Transactions and Manual Entries. REVENUE: Applies to Customers, Contracts, Invoices and Credit Memos.","properties":{"EXPENSES":{"$ref":"#/components/schemas/FieldSettings"},"REVENUE":{"$ref":"#/components/schemas/FieldSettings"}}},"FieldSettings":{"type":"object","required":["mandatory","display"],"properties":{"mandatory":{"type":"boolean","description":"Whether the field is mandatory. A free tagging field cannot be mandatory."},"display":{"type":"string","description":"The display type of the field. STANDALONE: Field values are displayed separately as a single select option. Recommended for fields that apply to all transactions. FREE_TAG: Field values are grouped and displayed as multi-selectable tags. Recommended for fields that do not apply to all transactions.","enum":["STANDALONE","FREE_TAG"]}}},"Field":{"type":"object","required":["id","name","values","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","description":"The name of the field."},"values":{"type":"array","description":"All possible values for this field.","items":{"$ref":"#/components/schemas/FieldValue"}},"settings":{"$ref":"#/components/schemas/FieldSettingsMap"},"updated_at":{"type":"string","format":"date-time","description":"ISO 8601 timestamp in UTC timezone (must end with 'Z')"}}},"FieldValue":{"type":"object","required":["id","name","deactivated"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","description":"The name of the field value."},"deactivated":{"type":"boolean","description":"Whether the field value is deactivated. Deactivated values cannot be assigned to new entities but remain visible on existing entities."}}},"FieldAssignments":{"type":"array","items":{"type":"object","required":["field_id","field_value_id"],"properties":{"field_id":{"type":"string","format":"uuid"},"field_value_id":{"type":"string","format":"uuid"}}}},"ReportPeriod":{"type":"object","required":["from_date","to_date"],"properties":{"from_date":{"type":"string","format":"date","description":"Start date of the report period","example":"2024-01-01"},"to_date":{"type":"string","format":"date","description":"End date of the report period","example":"2024-01-31"}}},"ReportTotals":{"type":"object","required":["beginning_balance","debit_total","credit_total","ending_balance"],"properties":{"beginning_balance":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"debit_total":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"credit_total":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"debit_fx_total":{"$ref":"#/components/schemas/RoundedMonetaryAmount","description":"Foreign exchange adjustment for debits"},"credit_fx_total":{"$ref":"#/components/schemas/RoundedMonetaryAmount","description":"Foreign exchange adjustment for credits"},"ending_balance":{"$ref":"#/components/schemas/RoundedMonetaryAmount"}}},"ReportAccountBalance":{"type":"object","required":["id","code","name","beginning_balance","debit_total","credit_total","ending_balance"],"properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string","example":"1000"},"name":{"type":"string","example":"Cash"},"beginning_balance":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"debit_total":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"credit_total":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"debit_fx_total":{"$ref":"#/components/schemas/RoundedMonetaryAmount","description":"Foreign exchange adjustment for debits"},"credit_fx_total":{"$ref":"#/components/schemas/RoundedMonetaryAmount","description":"Foreign exchange adjustment for credits"},"ending_balance":{"$ref":"#/components/schemas/RoundedMonetaryAmount"}}},"TrialBalanceReport":{"type":"object","required":["period","currency","accounts","totals"],"properties":{"period":{"$ref":"#/components/schemas/ReportPeriod"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"accounts":{"type":"array","items":{"$ref":"#/components/schemas/ReportAccountBalance"}},"totals":{"$ref":"#/components/schemas/ReportTotals"}}},"ReportBreakdown":{"type":"object","description":"Describes a breakdown column in the report (subsidiary or custom field)","required":["type","name"],"properties":{"type":{"type":"string","enum":["SUBSIDIARY","CUSTOM_FIELD","PERIOD"],"description":"The type of breakdown"},"name":{"type":"string","description":"Display name for this breakdown column","example":"Acme Corp US"},"id":{"type":"string","format":"uuid","description":"The ID of the subsidiary or custom field value (if applicable)"}}},"BreakdownBalance":{"type":"object","required":["breakdown_id","amount"],"properties":{"breakdown_id":{"type":"string","format":"uuid","description":"The ID of the breakdown this balance belongs to"},"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"}}},"BreakdownMargin":{"type":"object","required":["breakdown_id","value"],"properties":{"breakdown_id":{"type":"string","format":"uuid","description":"The ID of the breakdown this margin belongs to"},"value":{"type":"number","format":"double","description":"Margin as a percentage (0.0 to 1.0)"}}},"ReportAccountEntry":{"type":"object","required":["id","code","name","balances"],"properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string","example":"1000"},"name":{"type":"string","example":"Cash"},"balances":{"type":"array","description":"Account balances, one per breakdown column.","items":{"$ref":"#/components/schemas/BreakdownBalance"}}}},"ReportAccountGroup":{"type":"object","required":["name","totals","accounts"],"properties":{"name":{"type":"string","example":"Current Assets"},"totals":{"type":"array","description":"Group totals, one per breakdown column.","items":{"$ref":"#/components/schemas/BreakdownBalance"}},"accounts":{"type":"array","items":{"$ref":"#/components/schemas/ReportAccountEntry"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/ReportAccountGroupNested"}}}},"ReportAccountGroupNested":{"type":"object","description":"Deepest level of account grouping returned by the API. Accounts belonging to more deeply nested account groups are included here, flattened into `accounts`.","required":["name","totals","accounts"],"properties":{"name":{"type":"string","example":"Current Assets"},"totals":{"type":"array","description":"Group totals, one per breakdown column.","items":{"$ref":"#/components/schemas/BreakdownBalance"}},"accounts":{"type":"array","description":"All accounts in this group, including accounts of more deeply nested account groups, sorted by account code.","items":{"$ref":"#/components/schemas/ReportAccountEntry"}}}},"ReportSection":{"type":"object","required":["total","groups"],"properties":{"total":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"groups":{"type":"array","items":{"$ref":"#/components/schemas/ReportAccountGroup"}}}},"NamedReportSection":{"type":"object","description":"A named section containing account groups with a total","required":["name","totals","groups"],"properties":{"name":{"type":"string","description":"The name of this section","example":"Assets"},"totals":{"type":"array","description":"Section totals, one per breakdown column.","items":{"$ref":"#/components/schemas/BreakdownBalance"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/ReportAccountGroup"}},"accounts":{"type":"array","items":{"$ref":"#/components/schemas/ReportAccountEntry"}}}},"NamedCashFlowSection":{"type":"object","description":"A named cash flow section containing line items with totals per breakdown","required":["name","totals","items"],"properties":{"name":{"type":"string","description":"The name of this section","example":"Operating Cash Flow"},"totals":{"type":"array","description":"Section totals, one per breakdown column.","items":{"$ref":"#/components/schemas/BreakdownBalance"}},"items":{"type":"array","items":{"$ref":"#/components/schemas/CashFlowItem"}}}},"NamedExecutivePLSection":{"type":"object","description":"A named executive P&L section containing line items with totals per breakdown","required":["name","totals","items"],"properties":{"name":{"type":"string","description":"The name of this section","example":"Revenue"},"totals":{"type":"array","description":"Section totals, one per breakdown column.","items":{"$ref":"#/components/schemas/BreakdownBalance"}},"items":{"type":"array","items":{"$ref":"#/components/schemas/ExecutivePLItem"}}}},"ReportSummaryLine":{"type":"object","description":"A named summary line item (e.g., gross profit, net income)","required":["name","amounts"],"properties":{"name":{"type":"string","description":"The name of this summary line","example":"Gross Profit"},"amounts":{"type":"array","description":"Summary amounts, one per breakdown column.","items":{"$ref":"#/components/schemas/BreakdownBalance"}},"margins":{"type":"array","description":"Optional margins as percentages (0.0 to 1.0), one per breakdown column.","items":{"$ref":"#/components/schemas/BreakdownMargin"}}}},"BalanceSheetReport":{"type":"object","required":["as_of_date","currency","sections"],"properties":{"as_of_date":{"type":"string","format":"date","description":"The date of the balance sheet","example":"2024-01-31"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"breakdowns":{"type":"array","description":"The breakdown columns for this report. When no breakdown_by is specified, this contains a single PERIOD entry representing the total.","items":{"$ref":"#/components/schemas/ReportBreakdown"}},"sections":{"type":"array","description":"The sections of the balance sheet (e.g., Assets, Liabilities, Equity)","items":{"$ref":"#/components/schemas/NamedReportSection"}}}},"IncomeStatementReport":{"type":"object","required":["period","currency","breakdowns","sections","summaries"],"properties":{"period":{"$ref":"#/components/schemas/ReportPeriod"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"breakdowns":{"type":"array","description":"The breakdown columns for this report. When no breakdown_by is specified, this contains a single PERIOD entry representing the total.","items":{"$ref":"#/components/schemas/ReportBreakdown"}},"sections":{"type":"array","description":"The sections of the income statement (e.g., Revenue, Cost of Goods Sold, Operating Expenses, Non-Operating)","items":{"$ref":"#/components/schemas/NamedReportSection"}},"summaries":{"type":"array","description":"Summary line items (e.g., Gross Profit, Net Income)","items":{"$ref":"#/components/schemas/ReportSummaryLine"}}}},"CashFlowItem":{"type":"object","required":["name","amounts"],"properties":{"name":{"type":"string","example":"Net Income"},"amounts":{"type":"array","description":"Amounts, one per breakdown column.","items":{"$ref":"#/components/schemas/BreakdownBalance"}}}},"CashFlowSection":{"type":"object","required":["totals","items"],"properties":{"totals":{"type":"array","description":"Section totals, one per breakdown column.","items":{"$ref":"#/components/schemas/BreakdownBalance"}},"items":{"type":"array","items":{"$ref":"#/components/schemas/CashFlowItem"}}}},"CashFlowStatementReport":{"type":"object","required":["period","currency","breakdowns","sections","summaries"],"properties":{"period":{"$ref":"#/components/schemas/ReportPeriod"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"breakdowns":{"type":"array","description":"The breakdown columns for this report. When no breakdown_by is specified, this contains a single PERIOD entry representing the total.","items":{"$ref":"#/components/schemas/ReportBreakdown"}},"sections":{"type":"array","description":"The sections of the cash flow statement (e.g., Operating Cash Flow, Investing Cash Flow, Financing Cash Flow)","items":{"$ref":"#/components/schemas/NamedCashFlowSection"}},"summaries":{"type":"array","description":"Summary line items (e.g., Net Change in Cash, Opening Balance, Closing Balance, FX Effect on Cash)","items":{"$ref":"#/components/schemas/CashFlowItem"}}}},"ExecutivePLItem":{"type":"object","required":["name","code","amounts"],"properties":{"name":{"type":"string","example":"Product Revenue"},"code":{"type":"string","example":"4210"},"amounts":{"type":"array","description":"Item amounts, one per breakdown column.","items":{"$ref":"#/components/schemas/BreakdownBalance"}}}},"ExecutivePLSection":{"type":"object","required":["total","items"],"properties":{"total":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"items":{"type":"array","items":{"$ref":"#/components/schemas/ExecutivePLItem"}}}},"ExecutivePLReport":{"type":"object","required":["period","currency","breakdowns","sections","summaries"],"properties":{"period":{"$ref":"#/components/schemas/ReportPeriod"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"breakdowns":{"type":"array","description":"The breakdown columns for this report. When no breakdown_by is specified, this contains a single PERIOD entry representing the total.","items":{"$ref":"#/components/schemas/ReportBreakdown"}},"sections":{"type":"array","description":"The sections of the executive P&L (e.g., Revenue, Cost of Goods Sold, Operating Expenses, Non-Operating)","items":{"$ref":"#/components/schemas/NamedExecutivePLSection"}},"summaries":{"type":"array","description":"Summary line items with optional margins (e.g., Gross Profit, Net Income)","items":{"$ref":"#/components/schemas/ReportSummaryLine"}}}},"WebhookResponse":{"description":"A placeholder indicating a response from a webhook. The contents of this response are ignored.","type":"string"},"PaymentTerms":{"type":"integer","format":"int32","minimum":0,"example":0}}},"webhooks":{"invoice-created":{"post":{"tags":["Webhooks"],"x-blank-ext":"No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175","operationId":"invoice-created-webhook","description":"Webhook to notify when an invoice is created.\n","parameters":[{"$ref":"#/components/parameters/X-Rillet-Signature"},{"$ref":"#/components/parameters/X-Rillet-Timestamp"},{"$ref":"#/components/parameters/X-Rillet-Id"},{"$ref":"#/components/parameters/X-Rillet-Entity","schema":{"type":"string","enum":["INVOICE"]}},{"$ref":"#/components/parameters/X-Rillet-Event","schema":{"type":"string","enum":["CREATED"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}},"required":true},"responses":{"200":{"description":"No Content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}}}}},"invoice-updated":{"post":{"tags":["Webhooks"],"x-blank-ext":"No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175","operationId":"invoice-updated-webhook","description":"Webhook to notify when an invoice is updated.\n","parameters":[{"$ref":"#/components/parameters/X-Rillet-Signature"},{"$ref":"#/components/parameters/X-Rillet-Timestamp"},{"$ref":"#/components/parameters/X-Rillet-Id"},{"$ref":"#/components/parameters/X-Rillet-Entity","schema":{"type":"string","enum":["INVOICE"]}},{"$ref":"#/components/parameters/X-Rillet-Event","schema":{"type":"string","enum":["UPDATED"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}}}}},"invoice-payment-updated":{"post":{"tags":["Webhooks"],"x-blank-ext":"No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175","operationId":"invoice-payment-updated-webhook","description":"Webhook to notify when an invoice is updated.\n","parameters":[{"$ref":"#/components/parameters/X-Rillet-Signature"},{"$ref":"#/components/parameters/X-Rillet-Timestamp"},{"$ref":"#/components/parameters/X-Rillet-Id"},{"$ref":"#/components/parameters/X-Rillet-Entity","schema":{"type":"string","enum":["INVOICE"]}},{"$ref":"#/components/parameters/X-Rillet-Event","schema":{"type":"string","enum":["PAYMENT_UPDATED"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}}}}},"invoice-deleted":{"post":{"tags":["Webhooks"],"x-blank-ext":"No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175","operationId":"invoice-deleted-webhook","description":"Webhook to notify when an invoice is deleted.\n","parameters":[{"$ref":"#/components/parameters/X-Rillet-Signature"},{"$ref":"#/components/parameters/X-Rillet-Timestamp"},{"$ref":"#/components/parameters/X-Rillet-Id"},{"$ref":"#/components/parameters/X-Rillet-Entity","schema":{"type":"string","enum":["INVOICE"]}},{"$ref":"#/components/parameters/X-Rillet-Event","schema":{"type":"string","enum":["DELETED"]}}],"requestBody":{"content":{"application/json":{"schema":{"description":"The id of the deleted invoice","type":"string","format":"uuid"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}}}}},"contract-created":{"post":{"tags":["Webhooks"],"x-blank-ext":"No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175","operationId":"contract-created-webhook","description":"Webhook to notify when a contract is created.\n","parameters":[{"$ref":"#/components/parameters/X-Rillet-Signature"},{"$ref":"#/components/parameters/X-Rillet-Timestamp"},{"$ref":"#/components/parameters/X-Rillet-Id"},{"$ref":"#/components/parameters/X-Rillet-Entity","schema":{"type":"string","enum":["CONTRACT"]}},{"$ref":"#/components/parameters/X-Rillet-Event","schema":{"type":"string","enum":["CREATED"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookContract"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}}}}},"contract-updated":{"post":{"tags":["Webhooks"],"x-blank-ext":"No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175","operationId":"contract-updated-webhook","description":"Webhook to notify when a contract is updated.\n","parameters":[{"$ref":"#/components/parameters/X-Rillet-Signature"},{"$ref":"#/components/parameters/X-Rillet-Timestamp"},{"$ref":"#/components/parameters/X-Rillet-Id"},{"$ref":"#/components/parameters/X-Rillet-Entity","schema":{"type":"string","enum":["CONTRACT"]}},{"$ref":"#/components/parameters/X-Rillet-Event","schema":{"type":"string","enum":["UPDATED"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookContract"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}}}}},"contract-deleted":{"post":{"tags":["Webhooks"],"x-blank-ext":"No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175","operationId":"contract-deleted-webhook","description":"Webhook to notify when a contract is deleted.\n","parameters":[{"$ref":"#/components/parameters/X-Rillet-Signature"},{"$ref":"#/components/parameters/X-Rillet-Timestamp"},{"$ref":"#/components/parameters/X-Rillet-Id"},{"$ref":"#/components/parameters/X-Rillet-Entity","schema":{"type":"string","enum":["CONTRACT"]}},{"$ref":"#/components/parameters/X-Rillet-Event","schema":{"type":"string","enum":["DELETED"]}}],"requestBody":{"content":{"application/json":{"schema":{"description":"The id of the deleted contract","type":"string","format":"uuid"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}}}}},"credit-memo-created":{"post":{"tags":["Webhooks"],"x-blank-ext":"No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175","operationId":"credit-memo-created-webhook","description":"Webhook to notify when a credit memo is created.\n","parameters":[{"$ref":"#/components/parameters/X-Rillet-Signature"},{"$ref":"#/components/parameters/X-Rillet-Timestamp"},{"$ref":"#/components/parameters/X-Rillet-Id"},{"$ref":"#/components/parameters/X-Rillet-Entity","schema":{"type":"string","enum":["CREDIT_MEMO"]}},{"$ref":"#/components/parameters/X-Rillet-Event","schema":{"type":"string","enum":["CREATED"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditMemo"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}}}}},"credit-memo-updated":{"post":{"tags":["Webhooks"],"x-blank-ext":"No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175","operationId":"credit-memo-updated-webhook","description":"Webhook to notify when a credit memo is updated.\n","parameters":[{"$ref":"#/components/parameters/X-Rillet-Signature"},{"$ref":"#/components/parameters/X-Rillet-Timestamp"},{"$ref":"#/components/parameters/X-Rillet-Id"},{"$ref":"#/components/parameters/X-Rillet-Entity","schema":{"type":"string","enum":["CREDIT_MEMO"]}},{"$ref":"#/components/parameters/X-Rillet-Event","schema":{"type":"string","enum":["UPDATED"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditMemo"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}}}}},"credit-memo-payment-updated":{"post":{"tags":["Webhooks"],"x-blank-ext":"No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175","operationId":"credit-memo-payment-updated-webhook","description":"Webhook to notify when a credit memo payment is updated.\n","parameters":[{"$ref":"#/components/parameters/X-Rillet-Signature"},{"$ref":"#/components/parameters/X-Rillet-Timestamp"},{"$ref":"#/components/parameters/X-Rillet-Id"},{"$ref":"#/components/parameters/X-Rillet-Entity","schema":{"type":"string","enum":["CREDIT_MEMO"]}},{"$ref":"#/components/parameters/X-Rillet-Event","schema":{"type":"string","enum":["PAYMENT_UPDATED"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditMemo"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}}}}},"credit-memo-deleted":{"post":{"tags":["Webhooks"],"x-blank-ext":"No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175","operationId":"credit-memo-deleted-webhook","description":"Webhook to notify when a credit memo is deleted.\n","parameters":[{"$ref":"#/components/parameters/X-Rillet-Signature"},{"$ref":"#/components/parameters/X-Rillet-Timestamp"},{"$ref":"#/components/parameters/X-Rillet-Id"},{"$ref":"#/components/parameters/X-Rillet-Entity","schema":{"type":"string","enum":["CREDIT_MEMO"]}},{"$ref":"#/components/parameters/X-Rillet-Event","schema":{"type":"string","enum":["DELETED"]}}],"requestBody":{"content":{"application/json":{"schema":{"description":"The id of the deleted credit memo","type":"string","format":"uuid"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}}}}},"customer-created":{"post":{"tags":["Webhooks"],"x-blank-ext":"No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175","operationId":"customer-created-webhook","description":"Webhook to notify when a customer is created.\n","parameters":[{"$ref":"#/components/parameters/X-Rillet-Signature"},{"$ref":"#/components/parameters/X-Rillet-Timestamp"},{"$ref":"#/components/parameters/X-Rillet-Id"},{"$ref":"#/components/parameters/X-Rillet-Entity","schema":{"type":"string","enum":["CUSTOMER"]}},{"$ref":"#/components/parameters/X-Rillet-Event","schema":{"type":"string","enum":["CREATED"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}}}}},"customer-updated":{"post":{"tags":["Webhooks"],"x-blank-ext":"No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175","operationId":"customer-updated-webhook","description":"Webhook to notify when a customer is updated.\n","parameters":[{"$ref":"#/components/parameters/X-Rillet-Signature"},{"$ref":"#/components/parameters/X-Rillet-Timestamp"},{"$ref":"#/components/parameters/X-Rillet-Id"},{"$ref":"#/components/parameters/X-Rillet-Entity","schema":{"type":"string","enum":["CUSTOMER"]}},{"$ref":"#/components/parameters/X-Rillet-Event","schema":{"type":"string","enum":["UPDATED"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}}}}},"customer-deleted":{"post":{"tags":["Webhooks"],"x-blank-ext":"No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175","operationId":"customer-deleted-webhook","description":"Webhook to notify when a customer is deleted.\n","parameters":[{"$ref":"#/components/parameters/X-Rillet-Signature"},{"$ref":"#/components/parameters/X-Rillet-Timestamp"},{"$ref":"#/components/parameters/X-Rillet-Id"},{"$ref":"#/components/parameters/X-Rillet-Entity","schema":{"type":"string","enum":["CUSTOMER"]}},{"$ref":"#/components/parameters/X-Rillet-Event","schema":{"type":"string","enum":["DELETED"]}}],"requestBody":{"content":{"application/json":{"schema":{"description":"The id of the deleted customer","type":"string","format":"uuid"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}}}}},"bill-created":{"post":{"tags":["Webhooks"],"x-blank-ext":"No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175","operationId":"bill-created-webhook","description":"Webhook to notify when a bill is created.\n","parameters":[{"$ref":"#/components/parameters/X-Rillet-Signature"},{"$ref":"#/components/parameters/X-Rillet-Timestamp"},{"$ref":"#/components/parameters/X-Rillet-Id"},{"$ref":"#/components/parameters/X-Rillet-Entity","schema":{"type":"string","enum":["BILL"]}},{"$ref":"#/components/parameters/X-Rillet-Event","schema":{"type":"string","enum":["CREATED"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bill"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}}}}},"bill-updated":{"post":{"tags":["Webhooks"],"x-blank-ext":"No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175","operationId":"bill-updated-webhook","description":"Webhook to notify when a bill is updated.\n","parameters":[{"$ref":"#/components/parameters/X-Rillet-Signature"},{"$ref":"#/components/parameters/X-Rillet-Timestamp"},{"$ref":"#/components/parameters/X-Rillet-Id"},{"$ref":"#/components/parameters/X-Rillet-Entity","schema":{"type":"string","enum":["BILL"]}},{"$ref":"#/components/parameters/X-Rillet-Event","schema":{"type":"string","enum":["UPDATED"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bill"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}}}}},"bill-deleted":{"post":{"tags":["Webhooks"],"x-blank-ext":"No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175","operationId":"bill-deleted-webhook","description":"Webhook to notify when a bill is deleted.\n","parameters":[{"$ref":"#/components/parameters/X-Rillet-Signature"},{"$ref":"#/components/parameters/X-Rillet-Timestamp"},{"$ref":"#/components/parameters/X-Rillet-Id"},{"$ref":"#/components/parameters/X-Rillet-Entity","schema":{"type":"string","enum":["BILL"]}},{"$ref":"#/components/parameters/X-Rillet-Event","schema":{"type":"string","enum":["DELETED"]}}],"requestBody":{"content":{"application/json":{"schema":{"description":"The id of the deleted bill","type":"string","format":"uuid"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}}}}},"vendor-created":{"post":{"tags":["Webhooks"],"x-blank-ext":"No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175","operationId":"vendor-created-webhook","description":"Webhook to notify when a vendor is created.\n","parameters":[{"$ref":"#/components/parameters/X-Rillet-Signature"},{"$ref":"#/components/parameters/X-Rillet-Timestamp"},{"$ref":"#/components/parameters/X-Rillet-Id"},{"$ref":"#/components/parameters/X-Rillet-Entity","schema":{"type":"string","enum":["VENDOR"]}},{"$ref":"#/components/parameters/X-Rillet-Event","schema":{"type":"string","enum":["CREATED"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorResponse"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}}}}},"vendor-updated":{"post":{"tags":["Webhooks"],"x-blank-ext":"No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175","operationId":"vendor-updated-webhook","description":"Webhook to notify when a vendor is updated.\n","parameters":[{"$ref":"#/components/parameters/X-Rillet-Signature"},{"$ref":"#/components/parameters/X-Rillet-Timestamp"},{"$ref":"#/components/parameters/X-Rillet-Id"},{"$ref":"#/components/parameters/X-Rillet-Entity","schema":{"type":"string","enum":["VENDOR"]}},{"$ref":"#/components/parameters/X-Rillet-Event","schema":{"type":"string","enum":["UPDATED"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorResponse"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}}}}},"vendor-deleted":{"post":{"tags":["Webhooks"],"x-blank-ext":"No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175","operationId":"vendor-deleted-webhook","description":"Webhook to notify when a vendor is deleted.\n","parameters":[{"$ref":"#/components/parameters/X-Rillet-Signature"},{"$ref":"#/components/parameters/X-Rillet-Timestamp"},{"$ref":"#/components/parameters/X-Rillet-Id"},{"$ref":"#/components/parameters/X-Rillet-Entity","schema":{"type":"string","enum":["VENDOR"]}},{"$ref":"#/components/parameters/X-Rillet-Event","schema":{"type":"string","enum":["DELETED"]}}],"requestBody":{"content":{"application/json":{"schema":{"description":"The id of the deleted vendor","type":"string","format":"uuid"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}}}}},"journal-entry-created":{"post":{"tags":["Webhooks"],"x-blank-ext":"No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175","operationId":"journal-entry-created-webhook","description":"Webhook to notify when a journal entry is created.\n","parameters":[{"$ref":"#/components/parameters/X-Rillet-Signature"},{"$ref":"#/components/parameters/X-Rillet-Timestamp"},{"$ref":"#/components/parameters/X-Rillet-Id"},{"$ref":"#/components/parameters/X-Rillet-Entity","schema":{"type":"string","enum":["JOURNAL_ENTRY"]}},{"$ref":"#/components/parameters/X-Rillet-Event","schema":{"type":"string","enum":["CREATED"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalEntryWebhook"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}}}}},"journal-entry-updated":{"post":{"tags":["Webhooks"],"x-blank-ext":"No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175","operationId":"journal-entry-updated-webhook","description":"Webhook to notify when a journal entry is updated.\n","parameters":[{"$ref":"#/components/parameters/X-Rillet-Signature"},{"$ref":"#/components/parameters/X-Rillet-Timestamp"},{"$ref":"#/components/parameters/X-Rillet-Id"},{"$ref":"#/components/parameters/X-Rillet-Entity","schema":{"type":"string","enum":["JOURNAL_ENTRY"]}},{"$ref":"#/components/parameters/X-Rillet-Event","schema":{"type":"string","enum":["UPDATED"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalEntryWebhook"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}}}}},"journal-entry-deleted":{"post":{"tags":["Webhooks"],"x-blank-ext":"No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175","operationId":"journal-entry-deleted-webhook","description":"Webhook to notify when a journal entry is deleted.\n","parameters":[{"$ref":"#/components/parameters/X-Rillet-Signature"},{"$ref":"#/components/parameters/X-Rillet-Timestamp"},{"$ref":"#/components/parameters/X-Rillet-Id"},{"$ref":"#/components/parameters/X-Rillet-Entity","schema":{"type":"string","enum":["JOURNAL_ENTRY"]}},{"$ref":"#/components/parameters/X-Rillet-Event","schema":{"type":"string","enum":["DELETED"]}}],"requestBody":{"content":{"application/json":{"schema":{"description":"The id of the deleted journal entry","type":"string","format":"uuid"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}}}}}}}