{"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":[]}},"/chart-of-accounts":{"post":{"tags":["Chart of Accounts"],"operationId":"create-a-chart-of-accounts","summary":"Creates a chart of accounts","description":"Initializes the entire chart of accounts for a bare organization in one atomic call.\nThe organization must have no existing chart of accounts; otherwise the request fails with 409.\nThe complete request is validated before any accounts or groups are created; validation failures return 400 without leaving a partial chart of accounts.\n\nStructural invariants match CSV import: exactly one `Accounts Receivable`, `Accounts Payable`, `Sales Tax Liability`, and `Retained Earnings`;\nat least one `Unbilled Revenue`, `Prepaid Expense`, and `Deferred Revenue`.\nThe same default group scaffold as CSV import is created.\nEach account's optional `parent_grouping` reuses a scaffold group by name or creates a nested group under the account type root.\nWhen the request contains exactly one `Prepaid Expense` account, expense accounts may omit `prepaid_account_code` to default to it;\nwhen it contains multiple `Prepaid Expense` accounts, each expense account must reference one by code.\n`Cash in Transit` is auto-created and must not appear in the request.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChartOfAccountsRequest"}}}},"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"}}}}},"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":[]}},"/members":{"get":{"tags":["Members"],"operationId":"list-members","summary":"Lists organization members","description":"Returns the identity of each member of the organization tied to the API credentials.\nThis endpoint carries identity only (id, user, email, name, status); it does not return role\nassignments. Use list-role-assignments to discover which member is assigned which role, and\nlist-roles to resolve what each role authorizes.\n","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["members"],"type":"object","properties":{"members":{"type":"array","items":{"$ref":"#/components/schemas/Member"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/roles":{"get":{"tags":["Roles"],"operationId":"list-roles","summary":"Lists roles","description":"Returns every role defined in the organization along with the flat set of permission keys it\ngrants. Each permission is an opaque, colon-delimited string; treat it as an opaque identifier\nand do not rely on its internal structure.\n","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["roles"],"type":"object","properties":{"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/role-assignments":{"get":{"tags":["Roles"],"operationId":"list-role-assignments","summary":"Lists role assignments","description":"Returns which organization member is assigned which role and the scope of that assignment.\nReferences roles and members by id only; join against list-roles and list-members\nto resolve names. This endpoint is not the source of truth for role or subsidiary names.\n","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"name":"member_id","in":"query","required":false,"description":"Filter assignments to a single organization member.","schema":{"type":"string","format":"uuid","example":"0199e21a-14c2-7abc-9d3e-112233445566"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["role_assignments"],"type":"object","properties":{"role_assignments":{"type":"array","items":{"$ref":"#/components/schemas/RoleAssignment"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/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, currency and type.\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"}},{"name":"type","in":"query","description":"Optional product type filter.","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProductType"}},"style":"form","explode":false}],"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.).\nSet type to BUNDLE to create a bundle.\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 or bundle 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 or bundle 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 or bundle. 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"}}}}}}},"/products/{product_id}/refresh-bundle":{"post":{"tags":["Products"],"operationId":"refresh-a-bundle","summary":"Refreshes a bundle","description":"Updates the details the bundle keeps for each component product to the products' current values.\nContracts that already sold the bundle don't change.\n","parameters":[{"name":"product_id","in":"path","required":true,"description":"UUID of the bundle to refresh.","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 a billing or shipping address, line1, city,\nzip_code, and country are required. State is required for United States addresses\n(use a 2-letter code such as 'TN' or 'CA') and may be omitted where it does not apply.\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.\nExceptions that keep stored data when the field is omitted:\n- metadata: omit it to keep all existing metadata, or send only the keys you want to set or clear.\n- addresses: omit address and billing_addresses to keep the stored billing addresses, and likewise\n  shipping_address and shipping_addresses. This is for backward compatibility: integrations built\n  before customers could have several addresses won't wipe the ones they don't send.\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/UpdateCustomerRequest"}}},"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","x-skip-mcp":true,"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"}}}}}}},"/customer-families":{"get":{"tags":["Customer Families"],"operationId":"list-all-customer-families","summary":"Lists all customer families","description":"Returns customer families with pagination and optional search or update filters.\nThe response does not include members; use list-customer-family-members to read them.\n","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"name":"search","in":"query","required":false,"schema":{"type":"string"},"description":"Filter customer families by name."},{"name":"updated.gt","in":"query","required":false,"description":"Filter customer families 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 customer families should be sorted by descending (either created or updated)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["customer_families"],"type":"object","properties":{"customer_families":{"type":"array","items":{"$ref":"#/components/schemas/CustomerFamily"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Customer Families"],"operationId":"create-a-customer-family","summary":"Creates a customer family","description":"Creates a family from customers that do not already belong to one. A child may report to\nanother child, so a multi-level hierarchy is created in one call.\n","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerFamilyRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerFamily"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/customer-families/{customer_family_id}":{"get":{"tags":["Customer Families"],"operationId":"retrieve-a-customer-family","summary":"Retrieves a customer family","description":"Returns a single customer family with its name, root parent and member count.\nThe response does not include members; use list-customer-family-members to read them.\n","parameters":[{"name":"customer_family_id","in":"path","required":true,"description":"UUID of the customer family to retrieve.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerFamily"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Customer Families"],"operationId":"rename-a-customer-family","summary":"Renames a customer family","description":"Changes the family's name. Membership is untouched: anything else in the body is ignored,\nso use the members endpoints to change who belongs.\n","parameters":[{"name":"customer_family_id","in":"path","required":true,"description":"UUID of the customer family to rename.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameCustomerFamilyRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerFamily"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Customer Families"],"operationId":"delete-a-customer-family","summary":"Dissolves a customer family","description":"Dissolves the grouping. Every member becomes a standalone customer; no customer is deleted.\n","parameters":[{"name":"customer_family_id","in":"path","required":true,"description":"UUID of the customer family to dissolve.","schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/customer-families/{customer_family_id}/members":{"get":{"tags":["Customer Families"],"operationId":"list-customer-family-members","summary":"Lists the members of a customer family","description":"Returns the members of a customer family with pagination. Each member names the member it\nreports to, so you can rebuild the tree. Newest first, not alphabetical.\n","parameters":[{"name":"customer_family_id","in":"path","required":true,"description":"UUID of the customer family whose members are listed.","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"name":"search","in":"query","required":false,"schema":{"type":"string"},"description":"Filter members by customer name."},{"name":"parent_customer_id","in":"query","required":false,"description":"Return only the direct children of this member. Omit it to page the whole family.\nPassing a customer from a different family gives you an empty page rather than an error.\n","schema":{"type":"string","format":"uuid"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","enum":["created","updated"],"default":"created"},"description":"the field the members should be sorted by descending (either created or updated)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["members"],"type":"object","properties":{"members":{"type":"array","items":{"$ref":"#/components/schemas/CustomerFamilyMember"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Customer Families"],"operationId":"add-customer-family-members","summary":"Adds members to a customer family","description":"Adds customers to a family and moves members already in it, in one call. Naming a member\nthat already belongs gives it a new parent, so a branch can be restructured in a single\nrequest rather than through a sequence that would be invalid halfway through.\n","parameters":[{"name":"customer_family_id","in":"path","required":true,"description":"UUID of the customer family to add members to.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCustomerFamilyMembersRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerFamily"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/customer-families/{customer_family_id}/members/{customer_id}":{"delete":{"tags":["Customer Families"],"operationId":"remove-a-customer-family-member","summary":"Removes a member from a customer family","description":"Removes one customer from the family; the customer itself is untouched. Anyone reporting to\nit moves up to its own parent. If this would leave the family with a single member it is\ndissolved instead. The root parent cannot be removed this way: dissolve the family instead.\n","parameters":[{"name":"customer_family_id","in":"path","required":true,"description":"UUID of the customer family to remove the member from.","schema":{"type":"string","format":"uuid"}},{"name":"customer_id","in":"path","required":true,"description":"UUID of the customer to remove from the family.","schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/contracts/preview-invoice-schedule":{"post":{"tags":["Contracts"],"operationId":"preview-invoice-schedule","summary":"Preview the invoice schedule for a contract","description":"Computes and returns the invoice schedule the given contract would produce, without creating the contract or persisting anything.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContractRequest"}}}},"responses":{"200":{"description":"The computed invoice schedule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractInvoiceSchedule"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/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}/milestones/{milestone_ref}/completion":{"put":{"tags":["Contracts"],"operationId":"update-a-milestone-completion","summary":"Records or corrects a milestone completion","description":"Creates or fully replaces the current completion on a milestone in a FULL contract. The reference may be the milestone UUID or its case-insensitive key. The completion date must fall within the owning line term. Omitted or null memo and external_references values clear those fields. An identical request is a no-op. The milestone change and required revenue journal regeneration commit atomically.","parameters":[{"name":"contract_id","in":"path","required":true,"description":"UUID of the contract that owns the milestone.","schema":{"type":"string","format":"uuid"}},{"name":"milestone_ref","in":"path","required":true,"description":"Milestone UUID or stable key. A key must identify exactly one milestone in the contract.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMilestoneCompletionRequest"}}}},"responses":{"200":{"description":"The updated milestone.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractMilestone"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Contracts"],"operationId":"reverse-a-milestone-completion","summary":"Reverses a milestone completion","description":"Removes the current completion and its recognition effect without cancelling the milestone, issuing a credit, or changing its allocation. The milestone must currently be completed. The milestone change and required revenue journal regeneration commit atomically.","parameters":[{"name":"contract_id","in":"path","required":true,"description":"UUID of the contract that owns the milestone.","schema":{"type":"string","format":"uuid"}},{"name":"milestone_ref","in":"path","required":true,"description":"Milestone UUID or stable key. A key must identify exactly one milestone in the contract.","schema":{"type":"string"}}],"responses":{"200":{"description":"The updated pending milestone.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractMilestone"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/contracts/{contract_id}/milestones/{milestone_ref}/cancellation":{"put":{"tags":["Contracts"],"operationId":"cancel-a-milestone","summary":"Permanently cancels a pending milestone","description":"Permanently forfeits a pending milestone allocation on a FULL contract without redistributing it or automatically issuing a refund. A nonzero allocation creates a linked credit memo; zero allocations do not. Retrying the saved effective_date is a no-op, while a different date conflicts. Completed milestones must be reversed before cancellation.","parameters":[{"name":"contract_id","in":"path","required":true,"description":"UUID of the contract that owns the milestone.","schema":{"type":"string","format":"uuid"}},{"name":"milestone_ref","in":"path","required":true,"description":"Milestone UUID or stable key. A key must identify exactly one milestone in the contract.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelMilestoneRequest"}}}},"responses":{"200":{"description":"The permanently cancelled milestone.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractMilestone"}}}},"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"}}}}}}},"/contracts/{contract_id}/metadata":{"get":{"tags":["Metadata"],"operationId":"retrieve-contract-metadata","summary":"Retrieves contract metadata","description":"Returns this contract's metadata values keyed by definition key. Keys with no value are\nomitted, including values held by archived definitions, which stay readable here.\nDefinition names, types and status come from list-all-metadata-definitions.\n","parameters":[{"name":"contract_id","in":"path","required":true,"description":"UUID of the contract to retrieve metadata for.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetadataValues"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Metadata"],"operationId":"update-contract-metadata","summary":"Updates contract metadata","description":"IMPORTANT: This is a full-replace operation (PUT semantics). Every active metadata key\nomitted from the request body is cleared. To set or clear individual keys without\ndisturbing the rest, use patch-contract-metadata instead. Null, empty, and\nwhitespace-only values clear a single key. Archived keys may only be cleared, never changed.\nEvery key must name a definition assigned to contracts: an unknown key, or one assigned\nonly to another entity type, fails the request with a 400. Keys are never silently\nignored. The write is atomic: if any key fails validation, nothing is written.\n","parameters":[{"name":"contract_id","in":"path","required":true,"description":"UUID of the contract to update metadata for.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMetadataValuesRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetadataValues"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Metadata"],"operationId":"patch-contract-metadata","summary":"Patches contract metadata","description":"Partial update. Keys omitted from the request body are left unchanged; send a key with a\nnull, empty, or whitespace-only value to clear it. Prefer this over\nupdate-contract-metadata when setting or clearing individual keys, as it cannot disturb\nkeys you did not name. Archived keys may only be cleared, never changed. Every key must\nname a definition assigned to contracts: an unknown key, or one assigned only to another\nentity type, fails the request with a 400. Keys are never silently ignored. The write is\natomic: if any key fails validation, nothing is written.\n","parameters":[{"name":"contract_id","in":"path","required":true,"description":"UUID of the contract to patch metadata for.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchMetadataValuesRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetadataValues"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/contracts/metadata/bulk":{"post":{"tags":["Metadata"],"operationId":"bulk-update-contract-metadata","summary":"Updates metadata for multiple contracts","description":"Patches metadata on up to 1,000 contracts in one atomic request. Each contract may receive\ndifferent values. If a contract is missing or any key or value is invalid, nothing is\nwritten for any contract. Per contract this behaves exactly like patch-contract-metadata:\nkeys omitted for that contract are left unchanged; null, empty, and whitespace-only values\nclear that key.\n","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUpdateContractMetadataRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUpdateContractMetadataResponse"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/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":"external_reference_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filter invoices by an external reference ID. `external_reference_type` must also be provided.\n"},{"name":"external_reference_type","in":"query","required":false,"schema":{"type":"string"},"description":"Filter invoices by an external reference type, such as `Stripe`. `external_reference_id` must also be provided.\n"},{"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/json","application/pdf"],"default":"application/json"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}},"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"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.\nExceptions that keep stored data when the field is omitted:\n- metadata: omit it to keep all existing metadata, or send only the keys you want to set or clear.\n- shipping_customer_id, billing_address_id, shipping_address_id: omit them to keep the invoice's current\n  ship-to customer and addresses, or send null to clear them. This is for backward compatibility:\n  integrations built before these fields existed won't clear them on every update.\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"}}}}}}},"/customers/{customer_id}/metadata":{"get":{"tags":["Metadata"],"operationId":"retrieve-customer-metadata","summary":"Retrieves customer metadata","description":"Returns this customer's metadata values keyed by definition key. Keys with no value are\nomitted, including values held by archived definitions, which stay readable here.\nDefinition names, types and status come from list-all-metadata-definitions.\n","parameters":[{"name":"customer_id","in":"path","required":true,"description":"UUID of the customer to retrieve metadata for.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetadataValues"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Metadata"],"operationId":"update-customer-metadata","summary":"Updates customer metadata","description":"Full replacement: every active key omitted from the request is cleared. To set or clear\nindividual keys without disturbing the rest, use patch-customer-metadata instead. Null,\nempty, and whitespace-only values clear one key. Unknown keys, archived keys, and\ndefinitions not assigned to customers fail the entire request with a 400.\nMetadata-only changes are recorded in the audit log but do not trigger customer.updated\nwebhooks or customer integration syncs.\n","parameters":[{"name":"customer_id","in":"path","required":true,"description":"UUID of the customer to update metadata for.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMetadataValuesRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetadataValues"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Metadata"],"operationId":"patch-customer-metadata","summary":"Patches customer metadata","description":"Partial update. Keys omitted from the request body are left unchanged; send a key with a\nnull, empty, or whitespace-only value to clear it. Prefer this over\nupdate-customer-metadata when setting or clearing individual keys, as it cannot disturb\nkeys you did not name. Archived keys may only be cleared, never changed. Every key must\nname a definition assigned to customers: an unknown key, or one assigned only to another\nentity type, fails the request with a 400. Keys are never silently ignored. The write is\natomic: if any key fails validation, nothing is written.\n","parameters":[{"name":"customer_id","in":"path","required":true,"description":"UUID of the customer to patch metadata for.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchMetadataValuesRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetadataValues"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/customers/metadata/bulk":{"post":{"tags":["Metadata"],"operationId":"bulk-update-customer-metadata","summary":"Updates metadata for multiple customers","description":"Patches metadata on up to 1,000 customers in one atomic request. Each customer may receive\ndifferent values. If a customer is missing or any key or value is invalid, nothing is\nwritten for any customer. Per customer this behaves exactly like patch-customer-metadata:\nkeys omitted for that customer are left unchanged; null, empty, and whitespace-only values\nclear that key.\nMetadata-only changes are recorded in the audit log but do not trigger customer.updated\nwebhooks or customer integration syncs.\n","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUpdateCustomerMetadataRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUpdateCustomerMetadataResponse"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/invoices/{invoice_id}/metadata":{"get":{"tags":["Metadata"],"operationId":"retrieve-invoice-metadata","summary":"Retrieves invoice metadata","description":"Returns this invoice's metadata values keyed by definition key. Keys with no value are\nomitted, including values held by archived definitions, which stay readable here.\nDefinition names, types and status come from list-all-metadata-definitions.\n","parameters":[{"name":"invoice_id","in":"path","required":true,"description":"UUID of the invoice to retrieve metadata for.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetadataValues"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Metadata"],"operationId":"update-invoice-metadata","summary":"Updates invoice metadata","description":"IMPORTANT: This is a full-replace operation (PUT semantics). Every active metadata key\nomitted from the request body is cleared. To set or clear individual keys without\ndisturbing the rest, use patch-invoice-metadata instead. Null, empty, and\nwhitespace-only values clear a single key. Archived keys may only be cleared, never changed.\nEvery key must name a definition assigned to invoices: an unknown key, or one assigned\nonly to another entity type, fails the request with a 400. Keys are never silently\nignored. The write is atomic: if any key fails validation, nothing is written.\n","parameters":[{"name":"invoice_id","in":"path","required":true,"description":"UUID of the invoice to update metadata for.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMetadataValuesRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetadataValues"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Metadata"],"operationId":"patch-invoice-metadata","summary":"Patches invoice metadata","description":"Partial update. Keys omitted from the request body are left unchanged; send a key with a\nnull, empty, or whitespace-only value to clear it. Prefer this over\nupdate-invoice-metadata when setting or clearing individual keys, as it cannot disturb\nkeys you did not name. Archived keys may only be cleared, never changed. Every key must\nname a definition assigned to invoices: an unknown key, or one assigned only to another\nentity type, fails the request with a 400. Keys are never silently ignored. The write is\natomic: if any key fails validation, nothing is written.\n","parameters":[{"name":"invoice_id","in":"path","required":true,"description":"UUID of the invoice to patch metadata for.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchMetadataValuesRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetadataValues"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/invoices/metadata/bulk":{"post":{"tags":["Metadata"],"operationId":"bulk-update-invoice-metadata","summary":"Updates metadata for multiple invoices","description":"Patches metadata on up to 1,000 invoices in one atomic request. Each invoice may receive\ndifferent values. If an invoice is missing or any key or value is invalid, nothing is\nwritten for any invoice. Per invoice this behaves exactly like patch-invoice-metadata:\nkeys omitted for that invoice are left unchanged; null, empty, and whitespace-only values\nclear that key.\n","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUpdateInvoiceMetadataRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUpdateInvoiceMetadataResponse"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/bills/{bill_id}/metadata":{"get":{"tags":["Metadata"],"operationId":"retrieve-bill-metadata","summary":"Retrieves bill metadata","description":"Returns this bill's metadata values keyed by definition key. Keys with no value are\nomitted. Existing values held by archived definitions remain readable here.\nDefinition names, types and status come from list-all-metadata-definitions.\n","parameters":[{"name":"bill_id","in":"path","required":true,"description":"UUID of the bill to retrieve metadata for.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetadataValues"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Metadata"],"operationId":"update-bill-metadata","summary":"Updates bill metadata","description":"IMPORTANT: This is a full-replace operation (PUT semantics). Every active metadata key\nomitted from the request body is cleared. To set or clear individual keys without\ndisturbing the rest, use patch-bill-metadata instead. Null, empty, and\nwhitespace-only values clear a single key. Archived keys may only be cleared, never changed.\nEvery key must name a definition assigned to bills: an unknown key, or one assigned\nonly to another entity type, fails the request with a 400. Keys are never silently\nignored. The write is atomic: if any key fails validation, nothing is written.\nWrites are rejected with a 400 while the bill has a pending approval request.\n","parameters":[{"name":"bill_id","in":"path","required":true,"description":"UUID of the bill to update metadata for.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMetadataValuesRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetadataValues"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Metadata"],"operationId":"patch-bill-metadata","summary":"Patches bill metadata","description":"Partial update. Keys omitted from the request body are left unchanged; send a key with a\nnull, empty, or whitespace-only value to clear it. Prefer this over\nupdate-bill-metadata when setting or clearing individual keys, as it cannot disturb\nkeys you did not name. Archived keys may only be cleared, never changed. Every key must\nname a definition assigned to bills: an unknown key, or one assigned only to another\nentity type, fails the request with a 400. Keys are never silently ignored. The write is\natomic: if any key fails validation, nothing is written.\nWrites are rejected with a 400 while the bill has a pending approval request.\n","parameters":[{"name":"bill_id","in":"path","required":true,"description":"UUID of the bill to patch metadata for.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchMetadataValuesRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetadataValues"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/bills/metadata/bulk":{"post":{"tags":["Metadata"],"operationId":"bulk-update-bill-metadata","summary":"Updates metadata for multiple bills","description":"Patches metadata on up to 1,000 bills in one atomic request. Each bill may receive\ndifferent values. If a bill is missing or any key or value is invalid, nothing is\nwritten for any bill. Per bill this behaves exactly like patch-bill-metadata:\nkeys omitted for that bill are left unchanged; null, empty, and whitespace-only values\nclear that key. If any bill has a pending approval request, the entire request is\nrejected with a 400 and nothing is written.\n","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUpdateBillMetadataRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUpdateBillMetadataResponse"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/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/BillStatusFilter"}}],"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":"The bill was created; approval details are populated when approval is required","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.\nBills with line allocations return 422 BillHasSubsidiaryAllocations, even for a no-op update.\nThese allocations cannot be sent through this API; edit the bill in Rillet instead.\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, TXT, JPG/JPEG, PNG, GIF, XLSX/XLS, DOCX/DOC, CSV, RTF, TIFF/TIF, BMP, Pages, Numbers, PPTX, or PPT) 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.\nPDF, JPEG, and PNG keep content-signature validation and do not require a matching filename extension.\nEvery other format requires an allowed filename extension and either a matching content type or application/octet-stream.\nFiles detected as HTML are rejected regardless of their filename or declared content type.\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","required":["file"],"properties":{"file":{"type":"string","format":"binary"}}},"encoding":{"file":{"contentType":"application/pdf, text/plain, image/jpeg, image/png, image/gif, application/octet-stream, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/msword, text/csv, application/csv, application/rtf, text/rtf, image/tiff, image/bmp, image/x-ms-bmp, application/vnd.apple.pages, application/x-iwork-pages-sffpages, application/vnd.apple.numbers, application/x-iwork-numbers-sffnumbers, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.ms-powerpoint"}}}}},"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, TXT, JPG/JPEG, PNG, GIF, XLSX/XLS, DOCX/DOC, CSV, RTF, TIFF/TIF, BMP, Pages, Numbers, PPTX, or PPT) to an existing charge using multipart form data with a single file part.\nPDF, JPEG, and PNG keep content-signature validation and do not require a matching filename extension.\nEvery other format requires an allowed filename extension and either a matching content type or application/octet-stream.\nFiles detected as HTML are rejected regardless of their filename or declared content type.\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","required":["file"],"properties":{"file":{"type":"string","format":"binary"}}},"encoding":{"file":{"contentType":"application/pdf, text/plain, image/jpeg, image/png, image/gif, application/octet-stream, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/msword, text/csv, application/csv, application/rtf, text/rtf, image/tiff, image/bmp, image/x-ms-bmp, application/vnd.apple.pages, application/x-iwork-pages-sffpages, application/vnd.apple.numbers, application/x-iwork-numbers-sffnumbers, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.ms-powerpoint"}}}}},"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, TXT, JPG/JPEG, PNG, GIF, XLSX/XLS, DOCX/DOC, CSV, RTF, TIFF/TIF, BMP, Pages, Numbers, PPTX, or PPT) to an existing reimbursement using multipart form data with a single file part.\nPDF, JPEG, and PNG keep content-signature validation and do not require a matching filename extension.\nEvery other format requires an allowed filename extension and either a matching content type or application/octet-stream.\nFiles detected as HTML are rejected regardless of their filename or declared content type.\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","required":["file"],"properties":{"file":{"type":"string","format":"binary"}}},"encoding":{"file":{"contentType":"application/pdf, text/plain, image/jpeg, image/png, image/gif, application/octet-stream, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/msword, text/csv, application/csv, application/rtf, text/rtf, image/tiff, image/bmp, image/x-ms-bmp, application/vnd.apple.pages, application/x-iwork-pages-sffpages, application/vnd.apple.numbers, application/x-iwork-numbers-sffnumbers, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.ms-powerpoint"}}}}},"responses":{"204":{"description":"No content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/reimbursements/{reimbursement_id}/payments":{"get":{"tags":["Reimbursement Payments"],"operationId":"list-reimbursement-payments","summary":"Lists reimbursement payments","description":"Lists payments recorded against a reimbursement so external systems can reconcile its paid balance.\n","parameters":[{"name":"reimbursement_id","in":"path","description":"UUID of the reimbursement 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/ReimbursementPayment"}}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Reimbursement Payments"],"operationId":"create-a-reimbursement-payment","summary":"Creates a reimbursement payment","description":"Records a cash payment that settles all or part of a reimbursement.\n","parameters":[{"name":"reimbursement_id","in":"path","description":"UUID of the reimbursement to be used in this operation.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReimbursementPaymentRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReimbursementPayment"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/reimbursements/{reimbursement_id}/payments/{payment_id}":{"delete":{"tags":["Reimbursement Payments"],"operationId":"delete-a-reimbursement-payment","summary":"Deletes a reimbursement payment","description":"Reverses an uncleared reimbursement payment that was recorded in error.\n","parameters":[{"name":"reimbursement_id","in":"path","description":"UUID of the reimbursement 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"}}}}}}},"/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}/documents":{"parameters":[{"name":"journal_entry_id","in":"path","description":"UUID of an existing manual journal entry.","required":true,"schema":{"type":"string"}}],"post":{"tags":["Journal Entry Documents"],"operationId":"upload-journal-entry-document","summary":"Uploads a document to a manual journal entry","description":"Appends one PDF, JPEG, PNG, or XLSX of at most 20 MiB to an existing manual journal entry.\nCreate the journal entry first; for asynchronous imports, wait until the entry is available.\nExisting attachments are preserved. Repeating an upload creates another attachment.\nA journal entry can have at most 10 attachments, including files uploaded through the Rillet application.\nAttachments may be added to approved entries and entries in closed periods without changing accounting data or approval status.\nSystem-generated and non-posting entries are not supported.\n","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"}}},"encoding":{"file":{"contentType":"application/pdf, image/jpeg, image/png, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}}}},"responses":{"204":{"description":"Document attached"},"400":{"description":"Empty file, missing filename, unsupported file content, or attachment limit reached"},"404":{"description":"Manual journal entry not found or not accessible"},"413":{"description":"File exceeds the size limit"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]},"get":{"tags":["Journal Entry Documents"],"operationId":"list-journal-entry-documents","summary":"Lists documents attached to a manual journal entry","description":"Returns all attached documents, including those uploaded through the Rillet application.\nEach download URL is valid for up to 1 hour; call this endpoint again to obtain fresh URLs.\nReturns an empty array when the entry has no attachments.\nSystem-generated and non-posting entries are not supported.\n","responses":{"200":{"description":"Attached documents","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/JournalEntryDocument"}}}}},"404":{"description":"Manual journal entry not found or not accessible"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/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-accounts/{bank_account_id}/balance":{"get":{"tags":["Bank accounts"],"operationId":"retrieve-a-bank-account-balance","summary":"Retrieves a bank account balance","description":"Returns the latest stored bank balance on or before the requested date in the bank account's native currency.\nThe response includes the stored balance date so consumers can identify when the latest available balance predates the requested date.\n","parameters":[{"name":"bank_account_id","in":"path","description":"UUID of the bank account.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"as_of_date","in":"query","description":"Date on or before which to retrieve the latest stored bank balance (ISO-8601 format).","required":true,"schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankAccountBalance"}}}},"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 links to the Rillet transactions it settled.\nUse the reconciled transaction IDs to retrieve the reconciled bills, invoices, journal entries, or other source records.\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":[]}},"/feedback":{"post":{"tags":["Feedback"],"operationId":"submit-agent-feedback","summary":"Reports API bugs and missing features","description":"Found something surprising, confusing, or missing while using the API? Tell us, even if you found a workaround.\nNo feedback is too small: a specific report about minor friction can help improve the API for other agents.\nSend one observation per request. Describe what you were trying to do, the affected path, and what you expected;\nfor bugs, also include what actually happened. A writable API key or OAuth token is required. The organization\nand submitting credential are recorded from authentication, so you do not need to provide them.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentFeedbackRequest"}}}},"responses":{"201":{"description":"Feedback recorded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentFeedbackResponse"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[]}},"/external-reference-types":{"post":{"tags":["External Reference Types"],"operationId":"create-external-reference-type","x-skip-mcp":true,"summary":"Creates an external reference type","description":"Creates a `type` for use in `external_references`. If the organization already has a type with this\n`slug`, it is returned unchanged with `200`; otherwise it is created and returned with `201`. Reserved\nnames are rejected.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExternalReferenceTypeRequest"}}}},"responses":{"200":{"description":"Already existed; returned unchanged","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalReferenceType"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalReferenceType"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"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":[]}},"/metadata-definitions":{"get":{"tags":["Metadata"],"operationId":"list-all-metadata-definitions","summary":"Lists all metadata definitions","description":"Returns the organization's metadata definitions: the custom fields that can hold values on\ncontracts, customers, and invoices. Keys are permanent identifiers derived from the name at creation;\nAPI consumers bind to keys, which never change on rename. At most 50 active definitions can\nbe assigned to one entity type. Definitions are managed in Settings, not through this API.\n","parameters":[{"name":"entity_type","in":"query","required":false,"description":"Only definitions assigned to this entity type.","schema":{"$ref":"#/components/schemas/MetadataEntityType"}},{"name":"status","in":"query","required":false,"description":"Only definitions with this status. Omit to return both.","schema":{"$ref":"#/components/schemas/MetadataDefinitionStatus"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"required":["metadata_definitions"],"type":"object","properties":{"metadata_definitions":{"type":"array","items":{"$ref":"#/components/schemas/MetadataDefinition"}}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/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":{"AgentFeedbackRequest":{"type":"object","description":"A specific API observation or feature request. Avoid including API keys, tokens, or sensitive data.","required":["kind","title","endpoint","description","expectedBehavior"],"properties":{"kind":{"type":"string","enum":["BUG","MISSING_FEATURE"],"description":"Use BUG for unexpected behavior or MISSING_FEATURE for a capability you need."},"title":{"type":"string","maxLength":200,"pattern":"^[\\s\\S]*\\S[\\s\\S]*$","description":"A short summary of the issue or request."},"endpoint":{"type":"string","maxLength":2048,"pattern":"^/.*$","description":"The affected API path, starting with /; for a missing endpoint, use the closest related path.","example":"/invoices"},"agentName":{"type":"string","maxLength":200,"pattern":"^[\\s\\S]*\\S[\\s\\S]*$","description":"Optional name of the agent or integration that encountered this issue."},"description":{"type":"string","maxLength":10000,"pattern":"^[\\s\\S]*\\S[\\s\\S]*$","description":"What you were trying to do and why the issue matters. Include sanitized request details if useful."},"actualBehavior":{"type":"string","maxLength":10000,"pattern":"^[\\s\\S]*\\S[\\s\\S]*$","description":"Required for BUG. Describe what happened, including the status code or sanitized error if available."},"expectedBehavior":{"type":"string","maxLength":10000,"pattern":"^[\\s\\S]*\\S[\\s\\S]*$","description":"What you expected instead, or the capability that would let you complete the task."}}},"AgentFeedbackResponse":{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid"}}},"JournalEntryDocument":{"type":"object","required":["id","file_name","url"],"properties":{"id":{"type":"string","format":"uuid"},"file_name":{"type":"string"},"url":{"type":"string","format":"uri","description":"Temporary download URL valid for up to 1 hour."}}},"Member":{"type":"object","required":["id","user_id","email","status"],"properties":{"id":{"type":"string","format":"uuid","description":"Organization membership id (stable within this organization).","example":"0199e21a-14c2-7abc-9d3e-112233445566"},"user_id":{"type":"string","format":"uuid","description":"Global user id (stable for the same user across organizations).","example":"0199e21a-9b3d-7cde-8f21-665544332211"},"email":{"type":"string","format":"email","example":"alex.rivera@example.com"},"first_name":{"type":"string","example":"Alex"},"last_name":{"type":"string","example":"Rivera"},"status":{"$ref":"#/components/schemas/MemberStatus"}}},"MemberStatus":{"type":"string","description":"Membership status of the user within the organization. Maps from the internal\nMembershipStatus: Active -> ACTIVE, Archived -> ARCHIVED, CreationPending -> PENDING.\nHidden members are not surfaced through this endpoint at all (consistent with the\nexisting internal members endpoint), so there is no corresponding enum value.\n","enum":["ACTIVE","ARCHIVED","PENDING"]},"Role":{"type":"object","required":["id","name","is_system_role","permissions"],"properties":{"id":{"type":"string","format":"uuid","example":"7a1b2c3d-4e5f-6789-abcd-ef0123456789"},"name":{"type":"string","example":"Accountant Admin"},"description":{"type":"string"},"is_system_role":{"type":"boolean","description":"True for built-in \"System\" roles that Rillet defines and maintains; false for org-authored\n\"Custom\" roles.\n"},"permissions":{"type":"array","description":"Flat list of permission keys granted by the role. Each key is an opaque, colon-delimited\nstring; treat it as an opaque identifier and do not rely on its internal structure.\n","items":{"type":"string","example":"ap:vendors:view"}}}},"RoleAssignment":{"type":"object","required":["id","member_id","role_id","scope"],"properties":{"id":{"type":"string","format":"uuid","example":"0199e21d-2a4f-7111-8c22-aabbccddeeff"},"member_id":{"type":"string","format":"uuid","description":"References Member.id.","example":"0199e21a-14c2-7abc-9d3e-112233445566"},"role_id":{"type":"string","format":"uuid","description":"References Role.id.","example":"7a1b2c3d-4e5f-6789-abcd-ef0123456789"},"scope":{"$ref":"#/components/schemas/RoleAssignmentScope"}}},"RoleAssignmentScope":{"description":"The scope an assignment applies to. ORGANIZATION grants the role across the whole organization;\nSUBSIDIARY confines it to a single subsidiary.\n","discriminator":{"propertyName":"type","mapping":{"ORGANIZATION":"#/components/schemas/OrganizationScope","SUBSIDIARY":"#/components/schemas/SubsidiaryScope"}},"oneOf":[{"$ref":"#/components/schemas/OrganizationScope"},{"$ref":"#/components/schemas/SubsidiaryScope"}],"example":{"type":"SUBSIDIARY","subsidiary_id":"0199e21b-be83-7298-a9d6-8c43437117c8"}},"OrganizationScope":{"type":"object","required":["type"],"properties":{"type":{"type":"string","default":"ORGANIZATION"}}},"SubsidiaryScope":{"type":"object","required":["type","subsidiary_id"],"properties":{"type":{"type":"string","default":"SUBSIDIARY"},"subsidiary_id":{"type":"string","format":"uuid","description":"References a subsidiary from list-all-subsidiaries; this endpoint is not the source of\ntruth for its name.\n","example":"0199e21b-be83-7298-a9d6-8c43437117c8"}}},"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"}},"submission_sources":{"allOf":[{"$ref":"#/components/schemas/ApprovalWorkflowSubmissionSources"}],"nullable":true,"description":"Entry points governed by this workflow. Null or an empty list means manual entry in Rillet only.\nAn explicit list applies exactly to those sources. Provider import, scheduled sync, and reimport\nare the runtime sources represented as Connected integrations in Rillet.\n"},"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. Contract and Invoice workflows are not\nsupported by this endpoint.\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"}},"submission_sources":{"allOf":[{"$ref":"#/components/schemas/ApprovalWorkflowConfigurableSubmissionSources"}],"nullable":true,"description":"Optional source scope for Bill, Charge, Charge Reversal, and Reimbursement workflows. Omit this\nfield or send null to preserve the stored scope. An empty list means manual entry in Rillet only;\na non-empty list applies exactly to the listed sources. To select Connected integrations, include\n`PROVIDER_IMPORT`, `SCHEDULED_SYNC`, and `REIMPORT`.\n"}}},"ApprovalWorkflowType":{"type":"string","description":"The kind of record a workflow applies to. Contract and Invoice are retained for backward-compatible\nreads but cannot be updated through this endpoint.\n","enum":["JOURNAL_ENTRY","CONTRACT","INVOICE","BILL","CHARGE","CHARGE_REVERSAL","REIMBURSEMENT"],"example":"JOURNAL_ENTRY"},"ApprovalWorkflowSubmissionSource":{"type":"string","description":"Runtime entry point for an approval-governed expense. `INTERNAL_API` and `SAMPLE_DATA` are\nsystem-managed and can appear in responses but cannot be added through this API.\n","enum":["UI","INTERNAL_API","PUBLIC_API","MCP","CSV","PROVIDER_IMPORT","SCHEDULED_SYNC","REIMPORT","AURA","SAMPLE_DATA"],"example":"UI"},"ApprovalWorkflowSubmissionSources":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalWorkflowSubmissionSource"}},"ApprovalWorkflowConfigurableSubmissionSource":{"type":"string","description":"Customer-configurable entry point for an expense workflow. Connected integrations are represented by\n`PROVIDER_IMPORT`, `SCHEDULED_SYNC`, and `REIMPORT` together.\n","enum":["UI","PUBLIC_API","MCP","CSV","PROVIDER_IMPORT","SCHEDULED_SYNC","REIMPORT","AURA"],"example":"UI"},"ApprovalWorkflowConfigurableSubmissionSources":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalWorkflowConfigurableSubmissionSource"}},"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","AURA_ASSISTED":"#/components/schemas/ApprovalWorkflowAuraAssistedCondition","UI_SUBMITTED":"#/components/schemas/ApprovalWorkflowUiSubmittedCondition","API_SUBMITTED":"#/components/schemas/ApprovalWorkflowApiSubmittedCondition","MCP_SUBMITTED":"#/components/schemas/ApprovalWorkflowMcpSubmittedCondition","FIELD":"#/components/schemas/ApprovalWorkflowFieldCondition","ACCOUNT":"#/components/schemas/ApprovalWorkflowAccountCondition","SOURCE_TYPE":"#/components/schemas/ApprovalWorkflowSourceTypeCondition","VENDOR":"#/components/schemas/ApprovalWorkflowVendorCondition","PROVIDER":"#/components/schemas/ApprovalWorkflowProviderCondition","OPERATION":"#/components/schemas/ApprovalWorkflowOperationCondition"}},"oneOf":[{"$ref":"#/components/schemas/ApprovalWorkflowAmountCondition"},{"$ref":"#/components/schemas/ApprovalWorkflowSubsidiaryCondition"},{"$ref":"#/components/schemas/ApprovalWorkflowCreatedByUserCondition"},{"$ref":"#/components/schemas/ApprovalWorkflowAuraAssistedCondition"},{"$ref":"#/components/schemas/ApprovalWorkflowUiSubmittedCondition"},{"$ref":"#/components/schemas/ApprovalWorkflowApiSubmittedCondition"},{"$ref":"#/components/schemas/ApprovalWorkflowMcpSubmittedCondition"},{"$ref":"#/components/schemas/ApprovalWorkflowFieldCondition"},{"$ref":"#/components/schemas/ApprovalWorkflowAccountCondition"},{"$ref":"#/components/schemas/ApprovalWorkflowSourceTypeCondition"},{"$ref":"#/components/schemas/ApprovalWorkflowVendorCondition"},{"$ref":"#/components/schemas/ApprovalWorkflowProviderCondition"},{"$ref":"#/components/schemas/ApprovalWorkflowOperationCondition"}],"example":{"id":"0199e21b-be83-7298-a9d6-8c43437117c8","condition_type":"AMOUNT","operator":"GREATER_THAN","threshold":{"type":"MONETARY","amount":{"amount":"50000.00","currency":"USD"}}}},"ApprovalWorkflowVendorCondition":{"type":"object","description":"Matches on the bill vendor or Charge merchant.\n","required":["id","condition_type","operator","vendor_id"],"properties":{"id":{"type":"string","format":"uuid","description":"Identifies the condition. Server-generated, and returned on every read."},"condition_type":{"type":"string","default":"VENDOR"},"operator":{"$ref":"#/components/schemas/ApprovalWorkflowEqualityOperator"},"vendor_id":{"type":"string","format":"uuid"}}},"ApprovalWorkflowVendorConditionRequest":{"type":"object","description":"Matches on the bill vendor or Charge merchant. Supported only for Bill and Charge workflows.\n","required":["condition_type","operator","vendor_id"],"properties":{"id":{"type":"string","format":"uuid","description":"Send the existing condition ID to retain it; omit it to have the server generate a new one.\n"},"condition_type":{"type":"string","default":"VENDOR"},"operator":{"$ref":"#/components/schemas/ApprovalWorkflowEqualityOperator"},"vendor_id":{"type":"string","format":"uuid"}}},"ApprovalWorkflowProviderCondition":{"type":"object","description":"Matches the provider that supplied the expense.","required":["id","condition_type","operator","providers"],"properties":{"id":{"type":"string","format":"uuid"},"condition_type":{"type":"string","default":"PROVIDER"},"operator":{"$ref":"#/components/schemas/ApprovalWorkflowCollectionOperator"},"providers":{"type":"array","minItems":1,"uniqueItems":true,"items":{"$ref":"#/components/schemas/ApprovalWorkflowProvider"}}}},"ApprovalWorkflowProviderConditionRequest":{"type":"object","description":"Matches any or none of the selected expense providers.","required":["condition_type","operator","providers"],"properties":{"id":{"type":"string","format":"uuid"},"condition_type":{"type":"string","default":"PROVIDER"},"operator":{"$ref":"#/components/schemas/ApprovalWorkflowCollectionOperator"},"providers":{"type":"array","minItems":1,"uniqueItems":true,"items":{"$ref":"#/components/schemas/ApprovalWorkflowProvider"}}}},"ApprovalWorkflowProvider":{"type":"string","description":"Exact provider identifier, or DIRECT for expenses without an imported provider.","enum":["AIRBASE","AWS","AZURE","BREX","CHARGEBEE","CIN7","CSV_IMPORT","CSV_UPLOAD","CUSTOMER_CUSTOM","CUSTOMER_HISTORICAL","DEEL","DIVVY","EBIZ","EXPENSIFY","FINCH","FLOAT","GCP","HUBSPOT","HYPERLINE","JPM","MAXIO","METRONOME","NAVAN","NEXTCLERK","ORB","ORDWAY","PAYPAL","PLAID","POSTSCRIPT","RAMP","RIPPLING","SALESFORCE","SEQUENCE","SOLVIMON","SPHERE","STRIPE","STRIPE_BABELFISH_EXTERNAL_ID","STRIPE_TEAM_ID","TABS","TRABA","DIRECT"]},"ApprovalWorkflowOperation":{"type":"string","enum":["CREATE","UPDATE"]},"ApprovalWorkflowOperationCondition":{"type":"object","description":"Matches the proposed expense operation.","required":["id","condition_type","operation"],"properties":{"id":{"type":"string","format":"uuid"},"condition_type":{"type":"string","default":"OPERATION"},"operation":{"$ref":"#/components/schemas/ApprovalWorkflowOperation"}}},"ApprovalWorkflowOperationConditionRequest":{"type":"object","description":"Matches a CREATE or UPDATE proposal.","required":["condition_type","operation"],"properties":{"id":{"type":"string","format":"uuid"},"condition_type":{"type":"string","default":"OPERATION"},"operation":{"$ref":"#/components/schemas/ApprovalWorkflowOperation"}}},"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"}}},"ApprovalWorkflowAuraAssistedCondition":{"type":"object","description":"Matches entries whose triggering create or edit was made with Aura's assistance; a later edit made\nwithout Aura is evaluated as non-Aura. `EQUALS` matches Aura-assisted changes, `NOT_EQUALS` the rest.\n","required":["id","condition_type","operator"],"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":"AURA_ASSISTED"},"operator":{"$ref":"#/components/schemas/ApprovalWorkflowEqualityOperator"}}},"ApprovalWorkflowAuraAssistedConditionRequest":{"type":"object","description":"Matches entries whose triggering create or edit was made with Aura's assistance; a later edit made\nwithout Aura is evaluated as non-Aura. `EQUALS` matches Aura-assisted changes, `NOT_EQUALS` the rest.\n","required":["condition_type","operator"],"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":"AURA_ASSISTED"},"operator":{"$ref":"#/components/schemas/ApprovalWorkflowEqualityOperator"}}},"ApprovalWorkflowApiSubmittedCondition":{"type":"object","description":"Matches entries whose triggering create or edit was submitted directly through the public REST API.\nMCP tool actions are tracked separately. A later non-API edit is evaluated as non-API.\n","required":["id","condition_type","operator"],"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":"API_SUBMITTED"},"operator":{"$ref":"#/components/schemas/ApprovalWorkflowEqualityOperator"}}},"ApprovalWorkflowUiSubmittedCondition":{"type":"object","description":"Matches entries whose triggering create or edit was submitted through the Rillet web application\nwithout Aura assistance. A later non-UI edit is evaluated as non-UI.\n","required":["id","condition_type","operator"],"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":"UI_SUBMITTED"},"operator":{"$ref":"#/components/schemas/ApprovalWorkflowEqualityOperator"}}},"ApprovalWorkflowUiSubmittedConditionRequest":{"type":"object","description":"Matches entries whose triggering create or edit was submitted through the Rillet web application\nwithout Aura assistance. A later non-UI edit is evaluated as non-UI.\n","required":["condition_type","operator"],"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":"UI_SUBMITTED"},"operator":{"$ref":"#/components/schemas/ApprovalWorkflowEqualityOperator"}}},"ApprovalWorkflowApiSubmittedConditionRequest":{"type":"object","description":"Matches entries whose triggering create or edit was submitted directly through the public REST API.\nMCP tool actions are tracked separately. A later non-API edit is evaluated as non-API.\n","required":["condition_type","operator"],"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":"API_SUBMITTED"},"operator":{"$ref":"#/components/schemas/ApprovalWorkflowEqualityOperator"}}},"ApprovalWorkflowMcpSubmittedCondition":{"type":"object","description":"Matches entries whose triggering create or edit was submitted through a Rillet MCP tool.\nDirect public REST API calls are tracked separately. A later non-MCP edit is evaluated as non-MCP.\n","required":["id","condition_type","operator"],"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":"MCP_SUBMITTED"},"operator":{"$ref":"#/components/schemas/ApprovalWorkflowEqualityOperator"}}},"ApprovalWorkflowMcpSubmittedConditionRequest":{"type":"object","description":"Matches entries whose triggering create or edit was submitted through a Rillet MCP tool.\nDirect public REST API calls are tracked separately. A later non-MCP edit is evaluated as non-MCP.\n","required":["condition_type","operator"],"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":"MCP_SUBMITTED"},"operator":{"$ref":"#/components/schemas/ApprovalWorkflowEqualityOperator"}}},"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","AURA_ASSISTED":"#/components/schemas/ApprovalWorkflowAuraAssistedConditionRequest","UI_SUBMITTED":"#/components/schemas/ApprovalWorkflowUiSubmittedConditionRequest","API_SUBMITTED":"#/components/schemas/ApprovalWorkflowApiSubmittedConditionRequest","MCP_SUBMITTED":"#/components/schemas/ApprovalWorkflowMcpSubmittedConditionRequest","FIELD":"#/components/schemas/ApprovalWorkflowFieldConditionRequest","ACCOUNT":"#/components/schemas/ApprovalWorkflowAccountConditionRequest","SOURCE_TYPE":"#/components/schemas/ApprovalWorkflowSourceTypeConditionRequest","VENDOR":"#/components/schemas/ApprovalWorkflowVendorConditionRequest","PROVIDER":"#/components/schemas/ApprovalWorkflowProviderConditionRequest","OPERATION":"#/components/schemas/ApprovalWorkflowOperationConditionRequest"}},"oneOf":[{"$ref":"#/components/schemas/ApprovalWorkflowAmountConditionRequest"},{"$ref":"#/components/schemas/ApprovalWorkflowSubsidiaryConditionRequest"},{"$ref":"#/components/schemas/ApprovalWorkflowCreatedByUserConditionRequest"},{"$ref":"#/components/schemas/ApprovalWorkflowAuraAssistedConditionRequest"},{"$ref":"#/components/schemas/ApprovalWorkflowUiSubmittedConditionRequest"},{"$ref":"#/components/schemas/ApprovalWorkflowApiSubmittedConditionRequest"},{"$ref":"#/components/schemas/ApprovalWorkflowMcpSubmittedConditionRequest"},{"$ref":"#/components/schemas/ApprovalWorkflowFieldConditionRequest"},{"$ref":"#/components/schemas/ApprovalWorkflowAccountConditionRequest"},{"$ref":"#/components/schemas/ApprovalWorkflowSourceTypeConditionRequest"},{"$ref":"#/components/schemas/ApprovalWorkflowVendorConditionRequest"},{"$ref":"#/components/schemas/ApprovalWorkflowProviderConditionRequest"},{"$ref":"#/components/schemas/ApprovalWorkflowOperationConditionRequest"}],"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":["DRAFT","UNPAID","PAID","PARTIALLY_PAID","CREDITED","PARTIALLY_CREDITED","APPLIED"]},"PendingApprovalRequest":{"type":"object","required":["id","workflow_id","operation","status"],"properties":{"id":{"type":"string","format":"uuid"},"workflow_id":{"type":"string","format":"uuid"},"operation":{"type":"string","enum":["CREATE","UPDATE","DELETE"]},"status":{"type":"string","enum":["PENDING"]}}},"BillStatusFilter":{"type":"string","enum":["UNPAID","PAID","PARTIALLY_PAID","CREDITED","PARTIALLY_CREDITED","APPLIED"]},"ReimbursementStatus":{"type":"string","enum":["DRAFT","UNPAID","PAID","PARTIALLY_PAID"]},"ChargeStatus":{"type":"string","enum":["DRAFT","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","PROGRESS"],"description":"DAILY divides revenue equally per day. EVEN_PERIOD divides revenue equally per calendar month. PROGRESS uses a progress plan; the supported measure MILESTONES recognizes allocated revenue on milestone completion and requires a one-time price. FULL contract creation supports an explicit progress plan or snapshots the referenced product's template. Existing non-progress behavior is unchanged."},"ProgressMeasure":{"type":"string","enum":["MILESTONES"],"description":"The progress measure. Only MILESTONES is currently supported."},"ProgressPlanTemplateRequest":{"discriminator":{"propertyName":"measure","mapping":{"MILESTONES":"#/components/schemas/MilestonePlanTemplateRequest"}},"oneOf":[{"$ref":"#/components/schemas/MilestonePlanTemplateRequest"}]},"ProgressPlanTemplate":{"discriminator":{"propertyName":"measure","mapping":{"MILESTONES":"#/components/schemas/MilestonePlanTemplate"}},"oneOf":[{"$ref":"#/components/schemas/MilestonePlanTemplate"}]},"MilestoneValueMode":{"type":"string","enum":["PERCENTAGE","AMOUNT"],"description":"Values are non-negative plain decimal strings with no exponent notation. PERCENTAGE supports at most 4 decimal places; AMOUNT supports at most 10 decimal places. Excess decimal places, including trailing zeros, are rejected rather than rounded. PERCENTAGE values are whole percentages (\"30\" means 30%), range from 0 to 100, and must total exactly 100. AMOUNT values on product templates are proportional weights in the product's currency and must total more than zero; they are not fixed contract obligations."},"MilestoneExpectedOffset":{"type":"object","required":["count","unit"],"description":"Forecast offset from the contract line start date, not an invoicing or recognition trigger. Uses a non-negative integer count and a single calendar unit. Zero offsets are returned as {\"count\": 0, \"unit\": \"DAYS\"}.","properties":{"count":{"type":"integer","format":"int32","minimum":0,"example":1},"unit":{"type":"string","enum":["DAYS","MONTHS","YEARS"],"example":"MONTHS"}}},"MilestoneTemplateRequest":{"type":"object","required":["key","name","sequence","value"],"properties":{"key":{"type":"string","pattern":"^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$","description":"Stable integration identifier, unique within the plan ignoring case. Keys that parse as UUIDs are not allowed.","example":"design-approved"},"name":{"type":"string","minLength":1,"description":"Display name, unique within the plan ignoring case and repeated whitespace.","example":"Design approved"},"sequence":{"type":"integer","format":"int32","minimum":1,"description":"Ordering within the plan. Each milestone must have a distinct positive JSON integer sequence; fractional numbers and strings are rejected.","example":1},"value":{"type":"string","pattern":"^[0-9]+(\\.[0-9]{1,10})?$","description":"A non-negative plain decimal string with at most 4 decimal places in PERCENTAGE mode or 10 decimal places in AMOUNT mode, including trailing zeros. Excess decimal places are rejected rather than rounded. In PERCENTAGE mode, \"30\" means 30%; values must be at most 100 and sum to exactly 100. In AMOUNT mode, values are proportional weights whose total must be positive, not fixed contract amounts.","example":"30"},"expected_offset":{"allOf":[{"$ref":"#/components/schemas/MilestoneExpectedOffset"}],"nullable":true,"description":"Optional forecast offset from the contract line start date. Omit or send null for no offset.","example":{"count":1,"unit":"MONTHS"}}}},"MilestoneTemplate":{"allOf":[{"$ref":"#/components/schemas/MilestoneTemplateRequest"},{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid","description":"Server-generated milestone identifier."}}}]},"MilestonePlanTemplateRequest":{"type":"object","required":["measure","value_mode","milestones"],"properties":{"measure":{"$ref":"#/components/schemas/ProgressMeasure"},"value_mode":{"$ref":"#/components/schemas/MilestoneValueMode"},"milestones":{"type":"array","minItems":1,"maxItems":100,"items":{"$ref":"#/components/schemas/MilestoneTemplateRequest"}}}},"MilestonePlanTemplate":{"type":"object","required":["measure","value_mode","milestones"],"properties":{"measure":{"$ref":"#/components/schemas/ProgressMeasure"},"value_mode":{"$ref":"#/components/schemas/MilestoneValueMode"},"milestones":{"type":"array","items":{"$ref":"#/components/schemas/MilestoneTemplate"}}}},"ProgressPlanRequest":{"discriminator":{"propertyName":"measure","mapping":{"MILESTONES":"#/components/schemas/MilestoneProgressPlanRequest"}},"oneOf":[{"$ref":"#/components/schemas/MilestoneProgressPlanRequest"}]},"MilestoneProgressPlanRequest":{"type":"object","required":["measure","value_mode","milestones"],"description":"A complete contract-specific milestone plan. PERCENTAGE milestones require percentage and reject amount; AMOUNT milestones require amount and reject percentage. Definitions are snapshotted on the contract line.","properties":{"measure":{"$ref":"#/components/schemas/ProgressMeasure"},"value_mode":{"$ref":"#/components/schemas/MilestoneValueMode"},"milestones":{"type":"array","minItems":1,"maxItems":100,"items":{"$ref":"#/components/schemas/ContractMilestoneRequest"}}}},"ContractMilestoneRequest":{"type":"object","required":["key","name","sequence"],"properties":{"key":{"type":"string","pattern":"^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$","description":"Stable integration identifier, unique within the plan ignoring case. UUID-shaped keys are rejected.","example":"design-approved"},"name":{"type":"string","minLength":1,"description":"Display name, unique within the plan ignoring case and repeated whitespace.","example":"Design approved"},"sequence":{"type":"integer","format":"int32","minimum":1,"description":"Ordering within the plan. Each milestone must have a distinct positive JSON integer sequence; fractional numbers and strings are rejected.","example":1},"percentage":{"type":"string","pattern":"^[0-9]+(\\.[0-9]{1,4})?$","description":"Required only in PERCENTAGE mode. A non-negative plain decimal string in 0-100 units; all milestones must total exactly 100. \"30\" means 30 percent. At most 4 decimal places are allowed, including trailing zeros; excess decimal places are rejected rather than rounded.","example":"30"},"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount","description":"Required only in AMOUNT mode. Must use the contract line currency, and all milestone amounts must total the final line value after quantity and discounts."},"expected_date":{"type":"string","format":"date","nullable":true,"description":"Optional forecast date within the contract line term. It does not trigger recognition or invoicing."}}},"ProgressPlan":{"discriminator":{"propertyName":"measure","mapping":{"MILESTONES":"#/components/schemas/MilestoneProgressPlan"}},"oneOf":[{"$ref":"#/components/schemas/MilestoneProgressPlan"}]},"MilestoneProgressPlan":{"type":"object","required":["measure","value_mode","as_of_date","milestones"],"properties":{"measure":{"$ref":"#/components/schemas/ProgressMeasure"},"value_mode":{"$ref":"#/components/schemas/MilestoneValueMode"},"as_of_date":{"type":"string","format":"date","description":"Organization-local date used to derive pending milestone statuses."},"milestones":{"type":"array","items":{"$ref":"#/components/schemas/ContractMilestone"}}}},"ContractMilestoneStatus":{"type":"string","readOnly":true,"enum":["OPEN","DUE_THIS_PERIOD","OVERDUE","COMPLETED","CANCELLED"]},"ContractMilestoneCancellation":{"type":"object","required":["effective_date"],"properties":{"effective_date":{"type":"string","format":"date"},"credit_memo_id":{"type":"string","format":"uuid","nullable":true,"description":"Linked credit memo for a nonzero allocation; null when the cancelled allocation is zero."}}},"ContractMilestone":{"type":"object","required":["id","key","name","sequence","status","external_references"],"properties":{"id":{"type":"string","format":"uuid","description":"Stable server-generated identifier for this contract milestone."},"key":{"type":"string","description":"Stable integration key copied from the product template or explicit contract plan."},"name":{"type":"string"},"sequence":{"type":"integer","format":"int32"},"percentage":{"type":"string","nullable":true,"description":"Present only in PERCENTAGE mode. \"30\" means 30 percent."},"allocated_amount":{"allOf":[{"$ref":"#/components/schemas/RoundedMonetaryAmount"}],"nullable":true,"description":"Present only in PERCENTAGE mode; the monetary allocation calculated for this contract line."},"amount":{"allOf":[{"$ref":"#/components/schemas/RoundedMonetaryAmount"}],"nullable":true,"description":"Present only in AMOUNT mode. No duplicate allocated_amount is returned in that mode."},"expected_date":{"type":"string","format":"date","nullable":true},"status":{"$ref":"#/components/schemas/ContractMilestoneStatus"},"completed_date":{"type":"string","format":"date","nullable":true},"memo":{"type":"string","nullable":true},"external_references":{"type":"array","uniqueItems":true,"items":{"$ref":"#/components/schemas/ExternalReference"}},"cancellation":{"allOf":[{"$ref":"#/components/schemas/ContractMilestoneCancellation"}],"nullable":true}}},"UpdateMilestoneCompletionRequest":{"type":"object","required":["completed_date"],"properties":{"completed_date":{"type":"string","format":"date","description":"Actual completion date. It must fall within the owning contract line term."},"memo":{"type":"string","nullable":true,"description":"Optional completion note. Omit or send null to clear the saved note."},"external_references":{"type":"array","uniqueItems":true,"nullable":true,"description":"Complete replacement of completion references. Omit, send null, or send an empty array to clear them. Every type must already be configured for the organization.","items":{"$ref":"#/components/schemas/ExternalReference"}}}},"CancelMilestoneRequest":{"type":"object","required":["effective_date"],"properties":{"effective_date":{"type":"string","format":"date","description":"Cancellation business date within the contract term and allowed accounting 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","fields","id","include_in_arr_mrr","name","price","status","type"],"properties":{"id":{"type":"string","format":"uuid"},"type":{"description":"Whether this is a standalone product or a bundle.","allOf":[{"$ref":"#/components/schemas/ProductType"}]},"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":{"description":"How revenue from this product is recognized. Omitted for bundles.","allOf":[{"$ref":"#/components/schemas/RevenuePattern"}]},"progress_plan_template":{"allOf":[{"$ref":"#/components/schemas/ProgressPlanTemplate"}],"nullable":true,"description":"Default progress configuration for PROGRESS products. Product edits do not rewrite existing contract plans."},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"fields":{"description":"Default custom field values for new product lines. An empty array means this product has no defaults.","allOf":[{"$ref":"#/components/schemas/FieldAssignments"}]},"status":{"type":"string","enum":["ACTIVE","INACTIVE"]},"account_code":{"description":"The code of the account this product's revenue posts to. Omitted for bundles.","allOf":[{"$ref":"#/components/schemas/AccountCode"}]},"bundle":{"description":"Bundle details. Present only when type is BUNDLE.","allOf":[{"$ref":"#/components/schemas/BundleDetails"}]}},"allOf":[{"if":{"required":["type"],"properties":{"type":{"const":"PRODUCT"}}},"then":{"required":["account_code","revenue_pattern"]}},{"if":{"required":["type"],"properties":{"type":{"const":"BUNDLE"}}},"then":{"required":["bundle"]}}]},"ProductType":{"type":"string","enum":["PRODUCT","BUNDLE"],"description":"PRODUCT is a standalone product. BUNDLE is a product made up of other products."},"BundleInvoiceDisplay":{"type":"string","enum":["BUNDLE_AND_COMPONENTS","BUNDLE_LINE_ONLY"],"description":"How a bundle appears on invoices and credit memos. BUNDLE_AND_COMPONENTS shows the bundle and its component products. BUNDLE_LINE_ONLY shows the bundle only."},"BundleDetails":{"type":"object","required":["invoice_display","components"],"properties":{"invoice_display":{"$ref":"#/components/schemas/BundleInvoiceDisplay"},"components":{"type":"array","minItems":2,"items":{"$ref":"#/components/schemas/BundleComponent"}}}},"BundleComponent":{"type":"object","required":["product_id","quantity"],"properties":{"product_id":{"type":"string","format":"uuid","description":"The component product."},"quantity":{"type":"string","format":"number","example":"1","description":"Units of this product in one unit of the bundle."}}},"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}}},"CreateChartOfAccountsRequest":{"type":"object","additionalProperties":false,"required":["accounts"],"description":"Chart-of-accounts initialization payload for a bare organization.\nThe accounts array must satisfy these structural subtype requirements:\nexactly one `Accounts Receivable`, `Accounts Payable`, `Sales Tax Liability`, and `Retained Earnings`;\nat least one `Unbilled Revenue`, `Prepaid Expense`, and `Deferred Revenue`.\n","properties":{"accounts":{"type":"array","minItems":7,"items":{"$ref":"#/components/schemas/ChartOfAccountsAccountRequest"}}}},"ChartOfAccountsAccountRequest":{"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},"parent_grouping":{"type":"string","minLength":1,"pattern":".*\\S.*","description":"Custom group name for the account. Reuses a default scaffold group by name or creates a nested group under the account type root.\n"},"prepaid_account_code":{"type":"string","minLength":1,"pattern":"^[A-Za-z0-9.-]+$","description":"Code of a `Prepaid Expense` account in the same request. Required on expense accounts when the request contains multiple `Prepaid Expense` accounts;\nwhen the request contains exactly one, expense accounts may omit this field to default to it.\n"}}},"Account":{"type":"object","required":["id","code","name","type","subtype","status","intercompany","parent_grouping","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},"parent_grouping":{"type":"string","description":"Name of the account group this account belongs to."},"prepaid_account_code":{"type":"string","nullable":true,"description":"Code of the linked prepaid expense account. Applies to EXPENSE accounts; null for other account types."},"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"}}},"BankAccountBalance":{"type":"object","required":["bank_account_id","as_of_date","balance_date","balance"],"properties":{"bank_account_id":{"type":"string","format":"uuid"},"as_of_date":{"type":"string","format":"date","description":"The requested as-of date."},"balance_date":{"type":"string","format":"date","description":"The date of the stored balance returned, which may precede the requested as-of date."},"balance":{"$ref":"#/components/schemas/MonetaryAmount"}}},"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","reconciled_transactions"],"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"}},"reconciled_transactions":{"type":"array","description":"Rillet transactions matched to this bank transaction. Empty when the bank transaction is unmatched.","items":{"$ref":"#/components/schemas/ReconciledTransaction"}}}},"ReconciledTransaction":{"type":"object","required":["id","type"],"properties":{"id":{"type":"string","format":"uuid","description":"ID of the reconciled Rillet transaction"},"type":{"type":"string","description":"Type of the reconciled Rillet transaction","enum":["BILL","CHARGE","REIMBURSEMENT","INVOICE","CREDIT_MEMO","VENDOR_CREDIT","JOURNAL_ENTRY","BANK_TRANSACTION"]}}},"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"],"properties":{"type":{"description":"Defaults to PRODUCT. Can't be changed after the product is created.","default":"PRODUCT","allOf":[{"$ref":"#/components/schemas/ProductType"}]},"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":{"description":"How revenue from this product is recognized. Required for standalone products. Not allowed for bundles.","allOf":[{"$ref":"#/components/schemas/RevenuePattern"}]},"progress_plan_template":{"allOf":[{"$ref":"#/components/schemas/ProgressPlanTemplateRequest"}],"nullable":true,"description":"Required when creating a PROGRESS product; measure must be MILESTONES and milestone revenue recognition must be enabled for the organization. Only accepted with revenue_pattern PROGRESS and a ONE_TIME price. On update, omission or null preserves the existing template; an object replaces the entire template. Milestone identifiers are retained for matching keys ignoring case, and generated for new keys. Changing revenue_pattern away from PROGRESS clears the template."},"account_code":{"description":"The code of the account this product's revenue posts to. Required for standalone products. Not allowed for bundles.","allOf":[{"$ref":"#/components/schemas/AccountCode"}]},"status":{"type":"string","default":"ACTIVE","enum":["ACTIVE","INACTIVE"]},"external_references":{"description":"References to this product in external systems. Must be omitted or empty for bundles.","uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"fields":{"description":"Custom field values. On update, omitting this property or sending an empty array clears all fields. Must be omitted or empty for bundles.","allOf":[{"$ref":"#/components/schemas/FieldAssignments"}]},"bundle":{"description":"Required when type is BUNDLE. Not allowed for other types.","allOf":[{"$ref":"#/components/schemas/BundleRequest"}]}},"allOf":[{"if":{"properties":{"type":{"const":"PRODUCT"}}},"then":{"required":["account_code","revenue_pattern"]}},{"if":{"required":["type"],"properties":{"type":{"const":"BUNDLE"}}},"then":{"required":["bundle"]}}]},"BundleRequest":{"type":"object","required":["components"],"properties":{"invoice_display":{"description":"Defaults to BUNDLE_AND_COMPONENTS.","default":"BUNDLE_AND_COMPONENTS","allOf":[{"$ref":"#/components/schemas/BundleInvoiceDisplay"}]},"components":{"type":"array","minItems":2,"maxItems":10,"items":{"$ref":"#/components/schemas/BundleComponentRequest"}}}},"BundleComponentRequest":{"type":"object","required":["product_id","quantity"],"properties":{"product_id":{"type":"string","format":"uuid","description":"A standalone product."},"quantity":{"type":"string","format":"number","example":"1","description":"Units of this product in one unit of the bundle. Must be greater than zero."}}},"CustomerRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string","example":"Bob"},"name_on_invoice":{"type":"string","example":"Bob Johnson"},"address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"deprecated":true,"description":"Deprecated: use billing_addresses. In responses, the first address in billing_addresses. In requests without billing_addresses, it creates or edits that first billing address in place; the customer's other billing addresses are left untouched."},"shipping_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"deprecated":true,"description":"Deprecated: use shipping_addresses. In responses, the first address in shipping_addresses. In requests without shipping_addresses, it creates or edits that first shipping address in place; the customer's other shipping addresses are left untouched."},"billing_addresses":{"allOf":[{"$ref":"#/components/schemas/CustomerAddresses"}],"nullable":true,"description":"All of the customer's billing addresses, returned in a stable order; the first is the default for new contracts and invoices. On update the list is authoritative: addresses sent with an id are updated, addresses without an id are added, and stored addresses left out are removed. Removing an address that is used by a contract or an invoice that can still be edited is rejected with a 400 naming those documents. Omit to leave billing addresses unchanged; send an empty list to remove them all. Cannot be combined with address."},"shipping_addresses":{"allOf":[{"$ref":"#/components/schemas/CustomerAddresses"}],"nullable":true,"description":"All of the customer's shipping addresses. Same rules as billing_addresses. Cannot be combined with shipping_address."},"emails":{"type":"array","items":{"$ref":"#/components/schemas/CustomerEmail"},"description":"All of the customer's emails. On update, send the full list: emails with an id are kept or edited, emails without an id are added, and emails left out are removed (omitting emails, or sending an empty list, removes them all). Rejected: an id on create, an id that doesn't belong to this customer, the same id twice, or the same address and type twice (addresses are compared ignoring case and surrounding spaces)."},"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."},"allow_online_payments":{"type":"boolean","description":"Allows this customer to pay invoices online via Stripe, and must be true before auto-payment can be set up for them. Omit on create to leave online payments off; omit on update to keep the customer's current setting. Enabling it requires Stripe to be configured for at least one subsidiary."},"fields":{"allOf":[{"$ref":"#/components/schemas/FieldAssignments"}],"nullable":true},"tax_ids":{"allOf":[{"$ref":"#/components/schemas/CustomerTaxIds"}],"nullable":true,"description":"The customer's tax IDs. Omit on create for no tax IDs. On update, omit to keep the current tax IDs, send an empty list to clear them, or send a list to replace them all. Adding or changing tax IDs requires the customer to have an address, and they are validated with the organization's tax provider when one is connected."}}},"CustomerTaxIds":{"type":"array","items":{"$ref":"#/components/schemas/CustomerTaxId"}},"CustomerTaxId":{"type":"object","required":["type","value"],"properties":{"type":{"type":"string","enum":["EU_VAT_REGISTRATION_NUMBER","GENERIC_VAT_NUMBER"]},"value":{"type":"string","minLength":1,"example":"DE123456789"}}},"UpdateCustomerRequest":{"allOf":[{"$ref":"#/components/schemas/CustomerRequest"},{"type":"object","properties":{"metadata":{"allOf":[{"$ref":"#/components/schemas/InlineMetadataValues"}],"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"],"properties":{"id":{"type":"string","description":"A request-scoped identifier for this contract item, echoed back as contract_item_id on each invoice_schedule line. Required on the preview-invoice-schedule request and, when invoice_schedule is supplied, on create; otherwise optional and ignored. When present, ids must be unique within the request."},"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":{"description":"How revenue from this line is recognized. Required for standalone products. Ignored on bundle lines.","allOf":[{"$ref":"#/components/schemas/RevenuePattern"}]},"progress_plan":{"allOf":[{"$ref":"#/components/schemas/ProgressPlanRequest"}],"description":"Accepted only with revenue_pattern PROGRESS on FULL contracts. Omit to snapshot the product's complete progress_plan_template. An object is a complete override rather than a partial merge. Explicit null is invalid. Existing accounting-engine eligibility applies; discounted milestone lines are currently unsupported."},"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. For contracts with any nonzero contract-level or item-level minimum commitment, the invoice date resolved from this schedule must equal start_date.\n"},"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"},"shipping_customer_id":{"type":"string","format":"uuid","description":"The customer to ship to. Omit, or send customer_id, to ship to the billing customer."},"billing_address_id":{"allOf":[{"$ref":"#/components/schemas/NullableId"}],"description":"ID of one of the billing customer's billing_addresses. If omitted, the first address in the customer's billing_addresses is used, or none when the customer has no billing address. Send null for no billing address; rejected when a tax provider is connected. Rejected when the address does not belong to the billing customer or is not a billing address."},"shipping_address_id":{"allOf":[{"$ref":"#/components/schemas/NullableId"}],"description":"ID of one of the ship-to customer's shipping_addresses. If omitted, the first address in the ship-to customer's shipping_addresses is used, or none when it has no shipping address. Send null for no shipping address. Rejected when the address does not belong to the ship-to customer or is not a shipping address. When a shipping address is set it determines tax; otherwise the billing address does."},"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."},"purchase_order_number":{"type":"string","maxLength":50,"description":"Optional purchase order number. When set, it is copied onto every invoice generated by the contract."},"invoice_schedule":{"$ref":"#/components/schemas/ContractInvoiceSchedule","description":"Optional. Omit to use the fully-computed invoice schedule. When provided, it replaces the FIXED billing layout: submit any set of invoices you choose (split, merge, add, or drop). Rules: for each contract item, the sum of its submitted FIXED line totals must equal its computed contract value (redistribution only); every FIXED line must carry its contract_item_id; invoices must have distinct issue_dates, each within the contract period and outside any closed book-close period; for FIXED lines total_amount must equal unit_amount * quantity, and amounts on discounted lines cannot be changed (they may be regrouped, not re-sliced). USAGE and USAGE_COMMITMENT billing is computed by the system and must not be submitted; it is kept unchanged. Revenue recognition and TCV are unaffected. See ContractInvoiceScheduleItem for the per-line rules."}}},"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"}},"metadata":{"allOf":[{"$ref":"#/components/schemas/InlineMetadataValues"}],"nullable":true}}},"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"}},"metadata":{"allOf":[{"$ref":"#/components/schemas/InlineMetadataValues"}],"nullable":true}}},"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"}},"purchase_order_number":{"type":"string","maxLength":50,"description":"Optional purchase order number, carried onto the contract created from this draft and from there onto every invoice it generates."}}},"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"},"description":{"type":"string","description":"Overrides the product description on invoice lines generated for this item once the draft becomes a contract. When omitted or blank, the product's own description is used."},"fields":{"$ref":"#/components/schemas/FieldAssignments"}}},"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"}},"purchase_order_number":{"type":"string","example":"PO-12345","description":"Purchase order number set on the draft. Null when none was set."}}},"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"},"description":{"type":"string","description":"Overrides the product description on invoice lines generated for this item. Null when the product description is used."},"fields":{"$ref":"#/components/schemas/FieldAssignments"}}},"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. For contracts with any nonzero contract-level or item-level minimum commitment, the invoice date resolved from this schedule must equal start_date.\n"}}},"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. For contracts with any nonzero contract-level or item-level minimum commitment, the invoice date resolved from this schedule must equal start_date.\n"}}},"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","start_date"],"properties":{"product_id":{"type":"string","format":"uuid","description":"A bundle is accepted only when `amending` names a line that sells the same bundle."},"price":{"$ref":"#/components/schemas/Price"},"quantity":{"type":"number","minimum":1,"example":1,"description":"Must be 1 for USAGE prices."},"revenue_pattern":{"description":"How revenue from this line is recognized. Required for standalone products. Ignored on bundle lines.","allOf":[{"$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","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. Required for United States addresses and optional where it does not apply."},"zip_code":{"type":"string","example":"37201"},"country":{"$ref":"#/components/schemas/CountryCode"}}},"CustomerAddress":{"allOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Stable ID of a stored customer address. Use it as billing_address_id or shipping_address_id on contracts and invoices. On customer update, send it to keep or edit an existing address; omit it to add a new address. Omitted in responses when the address no longer exists on the customer."}}},{"$ref":"#/components/schemas/Address"}]},"CustomerAddresses":{"type":"array","items":{"$ref":"#/components/schemas/CustomerAddress"}},"NullableId":{"type":"string","format":"uuid","nullable":true,"description":"A UUID, or null to explicitly select nothing. Omitting the field is not the same as sending null."},"SetupUpAutoPaymentRequest":{"type":"object","optional":["subsidiary_id"],"properties":{"subsidiary_id":{"type":"string","format":"uuid"}}},"CustomerEmail":{"type":"object","required":["email","type"],"properties":{"id":{"type":"string","format":"uuid","example":"0193a6f2-4c1e-7b8a-9d3f-2e5c8a1b7f40","description":"Stable ID of the customer email, always returned. On customer update, send it to keep or edit the email; omit it to add a new email. Not accepted on customer create."},"email":{"type":"string","example":"bobjohnson@somedomain.com"},"type":{"type":"string","enum":["MAIN_SENDER","CC","BCC"]}}},"CustomerFamily":{"type":"object","required":["id","name","root_parent_customer_id","member_count"],"description":"A customer family, without its members.","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","description":"Defaults to the root parent customer's name when omitted on create.","example":"Acme Holdings"},"root_parent_customer_id":{"type":"string","format":"uuid","description":"The customer at the top of the tree. Every family has exactly one. Not to be confused with\na member's parent_customer_id, which points at whoever that member reports to.\n"},"member_count":{"type":"integer","description":"How many customers are in the family, counting the one at the top. Always at least two.","example":4}}},"CustomerFamilyMember":{"type":"object","required":["customer_id","name","is_root_parent"],"description":"One customer's place in a family.","properties":{"customer_id":{"type":"string","format":"uuid"},"name":{"type":"string","description":"The customer's name, so you can show a list of members without looking each one up.","example":"Acme EMEA"},"parent_customer_id":{"type":"string","format":"uuid","nullable":true,"description":"The member this customer reports to. Only the customer at the top of the tree has none."},"is_root_parent":{"type":"boolean","description":"True only for the customer at the top of the tree. This is not the same as having children:\na member part-way down has children of its own, and is still false.\n"}}},"CustomerFamilyRequest":{"type":"object","required":["root_parent_customer_id","child_links"],"properties":{"name":{"type":"string","description":"Defaults to the root parent customer's name when omitted.","example":"Acme Holdings"},"root_parent_customer_id":{"type":"string","format":"uuid","description":"The customer at the top of the tree. It must not already belong to a family."},"child_links":{"type":"array","minItems":1,"maxItems":1000,"description":"Every other member, and who it reports to. Each one reports to the root parent or to\nanother customer in this list, which is how a hierarchy deeper than one level is created\nin a single call.\n","items":{"$ref":"#/components/schemas/CustomerFamilyLink"}}}},"AddCustomerFamilyMembersRequest":{"type":"object","required":["members"],"properties":{"members":{"type":"array","minItems":1,"maxItems":1000,"description":"The customers to place in the family, and who each reports to. Each one reports to a\nmember the family already has or to another customer in this list. Naming a customer\nthat already belongs moves it rather than failing.\n","items":{"$ref":"#/components/schemas/CustomerFamilyLink"}}}},"RenameCustomerFamilyRequest":{"type":"object","required":["name"],"description":"The family's new name. Membership cannot be changed here.","properties":{"name":{"type":"string","example":"Acme Holdings (EMEA)"}}},"CustomerFamilyLink":{"type":"object","required":["customer_id","parent_customer_id"],"description":"One member, and the member it reports to.","properties":{"customer_id":{"type":"string","format":"uuid"},"parent_customer_id":{"type":"string","format":"uuid","description":"The member this customer reports to. Which members are eligible depends on the request; see the field that carries this."}}},"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')"},"metadata":{"type":"object","additionalProperties":{"type":"string"},"description":"Customer metadata values keyed by metadata definition key."},"family_id":{"type":"string","format":"uuid","nullable":true,"description":"The family this customer belongs to. Set through the customer-families endpoints, not here."},"parent_customer_id":{"type":"string","format":"uuid","nullable":true,"description":"The member this customer reports to within its family. The family's root parent reports to no one."}}},{"$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"},"metadata":{"type":"object","additionalProperties":{"type":"string"},"description":"Contract metadata values keyed by metadata definition key."},"purchase_order_number":{"type":"string","example":"PO-12345","description":"Purchase order number set on the contract. It is copied onto every invoice the contract generates. Null when none was set."},"shipping_customer_id":{"type":"string","format":"uuid","nullable":true,"description":"The customer the contract ships to. Equal to customer_id when shipping to the billing customer. Null when no ship-to customer is set."},"billing_address":{"allOf":[{"$ref":"#/components/schemas/CustomerAddress"}],"nullable":true,"description":"The selected billing address, as currently stored on the billing customer. id is the value to send as billing_address_id. Null when no billing address is selected."},"shipping_address":{"allOf":[{"$ref":"#/components/schemas/CustomerAddress"}],"nullable":true,"description":"The selected shipping address, as currently stored on the ship-to customer. id is the value to send as shipping_address_id. Null when no shipping address is selected."}}},"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."},"ExternalReferenceType":{"type":"object","required":["id","slug","name"],"properties":{"id":{"type":"string","format":"uuid","example":"0199e21a-14c2-7abc-9d3e-112233445566"},"slug":{"type":"string","description":"The `type` value used in `external_references`.","example":"xyzSystemId"},"name":{"type":"string","description":"Label shown in Rillet.","example":"XYZ System ID"}}},"CreateExternalReferenceTypeRequest":{"type":"object","required":["slug","name"],"properties":{"slug":{"type":"string","minLength":1,"maxLength":100,"pattern":"^\\S+$","description":"The `type` value used in `external_references`. No whitespace; case-sensitive.","example":"xyzSystemId"},"name":{"type":"string","minLength":3,"maxLength":100,"description":"Label shown in Rillet. At least 3 characters.","example":"XYZ System ID"}}},"ContractItem":{"type":"object","required":["id","price","product_id","product_type","quantity","start_date","status","total_value","external_references"],"properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"product_type":{"description":"Whether this line sells a standalone product or a bundle.","allOf":[{"$ref":"#/components/schemas/ProductType"}]},"price":{"$ref":"#/components/schemas/Price"},"quantity":{"type":"string","format":"number","minimum":1,"example":"1"},"total_value":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"revenue_pattern":{"description":"How revenue from this line is recognized. Omitted on bundle lines.","allOf":[{"$ref":"#/components/schemas/RevenuePattern"}]},"progress_plan":{"allOf":[{"$ref":"#/components/schemas/ProgressPlan"}],"nullable":true,"description":"Saved contract snapshot for PROGRESS items. Product template edits do not change this plan."},"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."},"bundle":{"description":"Present only when product_type is BUNDLE.","allOf":[{"$ref":"#/components/schemas/ContractItemBundle"}]}},"allOf":[{"if":{"required":["product_type"],"properties":{"product_type":{"const":"PRODUCT"}}},"then":{"required":["revenue_pattern"]}},{"if":{"required":["product_type"],"properties":{"product_type":{"const":"BUNDLE"}}},"then":{"required":["bundle"]}}]},"ContractItemBundle":{"type":"object","description":"The bundle as it was when the contract was signed. Later changes to the bundle don't affect this contract.","required":["invoice_display","components"],"properties":{"invoice_display":{"$ref":"#/components/schemas/BundleInvoiceDisplay"},"components":{"type":"array","items":{"$ref":"#/components/schemas/ContractItemBundleComponent"}}}},"ContractItemBundleComponent":{"type":"object","required":["id","product_id","product_name","quantity","revenue_pattern","allocated_amount"],"properties":{"id":{"type":"string","format":"uuid","description":"Identifies this component on this contract line. Doesn't change between reads."},"product_id":{"type":"string","format":"uuid","description":"The component product."},"product_name":{"type":"string","description":"The product's name as recorded when the contract was signed."},"quantity":{"type":"string","format":"number","example":"1","description":"Units of this product in one unit of the bundle, as recorded when the contract was signed.\nThe line's total for this product is this quantity multiplied by the line's quantity.\n"},"revenue_pattern":{"description":"How this component recognizes revenue, as recorded when the contract was signed.","allOf":[{"$ref":"#/components/schemas/RevenuePattern"}]},"allocated_amount":{"description":"This component's share of the line's total value, in proportion to the standalone selling prices\nrecorded when the contract was signed. A line's components add up to its total_value.\n","allOf":[{"$ref":"#/components/schemas/RoundedMonetaryAmount"}]}}},"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":{"allOf":[{"$ref":"#/components/schemas/CustomerAddress"}],"description":"Billing address as it appears on the invoice. id is the customer address it was copied from, usable as billing_address_id; the other fields are the copy, which can differ from that address once the invoice is locked. id is omitted when that customer address no longer exists."},"shipping_address":{"allOf":[{"$ref":"#/components/schemas/CustomerAddress"}],"description":"Shipping address as it appears on the invoice. id is the ship-to customer's address it was copied from, usable as shipping_address_id. id is omitted when that customer address no longer exists."},"shipping_customer_id":{"type":"string","format":"uuid","nullable":true,"description":"The customer the invoice ships to. Equal to customer_id when shipping to the billing customer. Null when no ship-to customer is set."},"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"}},"metadata":{"type":"object","additionalProperties":{"type":"string"},"description":"Invoice metadata values keyed by metadata definition key."},"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."},"shipping_customer_id":{"allOf":[{"$ref":"#/components/schemas/NullableId"}],"description":"The customer to ship to. Omit to keep the current ship-to customer. Send null, or the billing customer's ID, to ship to the billing customer instead of a separate shipping customer. When the ship-to customer changes and shipping_address_id is omitted, the first address in the new ship-to customer's shipping_addresses is used. Only standalone invoices can change their ship-to selection; update the contract for contract invoices."},"billing_address_id":{"allOf":[{"$ref":"#/components/schemas/NullableId"}],"description":"ID of one of the billing customer's billing_addresses. Omit to keep the current billing address while it still exists on the customer. Send null to remove it; rejected when a tax provider is connected."},"shipping_address_id":{"allOf":[{"$ref":"#/components/schemas/NullableId"}],"description":"ID of one of the ship-to customer's shipping_addresses. Omit to keep the current shipping address while it still exists on the ship-to customer (unless shipping_customer_id changes). Send null to remove it. Changing either address recalculates tax."},"external_references":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ExternalReference"}},"metadata":{"allOf":[{"$ref":"#/components/schemas/InlineMetadataValues"}],"nullable":true},"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"},"metadata":{"allOf":[{"$ref":"#/components/schemas/InlineMetadataValues"}],"nullable":true},"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"},"shipping_customer_id":{"type":"string","format":"uuid","description":"The customer to ship to. Omit, or send customer_id, to ship to the billing customer."},"billing_address_id":{"allOf":[{"$ref":"#/components/schemas/NullableId"}],"description":"ID of one of the billing customer's billing_addresses. If omitted, the first address in the customer's billing_addresses is used, or none when the customer has no billing address. Send null for no billing address; rejected when a tax provider is connected. Rejected when the address does not belong to the billing customer or is not a billing address."},"shipping_address_id":{"allOf":[{"$ref":"#/components/schemas/NullableId"}],"description":"ID of one of the ship-to customer's shipping_addresses. If omitted, the first address in the ship-to customer's shipping_addresses is used, or none when it has no shipping address. Send null for no shipping address. Rejected when the address does not belong to the ship-to customer or is not a shipping address. When a shipping address is set it determines tax; otherwise the billing address does."},"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,"description":"Zero is accepted for a usage line whose metric saw no usage in the period; billing systems emit such lines, and the item's unit amounts then fall back to its totals."},"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"},"service_period":{"allOf":[{"$ref":"#/components/schemas/CalendarPeriod"}],"nullable":true,"description":"On update, omitting this field or sending null clears an existing service period. Supply the range to retain or change it."},"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"},"metadata":{"$ref":"#/components/schemas/InlineMetadataValues"}}},"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"},"metadata":{"$ref":"#/components/schemas/InlineMetadataValues"}}},"Bill":{"allOf":[{"$ref":"#/components/schemas/CreateBillRequest"},{"type":"object","required":["id","status","updated_at"],"properties":{"metadata":{"type":"object","description":"Values keyed by metadata definition key. Keys without a value are omitted.","additionalProperties":{"type":"string"}},"id":{"type":"string","format":"uuid"},"status":{"$ref":"#/components/schemas/BillStatus"},"pending_approval_request":{"allOf":[{"$ref":"#/components/schemas/PendingApprovalRequest"}],"nullable":true},"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","description":"A card charge. Exactly one of credit_card_account_code or funding_account_code must be provided.","required":["vendor_id","items","charge_date"],"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":{"writeOnly":true,"allOf":[{"$ref":"#/components/schemas/AccountCode"}],"description":"Write-only. The Credit Card liability account for a post-paid card charge."},"funding_account_code":{"writeOnly":true,"allOf":[{"$ref":"#/components/schemas/AccountCode"}],"description":"Write-only. The bank account reduced directly by a pre-funded card charge."},"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"},"pending_approval_request":{"allOf":[{"$ref":"#/components/schemas/PendingApprovalRequest"}],"nullable":true},"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"},"pending_approval_request":{"allOf":[{"$ref":"#/components/schemas/PendingApprovalRequest"}],"nullable":true},"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":["amount","date","account_code"],"properties":{"amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"date":{"type":"string","format":"date"},"account_code":{"$ref":"#/components/schemas/AccountCode"}}},"ReimbursementPayment":{"type":"object","required":["id","status","reimbursement_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"}}},"ContractInvoiceSchedule":{"type":"object","description":"The computed invoice schedule for a contract, returned by the preview endpoint. When resubmitted on create as invoice_schedule it replaces the FIXED billing layout with an arbitrary set of invoices: for each contract item the submitted FIXED line totals must sum to its computed value (redistribution only), and USAGE / USAGE_COMMITMENT lines are computed by the system and must not be submitted. Revenue recognition and TCV are unaffected. See ContractInvoiceScheduleItem for the per-line rules.","required":["invoices"],"properties":{"invoices":{"type":"array","items":{"$ref":"#/components/schemas/ContractInvoiceScheduleEntry"}}}},"ContractInvoiceScheduleEntry":{"type":"object","required":["issue_date","currency","total","items"],"properties":{"issue_date":{"type":"string","format":"date","description":"Editable on create. Must fall within the contract period and outside any closed book-close period."},"currency":{"type":"string","example":"USD"},"total":{"$ref":"#/components/schemas/RoundedMonetaryAmount"},"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/ContractInvoiceScheduleItem"}}}},"ContractInvoiceScheduleItem":{"type":"object","required":["description","quantity","price_type","unit_amount","total_amount","billing_period"],"properties":{"contract_item_id":{"type":"string","description":"The id of the contract item this line bills, echoing the item's request-scoped id. Resubmit it unchanged on create. Read-only."},"description":{"type":"string","description":"Editable on create."},"quantity":{"type":"string","description":"Editable on create for FIXED lines only, subject to total_amount == unit_amount × quantity. USAGE and USAGE_COMMITMENT lines must equal the computed value; changes to those lines are rejected. In all cases the sum of a contract item's line totals must equal its computed contract value (redistribution only) — the contract's total billed, revenue, and TCV are unaffected."},"price_type":{"type":"string","enum":["FIXED","USAGE","USAGE_COMMITMENT"]},"unit_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount","description":"Editable on create for FIXED lines only, subject to total_amount == unit_amount × quantity. USAGE and USAGE_COMMITMENT lines must equal the computed value; changes to those lines are rejected. In all cases the sum of a contract item's line totals must equal its computed contract value (redistribution only) — the contract's total billed, revenue, and TCV are unaffected."},"total_amount":{"$ref":"#/components/schemas/RoundedMonetaryAmount","description":"Editable on create for FIXED lines only, subject to total_amount == unit_amount × quantity. USAGE and USAGE_COMMITMENT lines must equal the computed value; changes to those lines are rejected. In all cases the sum of a contract item's line totals must equal its computed contract value (redistribution only) — the contract's total billed, revenue, and TCV are unaffected."},"billing_period":{"$ref":"#/components/schemas/BillingPeriod","description":"Editable on create."}}},"BillingPeriod":{"type":"object","description":"The service/coverage window for this invoice line. Unbounded contracts surface sentinel dates 1900-01-01 (start) and 2300-12-31 (end). Editable on create; the create is rejected if end is before start.","required":["start","end"],"properties":{"start":{"type":"string","format":"date"},"end":{"type":"string","format":"date"}}},"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."}}},"MetadataEntityType":{"type":"string","enum":["BILL","CONTRACT","CUSTOMER","INVOICE"]},"MetadataValueType":{"type":"string","description":"TEXT values hold at most 256 characters and no line breaks.","enum":["TEXT"]},"MetadataDefinitionStatus":{"type":"string","description":"ARCHIVED definitions stop accepting new values but stay readable wherever a value exists.","enum":["ACTIVE","ARCHIVED"]},"MetadataDefinition":{"type":"object","required":["id","key","name","value_type","max_length","entity_types","status"],"properties":{"id":{"type":"string","format":"uuid"},"key":{"type":"string","maxLength":63,"description":"Permanent identifier derived from the name at creation, e.g. metadata.source_invoice_id. Never changes on rename; API consumers bind to it.","example":"metadata.source_invoice_id"},"name":{"type":"string","maxLength":50,"description":"Display label shown wherever the field is populated.","example":"source_invoice_id"},"description":{"type":"string","maxLength":500,"description":"Help text shown alongside the input. Omitted when not set."},"value_type":{"$ref":"#/components/schemas/MetadataValueType"},"max_length":{"type":"integer","description":"Maximum value length in characters for this definition, owned by the server. Read it from the response rather than hardcoding limits.","example":256},"entity_types":{"type":"array","items":{"$ref":"#/components/schemas/MetadataEntityType"}},"status":{"$ref":"#/components/schemas/MetadataDefinitionStatus"}}},"MetadataValues":{"type":"object","required":["metadata"],"properties":{"metadata":{"type":"object","description":"Values keyed by definition key. A key with no value on this record is omitted. Use\nlist-all-metadata-definitions for definition names, types and status.\n","additionalProperties":{"type":"string"},"example":{"metadata.source_invoice_id":"NS-INV-004821"}}}},"InlineMetadataValues":{"type":"object","description":"Partial metadata update keyed by definition key. Omitting this property preserves all\nexisting metadata. When supplied, omitted keys remain unchanged; null, empty, or\nwhitespace-only values clear only the named key.\n","additionalProperties":{"type":"string","nullable":true}},"UpdateMetadataValuesRequest":{"type":"object","required":["metadata"],"properties":{"metadata":{"type":"object","description":"Values keyed by definition key. A full replacement: every active key omitted here is\ncleared, and null, empty, or whitespace-only values clear one key. Values are trimmed;\nTEXT values allow at most 256 characters and no line breaks.\n","additionalProperties":{"type":"string","nullable":true},"example":{"metadata.source_invoice_id":"NS-INV-004821"}}}},"PatchMetadataValuesRequest":{"type":"object","required":["metadata"],"properties":{"metadata":{"type":"object","description":"Values keyed by definition key. A partial update: keys omitted here are left unchanged,\nand null, empty, or whitespace-only values clear one key. Values are trimmed; TEXT\nvalues allow at most 256 characters and no line breaks.\n","additionalProperties":{"type":"string","nullable":true},"example":{"metadata.source_invoice_id":"NS-INV-004821"}}}},"BulkUpdateInvoiceMetadataRequest":{"type":"object","required":["invoices"],"properties":{"invoices":{"type":"array","minItems":1,"maxItems":1000,"items":{"$ref":"#/components/schemas/BulkInvoiceMetadataUpdate"}}}},"BulkInvoiceMetadataUpdate":{"type":"object","required":["invoice_id","metadata"],"properties":{"invoice_id":{"type":"string","format":"uuid"},"metadata":{"type":"object","description":"Partial update for this invoice. Omitted keys are left unchanged; null or empty values clear a key.","additionalProperties":{"type":"string","nullable":true}}}},"BulkUpdateInvoiceMetadataResponse":{"type":"object","required":["invoices"],"properties":{"invoices":{"type":"array","items":{"$ref":"#/components/schemas/BulkInvoiceMetadataResult"}}}},"BulkInvoiceMetadataResult":{"type":"object","required":["invoice_id","metadata"],"properties":{"invoice_id":{"type":"string","format":"uuid"},"metadata":{"type":"object","additionalProperties":{"type":"string"}}}},"BulkUpdateBillMetadataRequest":{"type":"object","required":["bills"],"properties":{"bills":{"type":"array","minItems":1,"maxItems":1000,"items":{"$ref":"#/components/schemas/BulkBillMetadataUpdate"}}}},"BulkBillMetadataUpdate":{"type":"object","required":["bill_id","metadata"],"properties":{"bill_id":{"type":"string","format":"uuid"},"metadata":{"type":"object","description":"Partial update for this bill. Omitted keys are left unchanged; null or empty values clear a key.","additionalProperties":{"type":"string","nullable":true}}}},"BulkUpdateBillMetadataResponse":{"type":"object","required":["bills"],"properties":{"bills":{"type":"array","items":{"$ref":"#/components/schemas/BulkBillMetadataResult"}}}},"BulkBillMetadataResult":{"type":"object","required":["bill_id","metadata"],"properties":{"bill_id":{"type":"string","format":"uuid"},"metadata":{"type":"object","additionalProperties":{"type":"string"}}}},"BulkUpdateCustomerMetadataRequest":{"type":"object","required":["customers"],"properties":{"customers":{"type":"array","minItems":1,"maxItems":1000,"items":{"$ref":"#/components/schemas/BulkCustomerMetadataUpdate"}}}},"BulkCustomerMetadataUpdate":{"type":"object","required":["customer_id","metadata"],"properties":{"customer_id":{"type":"string","format":"uuid"},"metadata":{"type":"object","description":"Partial update for this customer. Omitted keys are left unchanged; null or empty values clear a key.","additionalProperties":{"type":"string","nullable":true}}}},"BulkUpdateCustomerMetadataResponse":{"type":"object","required":["customers"],"properties":{"customers":{"type":"array","items":{"$ref":"#/components/schemas/BulkCustomerMetadataResult"}}}},"BulkCustomerMetadataResult":{"type":"object","required":["customer_id","metadata"],"properties":{"customer_id":{"type":"string","format":"uuid"},"metadata":{"type":"object","additionalProperties":{"type":"string"}}}},"BulkUpdateContractMetadataRequest":{"type":"object","required":["contracts"],"properties":{"contracts":{"type":"array","minItems":1,"maxItems":1000,"items":{"$ref":"#/components/schemas/BulkContractMetadataUpdate"}}}},"BulkContractMetadataUpdate":{"type":"object","required":["contract_id","metadata"],"properties":{"contract_id":{"type":"string","format":"uuid"},"metadata":{"type":"object","description":"Partial update for this contract. Omitted keys are left unchanged; null or empty values clear a key.","additionalProperties":{"type":"string","nullable":true}}}},"BulkUpdateContractMetadataResponse":{"type":"object","required":["contracts"],"properties":{"contracts":{"type":"array","items":{"$ref":"#/components/schemas/BulkContractMetadataResult"}}}},"BulkContractMetadataResult":{"type":"object","required":["contract_id","metadata"],"properties":{"contract_id":{"type":"string","format":"uuid"},"metadata":{"type":"object","additionalProperties":{"type":"string"}}}},"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.\nChanges that only affect customer metadata do not emit this webhook.\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"}}}}}}}}}