{"components": {"headers": {"RateLimit-Limit": {"description": "Requests allowed per window for the limit closest to being exhausted (per token or per IP). Sent on every authenticated response.", "schema": {"minimum": 0, "type": "integer"}}, "RateLimit-Remaining": {"description": "Requests left in the current window; `0` on a `429`.", "schema": {"minimum": 0, "type": "integer"}}, "RateLimit-Reset": {"description": "Seconds until the current window frees capacity (a delay, not a timestamp).", "schema": {"minimum": 0, "type": "integer"}}}, "schemas": {"AddBillableMetricFiltersRequest": {"additionalProperties": false, "description": "Filters to add, or values to merge into existing filters. Nothing is removed.", "properties": {"filters": {"description": "New keys create filters; values for an existing key are merged.", "items": {"$ref": "#/components/schemas/NewBillableMetricFilter"}, "maxItems": 100, "minItems": 1, "title": "Filters", "type": "array"}}, "required": ["filters"], "title": "AddBillableMetricFiltersRequest", "type": "object"}, "AggregationMethod": {"description": "How a guided metric turns a billing period's usage events into one quantity.\n\n- `count`: number of matching events.\n- `sum`: total of a numeric property across events.\n- `avg`: average of a numeric property.\n- `max`: largest value of a numeric property.\n- `min`: smallest value of a numeric property.\n- `unique_count`: number of distinct values of a property.\n- `latest`: value of a numeric property on the most recent event (0 when there is none).", "enum": ["count", "sum", "avg", "max", "min", "unique_count", "latest"], "title": "AggregationMethod", "type": "string"}, "AmountDiscount": {"additionalProperties": false, "description": "Flat monetary reduction of the discounted prices' billed amount.", "properties": {"amount": {"description": "Amount deducted, in `currency`.", "examples": ["150000.00"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Amount", "type": "string"}, "currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "Currency `amount` is denominated in.", "examples": ["CLP"]}, "discount_type": {"const": "amount", "description": "Always `amount` for a flat monetary discount.", "examples": ["amount"], "title": "Discount Type", "type": "string"}, "name": {"description": "Name of the discount, used as its invoice label unless overridden.", "examples": ["Launch discount"], "maxLength": 255, "minLength": 1, "title": "Name", "type": "string"}, "name_on_invoice": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Overrides the discount's invoice label. Null uses `name`. Invoice line label. May use `{{month}}`, `{{year}}` and `{{service_period}}`. Service periods render as dd/mm/yyyy - dd/mm/yyyy, with disjoint ranges separated by '; '. Referencing service_period requires complete service dates; unresolved or overlong output is rejected. Month/year are substituted from the line's billing period (e.g. `\"saas bulk {{month}} {{year}}\"` prints `\"saas bulk agosto 2026\"`). Any other variable is rejected.", "title": "Name On Invoice"}, "restrict_to_amount_selector": {"anyOf": [{"maxLength": 100, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Key of the amount selector whose selected amount this discount applies to. Set either this or `restrict_to_prices`, not both.", "examples": ["platform_fee_floor"], "title": "Restrict To Amount Selector"}, "restrict_to_prices": {"anyOf": [{"items": {"format": "uuid", "type": "string"}, "maxItems": 50, "minItems": 1, "type": "array"}, {"type": "null"}], "description": "Ids of the phase prices this discount applies to. Set either this or `restrict_to_amount_selector`, not both.", "title": "Restrict To Prices"}, "separate_invoice_line": {"default": true, "description": "True shows the discount as its own negative invoice line; false folds it into the discounted line's amount.", "title": "Separate Invoice Line", "type": "boolean"}}, "required": ["name", "discount_type", "amount", "currency"], "title": "AmountDiscount", "type": "object"}, "AmountSelector": {"additionalProperties": false, "description": "Bills only the lowest or highest computed amount among the candidate prices.", "properties": {"candidate_prices": {"description": "Ids of the phase prices whose computed amounts compete.", "items": {"format": "uuid", "type": "string"}, "maxItems": 25, "minItems": 2, "title": "Candidate Prices", "type": "array"}, "name_on_invoice": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Invoice label for the selected amount. Invoice line label. May use `{{month}}`, `{{year}}` and `{{service_period}}`. Service periods render as dd/mm/yyyy - dd/mm/yyyy, with disjoint ranges separated by '; '. Referencing service_period requires complete service dates; unresolved or overlong output is rejected. Month/year are substituted from the line's billing period (e.g. `\"saas bulk {{month}} {{year}}\"` prints `\"saas bulk agosto 2026\"`). Any other variable is rejected.", "title": "Name On Invoice"}, "operation": {"$ref": "#/components/schemas/AmountSelectorOperation", "description": "`min` bills the lowest candidate amount; `max` bills the highest.", "examples": ["max"]}, "selector_key": {"description": "Phase-unique key for this selector; discounts can target it through `restrict_to_amount_selector`.", "examples": ["platform_fee_floor"], "maxLength": 100, "minLength": 1, "title": "Selector Key", "type": "string"}}, "required": ["selector_key", "operation", "candidate_prices"], "title": "AmountSelector", "type": "object"}, "AmountSelectorOperation": {"description": "Which member charge an amount selector invoices each billing period.\n\n- `min`: only the member charge with the lowest computed amount.\n- `max`: only the member charge with the highest computed amount.\n\nTies go to the member listed first.", "enum": ["min", "max"], "title": "AmountSelectorOperation", "type": "string"}, "AverageRevenueReport": {"additionalProperties": false, "description": "Average invoiced revenue per customer or per contract over an inclusive date range.", "properties": {"average_revenue": {"anyOf": [{"$ref": "#/components/schemas/ReportMoney"}, {"type": "null"}], "description": "Average invoiced revenue per unit; null when there is no unit to divide by."}, "date_from": {"description": "First day of the range (inclusive).", "examples": ["2026-01-01"], "format": "date", "title": "Date From", "type": "string"}, "date_to": {"description": "Last day of the range (inclusive).", "examples": ["2026-01-31"], "format": "date", "title": "Date To", "type": "string"}}, "required": ["date_from", "date_to", "average_revenue"], "title": "AverageRevenueReport", "type": "object"}, "AverageRevenueUnit": {"description": "What revenue is averaged over.\n\n- `customer`: revenue per invoiced customer.\n- `contract`: revenue per invoiced contract.", "enum": ["customer", "contract"], "title": "AverageRevenueUnit", "type": "string"}, "BillableMetric": {"additionalProperties": false, "description": "A billable metric: how usage events are measured into a quantity that prices bill.", "properties": {"created_at": {"description": "When the metric was created.", "examples": ["2026-01-01T00:00:00.000Z"], "format": "date-time", "title": "Created At", "type": "string"}, "definition_mode": {"$ref": "#/components/schemas/BillableMetricDefinitionMode", "description": "Whether the metric is defined by a structured definition or by raw SQL.", "examples": ["guided"]}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Internal explanation of what the metric measures.", "examples": ["Number of billable API requests made in the period."], "title": "Description"}, "filters": {"description": "Event properties and values that prices can target separately.", "items": {"$ref": "#/components/schemas/BillableMetricFilter"}, "title": "Filters", "type": "array"}, "id": {"description": "Unique ID of the billable metric.", "examples": ["01936f2e-4c6a-7b2c-8d0e-1f2a3b4c5d6e"], "format": "uuid", "title": "Id", "type": "string"}, "item_id": {"description": "ID of the catalog item this metric measures.", "examples": ["01936f2e-5a7b-7c3d-9e1f-2a3b4c5d6e7f"], "format": "uuid", "title": "Item Id", "type": "string"}, "manual_usage_supported": {"description": "Whether usage for this metric can be entered by hand.", "examples": [true], "title": "Manual Usage Supported", "type": "boolean"}, "metric_definition": {"anyOf": [{"$ref": "#/components/schemas/MetricDefinition"}, {"type": "null"}], "description": "Structured definition; present for guided metrics."}, "name": {"description": "Name of the metric shown in the dashboard.", "examples": ["API requests"], "title": "Name", "type": "string"}, "name_on_invoice": {"description": "Name printed on invoice lines for this metric.", "examples": ["API requests"], "title": "Name On Invoice", "type": "string"}, "sql_expression": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Aggregate SQL that computes the quantity (generated for guided metrics). `null` unless the token has the `billable_metrics:sql` scope (or `full_access`).", "examples": ["SUM(CASE WHEN event_name = 'api_request' THEN (properties->>'tokens')::numeric END)"], "title": "Sql Expression"}, "updated_at": {"description": "When the metric was last changed.", "examples": ["2026-01-01T00:00:00.000Z"], "format": "date-time", "title": "Updated At", "type": "string"}, "usage_entry_schema": {"anyOf": [{"$ref": "#/components/schemas/UsageEntrySchema"}, {"type": "null"}], "description": "Shape of usage entered by hand for this metric, if any."}, "version": {"description": "Optimistic-concurrency version; send it back as `If-Match`.", "examples": [1], "title": "Version", "type": "integer"}}, "required": ["id", "item_id", "name", "name_on_invoice", "definition_mode", "manual_usage_supported", "created_at", "updated_at", "version"], "title": "BillableMetric", "type": "object"}, "BillableMetricDefinitionMode": {"description": "How a billable metric is defined.\n\n- `guided`: you give an event name and an aggregation, and the SQL is generated for you.\n- `sql`: you write the aggregate SQL expression yourself.", "enum": ["guided", "sql"], "title": "BillableMetricDefinitionMode", "type": "string"}, "BillableMetricEvaluation": {"additionalProperties": false, "description": "The metric's computed value for one billing entity over a time window. Nothing is saved.", "properties": {"billing_entity_id": {"description": "The billing entity whose usage was evaluated.", "examples": ["01936f2e-2a4b-7f0a-9b8c-7d6e5f4a3b2c"], "format": "uuid", "title": "Billing Entity Id", "type": "string"}, "breakdown": {"description": "Value per `breakdown_by` property value. Empty when no breakdown was requested.", "items": {"$ref": "#/components/schemas/BillableMetricEvaluationBreakdown"}, "title": "Breakdown", "type": "array"}, "customer_id": {"description": "ID of the customer the billing entity belongs to.", "examples": ["01936f2e-1f3a-7e9b-8a7c-6d5e4f3a2b1c"], "format": "uuid", "title": "Customer Id", "type": "string"}, "event_count": {"description": "Number of usage events that matched the metric in the window.", "examples": [42], "title": "Event Count", "type": "integer"}, "evidence": {"$ref": "#/components/schemas/BillableMetricEvaluationEvidence", "description": "Which data the evaluation was based on."}, "metric": {"$ref": "#/components/schemas/EvaluatedBillableMetric", "description": "The billable metric that was evaluated."}, "timeframe": {"$ref": "#/components/schemas/BillableMetricEvaluationTimeframe", "description": "The window the evaluation covered."}, "value": {"description": "Decimal string.", "examples": ["1250.5"], "title": "Value", "type": "string"}}, "required": ["metric", "billing_entity_id", "customer_id", "timeframe", "value", "event_count", "breakdown", "evidence"], "title": "BillableMetricEvaluation", "type": "object"}, "BillableMetricEvaluationBreakdown": {"additionalProperties": false, "description": "The metric's value for one value of the `breakdown_by` property.", "properties": {"dimension_value": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Value of the `breakdown_by` property. Null for events without it.", "examples": ["us"], "title": "Dimension Value"}, "event_count": {"description": "Number of usage events in this group.", "examples": [42], "title": "Event Count", "type": "integer"}, "value": {"description": "Decimal string.", "examples": ["1250.5"], "title": "Value", "type": "string"}}, "required": ["dimension_value", "value", "event_count"], "title": "BillableMetricEvaluationBreakdown", "type": "object"}, "BillableMetricEvaluationEvidence": {"additionalProperties": false, "description": "Facts that show which data the evaluation was based on.", "properties": {"data_visible_through": {"description": "Ingestion cutoff used: events received after this instant were not visible to the evaluation.", "examples": ["2026-02-01T00:05:00.000Z"], "format": "date-time", "title": "Data Visible Through", "type": "string"}, "first_event": {"anyOf": [{"$ref": "#/components/schemas/EvaluatedEvent"}, {"type": "null"}], "description": "Earliest usage event counted. Null when no event matched."}, "last_event": {"anyOf": [{"$ref": "#/components/schemas/EvaluatedEvent"}, {"type": "null"}], "description": "Latest usage event counted. Null when no event matched."}}, "required": ["data_visible_through"], "title": "BillableMetricEvaluationEvidence", "type": "object"}, "BillableMetricEvaluationMode": {"description": "Which of the metric's filters the evaluation applies.\n\n- `billable`: applies the metric's filters as billing would, narrowed to any `filters` you send.\n- `raw`: applies only the filters you send, so events outside the metric's filters count too.", "enum": ["billable", "raw"], "title": "BillableMetricEvaluationMode", "type": "string"}, "BillableMetricEvaluationTimeframe": {"additionalProperties": false, "description": "The window the evaluation covered, from `start` (inclusive) to `end` (exclusive), in UTC.", "properties": {"end": {"description": "Window end (exclusive).", "examples": ["2026-02-01T00:00:00.000Z"], "format": "date-time", "title": "End", "type": "string"}, "start": {"description": "Window start (inclusive).", "examples": ["2026-01-01T00:00:00.000Z"], "format": "date-time", "title": "Start", "type": "string"}}, "required": ["start", "end"], "title": "BillableMetricEvaluationTimeframe", "type": "object"}, "BillableMetricEvaluationWindow": {"additionalProperties": false, "description": "Time window to evaluate, from `start` (inclusive) to `end` (exclusive).\n\n`end` must be after `start`, and the window may span at most 31 days; a longer\nwindow is rejected with 422 `invalid_evaluation`.", "properties": {"end": {"description": "Window end (exclusive, UTC offset required).", "examples": ["2026-02-01T00:00:00Z"], "format": "date-time", "title": "End", "type": "string"}, "start": {"description": "Window start (inclusive, UTC offset required).", "examples": ["2026-01-01T00:00:00Z"], "format": "date-time", "title": "Start", "type": "string"}}, "required": ["start", "end"], "title": "BillableMetricEvaluationWindow", "type": "object"}, "BillableMetricFilter": {"additionalProperties": false, "description": "An event property and values that prices can target separately.", "properties": {"id": {"description": "Unique ID of the filter.", "examples": ["01936f2e-6b8c-7d4e-8f2a-3b4c5d6e7f80"], "format": "uuid", "title": "Id", "type": "string"}, "key": {"description": "Key inside the usage event's `properties` to filter on.", "examples": ["region"], "title": "Key", "type": "string"}, "values": {"description": "Values of `key` that prices can target separately.", "examples": [["us", "eu"]], "items": {"type": "string"}, "title": "Values", "type": "array"}}, "required": ["id", "key", "values"], "title": "BillableMetricFilter", "type": "object"}, "BillableMetricFilterPage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/BillableMetricFilter"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[BillableMetricFilter]", "type": "object"}, "BillableMetricPage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/BillableMetric"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[PublicBillableMetric]", "type": "object"}, "BillingEntity": {"additionalProperties": false, "description": "A customer's billing entity: who invoices are issued to, under which terms, and who\nreceives them.", "example": {"billing_profile": {"address": {"city": "Santiago", "comuna": "Las Condes", "country": "CL", "district": "Las Condes", "line1": "Av. Apoquindo 4700", "line2": "Oficina 1201", "postal_code": "7550000", "state": "Región Metropolitana"}, "created_at": "2026-07-01T09:15:00.000Z", "default_currency": "CLP", "display_name": "Acme Corp — Main Billing", "external_references": [], "id": "01909e26-aaaa-7f6d-9a7b-8c0d1e2f3a4b", "legal_name": "Acme Corp SpA", "metadata": {}, "tax_id": {"country": "CL", "type": "rut", "value": "76.123.456-7"}, "timezone": "America/Santiago", "updated_at": "2026-07-01T09:15:00.000Z", "version": 1}, "contacts": [], "created_at": "2026-07-01T09:15:00.000Z", "customer_id": "01909e26-7f2b-7c3e-8b1a-2f4e6d8a1c3b", "default_document_family": "invoice", "deliverable_contact_roles": ["billing"], "external_references": [], "has_xml_email_address": false, "id": "01909e26-e2b5-7f6d-9a7b-8c0d1e2f3a4b", "is_default": true, "metadata": {}, "payment_terms_days": 30, "payment_terms_type": "net", "status": "active", "tax_status": "taxed", "updated_at": "2026-07-01T09:15:00.000Z", "version": 1}, "properties": {"archived_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When the billing entity was archived (UTC, RFC 3339). Null unless archived.", "examples": [null], "title": "Archived At"}, "billing_profile": {"anyOf": [{"$ref": "#/components/schemas/BillingEntityBillingProfile"}, {"type": "null"}], "description": "The legal/tax identity. Null only if it could not be loaded."}, "contacts": {"description": "The people who receive correspondence for it.", "items": {"$ref": "#/components/schemas/BillingEntityContact"}, "title": "Contacts", "type": "array"}, "created_at": {"description": "When the billing entity was created (UTC, RFC 3339).", "examples": ["2026-07-01T09:15:00.000Z"], "format": "date-time", "title": "Created At", "type": "string"}, "customer_id": {"description": "The customer this billing entity belongs to.", "examples": ["01909e26-7f2b-7c3e-8b1a-2f4e6d8a1c3b"], "format": "uuid", "title": "Customer Id", "type": "string"}, "default_document_family": {"$ref": "#/components/schemas/DocumentFamily", "description": "Kind of document issued to this billing entity by default.", "examples": ["invoice"]}, "deliverable_contact_roles": {"description": "Roles held by at least one contact with an active email address, i.e. the correspondence that can actually be delivered.", "examples": [["billing", "collections"]], "items": {"$ref": "#/components/schemas/ContactRoleKind"}, "title": "Deliverable Contact Roles", "type": "array"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Free-text note about the billing entity. Null when not set.", "examples": ["Billing for the Santiago office"], "title": "Description"}, "external_references": {"description": "Identifiers of this billing entity in your other systems.", "items": {"$ref": "#/components/schemas/CustomerExternalReference"}, "title": "External References", "type": "array"}, "has_xml_email_address": {"default": false, "description": "Whether at least one contact with an active email receives the XML of issued fiscal documents (the `xml_email` role).", "examples": [false], "title": "Has Xml Email Address", "type": "boolean"}, "id": {"description": "Unique identifier of the billing entity.", "examples": ["01909e26-e2b5-7f6d-9a7b-8c0d1e2f3a4b"], "format": "uuid", "title": "Id", "type": "string"}, "is_default": {"description": "Whether this is the customer's default billing entity (exactly one is).", "examples": [true], "title": "Is Default", "type": "boolean"}, "metadata": {"additionalProperties": {"$ref": "#/components/schemas/JsonValue"}, "description": "Free-form JSON key/value data you stored on the billing entity.", "examples": [{"erp_code": "C-1042"}], "title": "Metadata", "type": "object"}, "payment_terms_days": {"anyOf": [{"type": "integer"}, {"type": "null"}], "description": "Days after issue an invoice is due, for `net` terms. Null when due on receipt.", "examples": [30], "title": "Payment Terms Days"}, "payment_terms_type": {"$ref": "#/components/schemas/PaymentTermsType", "description": "How the due date of invoices is computed.", "examples": ["net"]}, "status": {"$ref": "#/components/schemas/BillingEntityStatus", "description": "Lifecycle status of the billing entity.", "examples": ["active"]}, "tax_status": {"$ref": "#/components/schemas/TaxStatus", "description": "How tax applies to invoices for this billing entity.", "examples": ["taxed"]}, "updated_at": {"description": "When the billing entity was last changed (UTC, RFC 3339).", "examples": ["2026-07-01T09:15:00.000Z"], "format": "date-time", "title": "Updated At", "type": "string"}, "version": {"description": "Version of the billing entity, incremented on every change. Equals the `ETag` header; send it as `If-Match` when updating or deleting.", "examples": [1], "title": "Version", "type": "integer"}, "warnings": {"description": "Operational notices returned after updating the billing entity.", "items": {"type": "string"}, "title": "Warnings", "type": "array"}}, "required": ["id", "customer_id", "is_default", "status", "payment_terms_type", "tax_status", "default_document_family", "created_at", "updated_at", "version"], "title": "BillingEntity", "type": "object"}, "BillingEntityBillingProfile": {"additionalProperties": false, "description": "The legal and tax identity invoices are issued to.\n\nReturned inside a billing entity, and on its own by the billing-profile\nendpoints, whose `ETag` is this profile's `version`.", "example": {"address": {"city": "Santiago", "comuna": "Las Condes", "country": "CL", "district": "Las Condes", "line1": "Av. Apoquindo 4700", "line2": "Oficina 1201", "postal_code": "7550000", "state": "Región Metropolitana"}, "business_activity": "Servicios de software", "created_at": "2026-07-01T09:15:00.000Z", "default_currency": "CLP", "display_name": "Acme Corp — Main Billing", "external_references": [], "id": "01909e26-e2b5-7f6d-9a7b-8c0d1e2f3a4b", "legal_name": "Acme Corp SpA", "metadata": {}, "tax_id": {"country": "CL", "type": "rut", "value": "76.123.456-7"}, "timezone": "America/Santiago", "updated_at": "2026-07-01T09:15:00.000Z", "version": 1}, "properties": {"address": {"anyOf": [{"$ref": "#/components/schemas/PostalAddress"}, {"type": "null"}], "description": "Legal (billing) address printed on invoices."}, "business_activity": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Line of business printed on fiscal documents. Null when not set.", "examples": ["Servicios de software"], "title": "Business Activity"}, "created_at": {"description": "When the billing profile was created (UTC, RFC 3339).", "examples": ["2026-07-01T09:15:00.000Z"], "format": "date-time", "title": "Created At", "type": "string"}, "default_currency": {"description": "ISO 4217 currency code invoices to this billing entity default to.", "examples": ["CLP"], "title": "Default Currency", "type": "string"}, "display_name": {"description": "Friendly name used to tell this billing entity apart in lists and emails.", "examples": ["Acme Corp — Main Billing"], "title": "Display Name", "type": "string"}, "external_references": {"description": "Identifiers of this billing profile in your other systems.", "items": {"$ref": "#/components/schemas/CustomerExternalReference"}, "title": "External References", "type": "array"}, "id": {"description": "Unique identifier of the billing profile.", "examples": ["01909e26-e2b5-7f6d-9a7b-8c0d1e2f3a4b"], "format": "uuid", "title": "Id", "type": "string"}, "legal_name": {"description": "Registered legal name printed on invoices and fiscal documents.", "examples": ["Acme Corp SpA"], "title": "Legal Name", "type": "string"}, "metadata": {"additionalProperties": {"$ref": "#/components/schemas/JsonValue"}, "description": "Free-form JSON key/value data you stored on the billing profile.", "examples": [{"erp_code": "C-1042"}], "title": "Metadata", "type": "object"}, "shipping_address": {"anyOf": [{"$ref": "#/components/schemas/PostalAddress"}, {"type": "null"}], "description": "Address goods or services are delivered to, when it differs. Null if unset."}, "tax_id": {"$ref": "#/components/schemas/TaxIdentifier", "description": "Tax identifier invoices are issued to; the same shape the create accepts."}, "timezone": {"description": "IANA timezone used to interpret dates for this billing entity.", "examples": ["America/Santiago"], "title": "Timezone", "type": "string"}, "updated_at": {"description": "When the billing profile was last changed (UTC, RFC 3339).", "examples": ["2026-07-01T09:15:00.000Z"], "format": "date-time", "title": "Updated At", "type": "string"}, "version": {"description": "Version of the billing profile, incremented on every change. Send it as `If-Match` when updating the billing profile.", "examples": [1], "title": "Version", "type": "integer"}}, "required": ["id", "tax_id", "display_name", "legal_name", "default_currency", "timezone", "created_at", "updated_at", "version"], "title": "BillingEntityBillingProfile", "type": "object"}, "BillingEntityBillingProfileCreate": {"additionalProperties": false, "description": "The legal/tax identity supplied when creating a billing entity.", "properties": {"address": {"$ref": "#/components/schemas/PostalAddress", "description": "Legal (billing) address. `district` (the *comuna*) is required when `country` is `CL`."}, "business_activity": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "description": "Line of business printed on fiscal documents.", "examples": ["Servicios de software"], "title": "Business Activity"}, "default_currency": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "ISO 4217 code. Defaults to the organization's currency.", "examples": ["CLP"], "title": "Default Currency"}, "display_name": {"description": "Friendly name used to tell this billing entity apart in lists and emails.", "examples": ["Acme Corp — Main Billing"], "minLength": 1, "title": "Display Name", "type": "string"}, "legal_name": {"description": "Registered legal name printed on invoices and fiscal documents.", "examples": ["Acme Corp SpA"], "minLength": 1, "title": "Legal Name", "type": "string"}, "shipping_address": {"anyOf": [{"$ref": "#/components/schemas/PostalAddress"}, {"type": "null"}], "description": "Address goods or services are delivered to, when it differs."}, "tax_id": {"$ref": "#/components/schemas/TaxIdentifier", "description": "Tax identifier invoices are issued to."}, "timezone": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "description": "IANA timezone. Defaults from the address country (CL → America/Santiago).", "examples": ["America/Santiago"], "title": "Timezone"}}, "required": ["tax_id", "legal_name", "display_name", "address"], "title": "BillingEntityBillingProfileCreate", "type": "object"}, "BillingEntityBillingProfileUpdateRequest": {"additionalProperties": false, "description": "Body of ``PATCH .../billing-entities/{billing_entity_id}/billing-profile``.\n\nOmitted fields are left unchanged; a field sent as ``null`` is cleared where\nit is optional (``shipping_address``, ``business_activity``). ``tax_id`` is\nreplaced as a whole.", "example": {"address": {"city": "Santiago", "comuna": "Las Condes", "country": "CL", "district": "Las Condes", "line1": "Av. Apoquindo 4700", "line2": "Oficina 1201", "postal_code": "7550000", "state": "Región Metropolitana"}, "legal_name": "Acme Corp SpA"}, "properties": {"address": {"anyOf": [{"$ref": "#/components/schemas/PostalAddress"}, {"type": "null"}], "description": "Legal (billing) address, replaced as a whole. Omit to keep it; it cannot be null. `district` (the *comuna*) is required when `country` is `CL`."}, "business_activity": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "description": "Line of business printed on fiscal documents. Omit to keep it; `null` clears it.", "examples": ["Servicios de software"], "title": "Business Activity"}, "default_currency": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "ISO 4217 currency code invoices default to. Omit to keep it.", "examples": ["CLP"], "title": "Default Currency"}, "display_name": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "description": "Friendly name. Omit to keep it; it cannot be null.", "examples": ["Acme Corp — Main Billing"], "title": "Display Name"}, "external_references": {"anyOf": [{"items": {"$ref": "#/components/schemas/CustomerExternalReference"}, "type": "array"}, {"type": "null"}], "description": "Replaces the identifiers in your other systems as a whole; `[]` clears them. Omit to keep them.", "title": "External References"}, "legal_name": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "description": "Registered legal name. Omit to keep it; it cannot be null.", "examples": ["Acme Corp SpA"], "title": "Legal Name"}, "metadata": {"anyOf": [{"additionalProperties": {"$ref": "#/components/schemas/JsonValue"}, "type": "object"}, {"type": "null"}], "description": "Replaces the stored metadata as a whole. Omit to keep it.", "examples": [{"erp_code": "C-1042"}], "title": "Metadata"}, "shipping_address": {"anyOf": [{"$ref": "#/components/schemas/PostalAddress"}, {"type": "null"}], "description": "Delivery address, replaced as a whole. Omit to keep it; `null` clears it."}, "tax_id": {"anyOf": [{"$ref": "#/components/schemas/TaxIdentifier"}, {"type": "null"}], "description": "Tax identifier, replaced as a whole. Omit to keep it; it cannot be null."}, "timezone": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "description": "IANA timezone name. Omit to keep it.", "examples": ["America/Santiago"], "title": "Timezone"}}, "title": "BillingEntityBillingProfileUpdateRequest", "type": "object"}, "BillingEntityContact": {"additionalProperties": false, "description": "A whole contact as returned by the public API.\n\n``version`` is the value to send back as ``If-Match``; it is mirrored onto\nthe ``ETag`` response header by every route that returns this model.", "example": {"billing_entity_id": "01909e26-e2b5-7f6d-9a7b-8c0d1e2f3a4b", "emails": [{"added_at": "2026-07-01T09:15:00.000Z", "email": "billing@acmecorp.com", "id": "01909e26-aaaa-7a8b-9c0d-1e2f3a4b5c6d", "status": "active", "updated_at": "2026-07-01T09:15:00.000Z"}], "id": "01909e26-f4c6-7a8b-9c0d-1e2f3a4b5c6d", "name": "Jane Rivera", "phones": [], "roles": [{"is_default": true, "role": "billing"}], "version": 3}, "properties": {"billing_entity_id": {"description": "The billing entity this contact belongs to.", "examples": ["01909e26-e2b5-7f6d-9a7b-8c0d1e2f3a4b"], "format": "uuid", "title": "Billing Entity Id", "type": "string"}, "emails": {"description": "Every email address on the contact, including inactive ones.", "items": {"$ref": "#/components/schemas/ContactEmail"}, "title": "Emails", "type": "array"}, "first_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Given name. Null when not set.", "examples": ["Jane"], "title": "First Name"}, "id": {"description": "Unique identifier of the contact.", "examples": ["01909e26-f4c6-7a8b-9c0d-1e2f3a4b5c6d"], "format": "uuid", "title": "Id", "type": "string"}, "last_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Family name. Null when not set.", "examples": ["Rivera"], "title": "Last Name"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Full display name: `first_name` and `last_name` combined when either is set, otherwise the stored full name. Null when the contact has no name.", "examples": ["Jane Rivera"], "title": "Name"}, "phones": {"description": "Every phone number on the contact, including inactive ones.", "items": {"$ref": "#/components/schemas/ContactPhone"}, "title": "Phones", "type": "array"}, "roles": {"description": "The correspondence this contact receives. Empty means none.", "items": {"$ref": "#/components/schemas/ContactRole"}, "title": "Roles", "type": "array"}, "version": {"description": "Version of the contact, incremented on every change. Equals the `ETag` header; send it as `If-Match` when updating.", "examples": [3], "title": "Version", "type": "integer"}}, "required": ["id", "billing_entity_id", "name", "version"], "title": "BillingEntityContact", "type": "object"}, "BillingEntityContactPage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/BillingEntityContact"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[BillingEntityContact]", "type": "object"}, "BillingEntityCreateRequest": {"additionalProperties": false, "description": "Body of ``POST /customers/{customer_id}/billing-entities``.", "example": {"billing_profile": {"address": {"city": "Santiago", "comuna": "Las Condes", "country": "CL", "district": "Las Condes", "line1": "Av. Apoquindo 4700", "line2": "Oficina 1201", "postal_code": "7550000", "state": "Región Metropolitana"}, "display_name": "Acme Corp — Main Billing", "legal_name": "Acme Corp SpA", "tax_id": {"country": "CL", "type": "rut", "value": "76.123.456-7"}}, "default_document_family": "invoice", "payment_terms_days": 30, "set_as_default": true, "tax_status": "taxed"}, "properties": {"billing_profile": {"$ref": "#/components/schemas/BillingEntityBillingProfileCreate", "description": "The legal/tax identity invoices are issued to."}, "default_document_family": {"$ref": "#/components/schemas/DocumentFamily", "default": "invoice", "description": "Kind of document issued to this billing entity by default.", "examples": ["invoice"]}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Free-text note about the billing entity.", "examples": ["Billing for the Santiago office"], "title": "Description"}, "metadata": {"anyOf": [{"additionalProperties": {"$ref": "#/components/schemas/JsonValue"}, "type": "object"}, {"type": "null"}], "description": "Free-form JSON key/value metadata stored on the billing entity.", "examples": [{"erp_code": "C-1042"}], "title": "Metadata"}, "payment_terms_days": {"anyOf": [{"minimum": 0.0, "type": "integer"}, {"type": "null"}], "description": "Net days. Omit or 0 for due on receipt.", "examples": [30], "title": "Payment Terms Days"}, "set_as_default": {"default": false, "description": "Make this the customer's default billing entity. A customer's first billing entity always becomes the default.", "examples": [true], "title": "Set As Default", "type": "boolean"}, "tax_status": {"$ref": "#/components/schemas/TaxStatus", "default": "taxed", "description": "How tax applies to invoices for this billing entity.", "examples": ["taxed"]}}, "required": ["billing_profile"], "title": "BillingEntityCreateRequest", "type": "object"}, "BillingEntityPage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/BillingEntity"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[BillingEntity]", "type": "object"}, "BillingEntityStatus": {"description": "Lifecycle state of a billing entity.\n\n`active` can be invoiced and receives correspondence; `suspended` is\ntemporarily out of use: it cannot be picked for new invoices, payment\nmethods or customer emails; `archived` is retired (archived or deleted)\nand can no longer be updated.", "enum": ["active", "suspended", "archived"], "title": "BillingEntityStatus", "type": "string"}, "BillingEntityUpdateRequest": {"additionalProperties": false, "description": "Body of ``PATCH /customers/{customer_id}/billing-entities/{billing_entity_id}``.\n\nOmitted fields are left unchanged. ``set_as_default: true`` makes this the\ncustomer's default billing entity (the previous default stops being one).", "example": {"payment_terms_days": 45, "set_as_default": true}, "properties": {"apply_payment_terms_to_existing": {"default": false, "description": "Apply to existing contracts, unpaid/partially paid invoices, drafts and upcoming invoices. Issued document terms stay frozen; collections records the new agreement. Processing is asynchronous.", "title": "Apply Payment Terms To Existing", "type": "boolean"}, "default_document_family": {"anyOf": [{"$ref": "#/components/schemas/DocumentFamily"}, {"type": "null"}], "description": "Kind of document issued by default. Omit or null to keep it.", "examples": ["invoice"]}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Free-text note. Omit to keep it; `null` clears it.", "examples": ["Billing for the Santiago office"], "title": "Description"}, "external_references": {"anyOf": [{"items": {"$ref": "#/components/schemas/CustomerExternalReference"}, "type": "array"}, {"type": "null"}], "description": "Replaces the identifiers in your other systems as a whole; `[]` clears them. Omit or null to keep them.", "title": "External References"}, "metadata": {"anyOf": [{"additionalProperties": {"$ref": "#/components/schemas/JsonValue"}, "type": "object"}, {"type": "null"}], "description": "Replaces the stored metadata as a whole. Omit or null to keep it.", "examples": [{"erp_code": "C-1042"}], "title": "Metadata"}, "payment_terms_days": {"anyOf": [{"minimum": 0.0, "type": "integer"}, {"type": "null"}], "description": "Net days; 0 means due on receipt. Omit or null to keep the current terms.", "examples": [45], "title": "Payment Terms Days"}, "set_as_default": {"default": false, "description": "Send `true` to make this the customer's default billing entity. `false` or omitted changes nothing.", "examples": [true], "title": "Set As Default", "type": "boolean"}, "tax_status": {"anyOf": [{"$ref": "#/components/schemas/TaxStatus"}, {"type": "null"}], "description": "How tax applies to invoices. Omit or null to keep it.", "examples": ["taxed"]}}, "title": "BillingEntityUpdateRequest", "type": "object"}, "CancelContractRequest": {"additionalProperties": false, "description": "Cancel a contract. Intent is explicit through ``cancel_option``.\n\n- ``immediate``: cancel as of now; omit ``effective_at`` and ``cancellation_date``.\n- ``requested_date``: give exactly one of ``cancellation_date`` (last service day,\n  inclusive, in the billing timezone) or an offset-aware ``effective_at``. A future\n  cutoff schedules the cancellation; a past one backdates it.\n\n``issue_final_bill`` decides whether a final partial-period invoice is issued.\nIssued invoices are never changed; corrections go through credit notes.", "properties": {"cancel_option": {"$ref": "#/components/schemas/ContractCancelOption", "description": "Whether to cancel now or as of a requested date.", "examples": ["requested_date"]}, "cancellation_date": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Last day with service, inclusive, in the contract's billing timezone. Mutually exclusive with effective_at.", "examples": ["2026-09-30"], "title": "Cancellation Date"}, "effective_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Instant the cancellation takes effect, with a time zone offset. Use with `requested_date`; mutually exclusive with `cancellation_date`.", "examples": ["2026-09-30T23:59:59Z"], "title": "Effective At"}, "issue_final_bill": {"description": "Whether to issue a final invoice for the last, partial billing period.", "examples": [true], "title": "Issue Final Bill", "type": "boolean"}, "reason": {"anyOf": [{"maxLength": 2000, "type": "string"}, {"type": "null"}], "description": "Why the contract is being cancelled.", "examples": ["Customer chose not to renew."], "title": "Reason"}}, "required": ["cancel_option", "issue_final_bill"], "title": "CancelContractRequest", "type": "object"}, "Cap": {"additionalProperties": false, "description": "Maximum: claws back the excess when the constrained prices bill more than `amount`.", "properties": {"amount": {"description": "Constraint threshold, in `currency`.", "examples": ["150000.00"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Amount", "type": "string"}, "currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "Currency `amount` is denominated in.", "examples": ["CLP"]}, "name_on_invoice": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Invoice label for the adjustment. Invoice line label. May use `{{month}}`, `{{year}}` and `{{service_period}}`. Service periods render as dd/mm/yyyy - dd/mm/yyyy, with disjoint ranges separated by '; '. Referencing service_period requires complete service dates; unresolved or overlong output is rejected. Month/year are substituted from the line's billing period (e.g. `\"saas bulk {{month}} {{year}}\"` prints `\"saas bulk agosto 2026\"`). Any other variable is rejected.", "title": "Name On Invoice"}, "restrict_to_prices": {"description": "Ids of the phase prices this constraint aggregates over.", "items": {"format": "uuid", "type": "string"}, "maxItems": 25, "minItems": 1, "title": "Restrict To Prices", "type": "array"}, "separate_invoice_line": {"default": true, "description": "True shows the true-up / clawback as its own invoice line; false folds it into the constrained line's amount.", "title": "Separate Invoice Line", "type": "boolean"}}, "required": ["restrict_to_prices", "amount", "currency"], "title": "Cap", "type": "object"}, "CatalogItem": {"additionalProperties": false, "description": "A catalog item: a product or service that metrics measure and prices bill.", "properties": {"contracts_count": {"default": 0, "description": "Number of active contracts that reference this item.", "examples": [3], "title": "Contracts Count", "type": "integer"}, "created_at": {"description": "When the item was created.", "examples": ["2026-01-01T00:00:00.000Z"], "format": "date-time", "title": "Created At", "type": "string"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Free-text description.", "examples": ["Access to the public REST API, billed by usage."], "title": "Description"}, "id": {"description": "Item identifier.", "examples": ["01936f2e-5a7b-7c3d-9e1f-2a3b4c5d6e7f"], "format": "uuid", "title": "Id", "type": "string"}, "name": {"description": "Display name of the item.", "examples": ["API platform"], "title": "Name", "type": "string"}, "plans_count": {"default": 0, "description": "Number of plans that reference this item.", "examples": [1], "title": "Plans Count", "type": "integer"}, "status": {"$ref": "#/components/schemas/ItemStatus", "description": "Whether the item can be used by new metrics and prices.", "examples": ["active"]}, "updated_at": {"description": "When the item was last changed.", "examples": ["2026-01-01T00:00:00.000Z"], "format": "date-time", "title": "Updated At", "type": "string"}, "version": {"description": "Optimistic-concurrency version; send it back as `If-Match`.", "examples": [1], "title": "Version", "type": "integer"}}, "required": ["id", "name", "status", "created_at", "updated_at", "version"], "title": "CatalogItem", "type": "object"}, "CatalogItemPage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/CatalogItem"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[PublicCatalogItem]", "type": "object"}, "ChileanTaxpayer": {"additionalProperties": false, "description": "A Chilean taxpayer as registered with the tax authority (SII).", "properties": {"activities": {"description": "Every SII-registered economic activity, primary first.", "items": {"$ref": "#/components/schemas/ChileanTaxpayerActivity"}, "title": "Activities", "type": "array"}, "addresses": {"description": "Every SII-registered address, primary first.", "items": {"$ref": "#/components/schemas/ChileanTaxpayerAddress"}, "title": "Addresses", "type": "array"}, "email": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Email registered with the SII; null when none.", "examples": ["facturacion@comercialandes.cl"], "title": "Email"}, "has_activity": {"description": "True when at least one economic activity exists.", "examples": [true], "title": "Has Activity", "type": "boolean"}, "has_address": {"description": "True when at least one address exists.", "examples": [true], "title": "Has Address", "type": "boolean"}, "legal_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Registered legal name; null when the SII has none.", "examples": ["Comercial Andes SpA"], "title": "Legal Name"}, "lookup_source": {"$ref": "#/components/schemas/TaxpayerLookupSource", "default": "gov_registry", "description": "Where this lookup was resolved from.", "examples": ["gov_registry"]}, "tax_id": {"$ref": "#/components/schemas/TaxIdentifier", "description": "The looked-up RUT: canonical value without dots, with check digit.", "examples": [{"country": "CL", "type": "rut", "value": "76086428-5"}]}}, "required": ["tax_id", "has_activity", "has_address"], "title": "ChileanTaxpayer", "type": "object"}, "ChileanTaxpayerActivity": {"additionalProperties": false, "description": "An economic activity a Chilean taxpayer is registered for with the SII.", "properties": {"code": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "SII economic activity code.", "examples": ["620200"], "title": "Code"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "SII economic activity name.", "examples": ["Actividades de consultoria de informatica"], "title": "Name"}}, "title": "ChileanTaxpayerActivity", "type": "object"}, "ChileanTaxpayerAddress": {"additionalProperties": false, "description": "An address registered for a Chilean taxpayer with the SII.", "properties": {"branch_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "SII branch code of the address; null when not provided.", "examples": ["81297532"], "title": "Branch Code"}, "city": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "City.", "examples": ["Santiago"], "title": "City"}, "comuna": {"anyOf": [{"type": "string"}, {"type": "null"}], "deprecated": true, "description": "Deprecated alias of `district`, always emitted with the same value.", "examples": ["Las Condes"], "title": "Comuna"}, "country": {"default": "CL", "description": "ISO 3166-1 alpha-2 country; always `CL`.", "examples": ["CL"], "title": "Country", "type": "string"}, "district": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Chilean *comuna*, required by the SII on domestic invoices.", "examples": ["Las Condes"], "title": "District"}, "line1": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Street address line.", "examples": ["Av. Apoquindo 3000"], "title": "Line1"}, "phone": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Phone registered for the address; null when none.", "examples": ["+56 2 2345 6789"], "title": "Phone"}}, "title": "ChileanTaxpayerAddress", "type": "object"}, "CollectionBindingStatus": {"description": "Whether the customer exists on the provider that collects them.\n\n- `not_applicable`: Relvo collects, so no provider customer is needed.\n- `pending`: an external provider collects, but the customer is not yet created or\n  verified there.\n- `linked`: the customer has a verified record on the provider.", "enum": ["not_applicable", "pending", "linked"], "title": "CollectionBindingStatus", "type": "string"}, "CollectionProvider": {"description": "Who executes the collection.\n\n- `relvo`: Relvo collects, for example by rendering bank-transfer details on invoices.\n- `manual`: your team collects by hand outside any provider.\n- `wire_transfer`: collected by wire transfer outside any provider.\n- `toku`: collected through a Toku integration.\n- `stripe`: collected through a Stripe integration.\n- `fintoc`: collected through a Fintoc integration.\n\n`toku`, `stripe` and `fintoc` require an integration connection; the others do not.", "enum": ["relvo", "toku", "stripe", "fintoc", "manual", "wire_transfer"], "title": "CollectionProvider", "type": "string"}, "CollectionRail": {"additionalProperties": false, "description": "Who collects from the billing entity: the provider of its default payment method, or\nRelvo when it has none.", "properties": {"binding_status": {"$ref": "#/components/schemas/CollectionBindingStatus", "description": "Whether the customer exists on the provider.", "examples": ["not_applicable"]}, "provider_connection_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Your integration connection to the provider. Null when Relvo collects.", "examples": [null], "title": "Provider Connection Id"}, "provider_customer_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "The customer's identifier on the provider. Null when there is none yet.", "examples": [null], "title": "Provider Customer Id"}, "rail": {"$ref": "#/components/schemas/CollectionProvider", "description": "Who collects from the billing entity.", "examples": ["relvo"]}}, "required": ["rail", "provider_connection_id", "provider_customer_id", "binding_status"], "title": "CollectionRail", "type": "object"}, "CommercialReference": {"additionalProperties": false, "description": "A commercial reference printed on the invoice, such as a purchase order.", "properties": {"kind": {"$ref": "#/components/schemas/CommercialReferenceKind", "description": "Reference kind; an invoice holds at most one reference per kind.", "examples": ["purchase_order"]}, "note": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Free-text note printed with the reference; null if none.", "examples": ["Approved by procurement"], "title": "Note"}, "reference_date": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Date of the referenced document; null if not given.", "examples": ["2026-01-15"], "title": "Reference Date"}, "value": {"description": "The reference identifier, e.g. the purchase order number.", "examples": ["OC-4500123456"], "title": "Value", "type": "string"}}, "required": ["kind", "value", "reference_date", "note"], "title": "CommercialReference", "type": "object"}, "CommercialReferenceInput": {"additionalProperties": false, "description": "A commercial reference to print on the invoice, such as a purchase order.", "properties": {"kind": {"$ref": "#/components/schemas/CommercialReferenceKind", "description": "Reference kind; a draft holds at most one reference per kind.", "examples": ["purchase_order"]}, "note": {"anyOf": [{"maxLength": 80, "type": "string"}, {"type": "null"}], "description": "Free-text note printed with the reference.", "examples": ["Approved by procurement"], "title": "Note"}, "reference_date": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Date of the referenced document.", "examples": ["2026-01-15"], "title": "Reference Date"}, "value": {"description": "The reference identifier, e.g. the purchase order number.", "examples": ["OC-4500123456"], "maxLength": 80, "minLength": 1, "title": "Value", "type": "string"}}, "required": ["kind", "value"], "title": "CommercialReferenceInput", "type": "object"}, "CommercialReferenceKind": {"description": "A document or identifier the invoice cites: a prior tax document it\ncorrects or follows, or a buyer-side reference such as a purchase order.\n\nChilean SII document types (the SII reference code is in parentheses):\n\n- `invoice`: electronic invoice (33).\n- `invoice_exempt`: exempt electronic invoice (34).\n- `receipt`: electronic receipt, *boleta* (39).\n- `receipt_exempt`: exempt electronic receipt (41).\n- `invoice_settlement`: invoice settlement, *liquidación-factura* (43).\n- `purchase_invoice`: purchase invoice (46).\n- `dispatch_guide`: dispatch guide, *guía de despacho* (52).\n- `debit_note`: debit note (56).\n- `credit_note`: credit note (61).\n- `export_invoice`: export invoice (110).\n- `export_debit_note`: export debit note (111).\n- `export_credit_note`: export credit note (112).\n\nBuyer-side references:\n\n- `purchase_order`: the buyer's purchase order (801).\n- `purchase_note`: the buyer's purchase note or request form, *nota de pedido* (802).\n- `hes`: service entry sheet, *Hoja de Entrada de Servicios* (printed as `HES`).\n- `contract_reference`: a contract number supplied by the buyer (803).\n- `buyer_reference`: any other buyer-provided reference; carries no SII code.", "enum": ["invoice", "invoice_exempt", "receipt", "receipt_exempt", "invoice_settlement", "purchase_invoice", "dispatch_guide", "debit_note", "credit_note", "export_invoice", "export_debit_note", "export_credit_note", "purchase_order", "purchase_note", "hes", "contract_reference", "buyer_reference"], "title": "CommercialReferenceKind", "type": "string"}, "CommercialReferenceList": {"additionalProperties": false, "description": "Every commercial reference registered on one invoice.", "properties": {"items": {"description": "The invoice's commercial references.", "items": {"$ref": "#/components/schemas/CommercialReference"}, "title": "Items", "type": "array"}, "next_cursor": {"description": "Always null: this collection is bounded (an invoice holds at most one reference per kind).", "title": "Next Cursor", "type": "null"}}, "required": ["items", "next_cursor"], "title": "CommercialReferenceList", "type": "object"}, "CommercialReferenceParseStatus": {"description": "Reading status of a commercial reference read from an email or attachment.\n\n- `pending`: waiting to be read.\n- `parsing`: being read.\n- `accepted`: the reading was accepted, automatically or by a reviewer.\n- `needs_review`: a person must confirm or reject the reading.\n- `extraction_failed`: nothing usable could be read.", "enum": ["pending", "parsing", "accepted", "needs_review", "extraction_failed"], "title": "CommercialReferenceParseStatus", "type": "string"}, "Commitment": {"additionalProperties": false, "description": "Minimum: bills a true-up when the constrained prices bill less than `amount`.", "properties": {"amount": {"description": "Constraint threshold, in `currency`.", "examples": ["150000.00"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Amount", "type": "string"}, "currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "Currency `amount` is denominated in.", "examples": ["CLP"]}, "name_on_invoice": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Invoice label for the adjustment. Invoice line label. May use `{{month}}`, `{{year}}` and `{{service_period}}`. Service periods render as dd/mm/yyyy - dd/mm/yyyy, with disjoint ranges separated by '; '. Referencing service_period requires complete service dates; unresolved or overlong output is rejected. Month/year are substituted from the line's billing period (e.g. `\"saas bulk {{month}} {{year}}\"` prints `\"saas bulk agosto 2026\"`). Any other variable is rejected.", "title": "Name On Invoice"}, "restrict_to_prices": {"description": "Ids of the phase prices this constraint aggregates over.", "items": {"format": "uuid", "type": "string"}, "maxItems": 25, "minItems": 1, "title": "Restrict To Prices", "type": "array"}, "separate_invoice_line": {"default": true, "description": "True shows the true-up / clawback as its own invoice line; false folds it into the constrained line's amount.", "title": "Separate Invoice Line", "type": "boolean"}}, "required": ["restrict_to_prices", "amount", "currency"], "title": "Commitment", "type": "object"}, "CompleteMilestonePhaseRequest": {"additionalProperties": false, "description": "Complete a milestone phase, which bills it.", "properties": {"completed_at": {"description": "When the milestone was completed. Not in the future; billing runs at once.", "examples": ["2026-04-15T00:00:00Z"], "format": "date-time", "title": "Completed At", "type": "string"}}, "required": ["completed_at"], "title": "CompleteMilestonePhaseRequest", "type": "object"}, "ContactEmail": {"additionalProperties": false, "description": "One email channel on a contact.", "properties": {"added_at": {"description": "When this email address was added to the contact (UTC, RFC 3339).", "examples": ["2026-07-01T09:15:00.000Z"], "format": "date-time", "title": "Added At", "type": "string"}, "email": {"description": "The email address.", "examples": ["billing@acmecorp.com"], "title": "Email", "type": "string"}, "id": {"description": "Unique identifier of this email address on the contact.", "examples": ["01909e26-aaaa-7a8b-9c0d-1e2f3a4b5c6d"], "format": "uuid", "title": "Id", "type": "string"}, "status": {"$ref": "#/components/schemas/ContactEmailStatus", "description": "Delivery state. Only `active` addresses receive messages.", "examples": ["active"]}, "status_reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Human-readable note on why the status changed, such as a bounce detail. Null when none was recorded.", "examples": ["Mailbox does not exist"], "title": "Status Reason"}, "updated_at": {"description": "When this email address's status was last changed (UTC, RFC 3339).", "examples": ["2026-07-01T09:15:00.000Z"], "format": "date-time", "title": "Updated At", "type": "string"}}, "required": ["id", "email", "status", "added_at", "updated_at"], "title": "ContactEmail", "type": "object"}, "ContactEmailInput": {"additionalProperties": false, "description": "One email entry in an update-contact body.\n\nWith ``id``: reconciles that email's ``status``. Without ``id``: adds\n``email`` (required), which always starts ``active``.", "properties": {"email": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "description": "Email address to add. Required when `id` is omitted.", "examples": ["billing@acmecorp.com"], "title": "Email"}, "id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Id of an existing email address on this contact, to set its `status`. Omit to add a new address.", "examples": ["01909e26-aaaa-7a8b-9c0d-1e2f3a4b5c6d"], "title": "Id"}, "status": {"$ref": "#/components/schemas/ContactEmailStatus", "default": "active", "description": "Desired status of the existing address identified by `id`.", "examples": ["active"]}}, "title": "ContactEmailInput", "type": "object"}, "ContactEmailStatus": {"description": "Delivery state of an email channel.\n\n`active` can receive messages; `archived` was disabled; `bounced` failed\ndelivery (hard bounce); `opted_out` asked to be removed; `invalid` is\nmalformed.", "enum": ["active", "archived", "bounced", "opted_out", "invalid"], "title": "ContactEmailStatus", "type": "string"}, "ContactPhone": {"additionalProperties": false, "description": "One phone channel on a contact, in E.164.", "properties": {"added_at": {"description": "When this phone number was added to the contact (UTC, RFC 3339).", "examples": ["2026-07-01T09:15:00.000Z"], "format": "date-time", "title": "Added At", "type": "string"}, "id": {"description": "Unique identifier of this phone number on the contact.", "examples": ["01909e26-bbbb-7a8b-9c0d-1e2f3a4b5c6d"], "format": "uuid", "title": "Id", "type": "string"}, "phone": {"description": "The phone number in E.164 format.", "examples": ["+56912345678"], "title": "Phone", "type": "string"}, "status": {"$ref": "#/components/schemas/ContactPhoneStatus", "description": "Delivery state. Only `active` numbers are used.", "examples": ["active"]}, "status_reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Human-readable note on why the status changed, such as an opt-out note. Null when none was recorded.", "examples": ["Customer asked not to be called"], "title": "Status Reason"}, "updated_at": {"description": "When this phone number's status was last changed (UTC, RFC 3339).", "examples": ["2026-07-01T09:15:00.000Z"], "format": "date-time", "title": "Updated At", "type": "string"}}, "required": ["id", "phone", "status", "added_at", "updated_at"], "title": "ContactPhone", "type": "object"}, "ContactPhoneInput": {"additionalProperties": false, "description": "One phone entry in an update-contact body. Mirrors ``ContactEmailInput``.", "properties": {"country": {"$ref": "#/components/schemas/PhoneCountry", "default": "CL", "description": "Country used to interpret a number written in national format.", "examples": ["CL"]}, "id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Id of an existing phone number on this contact, to set its `status`. Omit to add a new number.", "examples": ["01909e26-bbbb-7a8b-9c0d-1e2f3a4b5c6d"], "title": "Id"}, "phone": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "description": "Phone number to add, in international (E.164) or national format. Required when `id` is omitted.", "examples": ["+56912345678"], "title": "Phone"}, "status": {"$ref": "#/components/schemas/ContactPhoneStatus", "default": "active", "description": "Desired status of the existing number identified by `id`.", "examples": ["active"]}}, "title": "ContactPhoneInput", "type": "object"}, "ContactPhoneStatus": {"description": "Delivery state of a phone channel.\n\n`active` can be used to reach the contact; `invalid` was found to be\nunusable; `opted_out` asked not to be contacted on it; `archived` was\nremoved from the contact. A channel that left `active` cannot return to it:\nadd the number again instead.", "enum": ["active", "invalid", "opted_out", "archived"], "title": "ContactPhoneStatus", "type": "string"}, "ContactRole": {"additionalProperties": false, "description": "One role assignment on a contact.", "properties": {"is_default": {"description": "Whether this contact is the single recipient for the role when a message needs exactly one.", "examples": [true], "title": "Is Default", "type": "boolean"}, "role": {"$ref": "#/components/schemas/ContactRoleKind", "description": "Which correspondence this contact receives.", "examples": ["billing"]}}, "required": ["role", "is_default"], "title": "ContactRole", "type": "object"}, "ContactRoleInput": {"additionalProperties": false, "description": "One role assignment in a create/update-contact body.", "properties": {"is_default": {"default": false, "description": "Marks this contact as the single recipient for the role when a message needs exactly one. At most one contact per billing entity may be the default for a role.", "examples": [true], "title": "Is Default", "type": "boolean"}, "role": {"$ref": "#/components/schemas/ContactRoleKind", "description": "Which correspondence this contact receives.", "examples": ["billing"]}}, "required": ["role"], "title": "ContactRoleInput", "type": "object"}, "ContactRoleKind": {"description": "Which correspondence a contact receives.\n\n`billing` receives invoices and approval requests; `collections` receives\npayment reminders and dunning; `commercial_reference` receives trade/credit\nreference requests; `xml_email` receives the machine-readable XML of each\nissued fiscal document (a delivery channel, not a person's job title).", "enum": ["billing", "collections", "commercial_reference", "xml_email"], "title": "ContactRoleKind", "type": "string"}, "Contract": {"additionalProperties": false, "description": "A contract, as returned by every read and every lifecycle action.\n\n``id`` is the stable lineage id used in every ``/public/contracts/{contract_id}``\npath; amendments create new revisions (``contract_version_id``) under it.\nSend ``version`` back as ``If-Match`` (it is also the ``ETag``) on writes.", "properties": {"activated_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When the contract was activated; null while it is a draft.", "examples": ["2026-01-01T00:00:00.000Z"], "title": "Activated At"}, "amended_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When this revision was created by an amendment; null for the original.", "examples": ["2026-06-01T12:00:00.000Z"], "title": "Amended At"}, "billing_timezone": {"description": "IANA time zone used to determine billing days and periods.", "examples": ["America/Santiago"], "title": "Billing Timezone", "type": "string"}, "cancelled_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When the contract was cancelled; null unless cancelled.", "examples": ["2026-09-30T00:00:00.000Z"], "title": "Cancelled At"}, "churn_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When the customer churned, recorded at cancellation; null otherwise.", "examples": ["2026-09-30T00:00:00.000Z"], "title": "Churn At"}, "churn_reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Reason given for the churn, if any.", "examples": ["Moved to an in-house solution."], "title": "Churn Reason"}, "comments": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Operational comments.", "examples": ["Renewal negotiated by the account team."], "title": "Comments"}, "commercial_reference": {"anyOf": [{"$ref": "#/components/schemas/ContractCommercialReference"}, {"type": "null"}], "description": "Customer reference for the contract, such as a purchase order."}, "completed_on": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Calendar day the contract completed.", "examples": ["2026-12-31"], "title": "Completed On"}, "contract_version_id": {"description": "Id of the revision this body reflects.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a17"], "format": "uuid", "title": "Contract Version Id", "type": "string"}, "created_at": {"description": "When the contract was created.", "examples": ["2026-01-01T00:00:00.000Z"], "format": "date-time", "title": "Created At", "type": "string"}, "customer_id": {"description": "Customer the contract is with.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a19"], "format": "uuid", "title": "Customer Id", "type": "string"}, "default_billing_schedule": {"$ref": "#/components/schemas/ContractBillingSchedule", "description": "Day, and optionally month and year, that billing cycles are anchored to."}, "document_uri": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Link to the signed contract document, if provided.", "examples": ["https://example.com/contracts/acme-2026.pdf"], "title": "Document Uri"}, "external_approval": {"default": false, "description": "True when invoices need approval outside Relvo before they are issued.", "examples": [false], "title": "External Approval", "type": "boolean"}, "external_refs": {"description": "Links to this contract in outside systems.", "items": {"$ref": "#/components/schemas/ContractExternalReference"}, "title": "External Refs", "type": "array"}, "id": {"description": "Stable contract id; amendments do not change it.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10"], "format": "uuid", "title": "Id", "type": "string"}, "is_current_revision": {"description": "False when a later amendment superseded this revision.", "examples": [true], "title": "Is Current Revision", "type": "boolean"}, "issuer_billing_entity_id": {"description": "Your billing entity that issues the invoices.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a20"], "format": "uuid", "title": "Issuer Billing Entity Id", "type": "string"}, "metadata": {"additionalProperties": {"type": "string"}, "description": "Your own key/value pairs for this contract, returned exactly as stored. Relvo never interprets them. They belong to the contract, not to one revision: an amendment carries them forward and editing them creates no revision. Empty object when none are set.", "examples": [{"crm_deal_id": "deal_8812", "segment": "enterprise"}], "title": "Metadata", "type": "object"}, "name": {"description": "Contract name.", "examples": ["Acme 2026 subscription"], "title": "Name", "type": "string"}, "phases": {"description": "Phases of the contract, in order.", "items": {"$ref": "#/components/schemas/ContractPhase"}, "title": "Phases", "type": "array"}, "revision_number": {"description": "Revision number; 1 for the original, increased by each amendment.", "examples": [1], "title": "Revision Number", "type": "integer"}, "start_date": {"description": "First service day; a future date means not yet started.", "examples": ["2026-01-01"], "format": "date", "title": "Start Date", "type": "string"}, "status": {"$ref": "#/components/schemas/ContractStatus", "description": "Lifecycle status of the contract.", "examples": ["active"]}, "superseded_by": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Revision id that superseded this one; null when current.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a18"], "title": "Superseded By"}, "validity": {"$ref": "#/components/schemas/ContractValidity", "description": "Overall validity dates of the contract."}, "version": {"description": "Concurrency version; equals the ETag. Send it as `If-Match` on writes.", "examples": [3], "title": "Version", "type": "integer"}}, "required": ["id", "contract_version_id", "revision_number", "version", "status", "is_current_revision", "customer_id", "issuer_billing_entity_id", "name", "billing_timezone", "default_billing_schedule", "start_date", "validity", "phases", "created_at"], "title": "Contract", "type": "object"}, "ContractActivatedEvent": {"additionalProperties": false, "description": "`contract.activated`: A contract was activated and now bills.", "properties": {"created_at": {"description": "When the event entered the event log. The `created_at_from`/`created_at_to` filters and the 30-day retention window apply to it.", "format": "date-time", "title": "Created At", "type": "string"}, "data": {"$ref": "#/components/schemas/ContractEventData", "description": "The event's payload, typed by `type`."}, "id": {"description": "Event id; the same value as the `Relvo-Event-Id` header of every delivery of this event. Use it to deduplicate.", "format": "uuid", "title": "Id", "type": "string"}, "occurred_at": {"description": "When the change happened in Relvo.", "format": "date-time", "title": "Occurred At", "type": "string"}, "organization_id": {"description": "The organization the event belongs to.", "format": "uuid", "title": "Organization Id", "type": "string"}, "schema_version": {"description": "Version of this event type's `data` schema.", "minimum": 1.0, "title": "Schema Version", "type": "integer"}, "type": {"const": "contract.activated", "description": "The event type.", "title": "Type", "type": "string"}}, "required": ["id", "schema_version", "occurred_at", "organization_id", "created_at", "type", "data"], "title": "ContractActivatedEvent", "type": "object"}, "ContractAmendedEvent": {"additionalProperties": false, "description": "`contract.amended`: An active contract was amended; read it for the new terms.", "properties": {"created_at": {"description": "When the event entered the event log. The `created_at_from`/`created_at_to` filters and the 30-day retention window apply to it.", "format": "date-time", "title": "Created At", "type": "string"}, "data": {"$ref": "#/components/schemas/ContractEventData", "description": "The event's payload, typed by `type`."}, "id": {"description": "Event id; the same value as the `Relvo-Event-Id` header of every delivery of this event. Use it to deduplicate.", "format": "uuid", "title": "Id", "type": "string"}, "occurred_at": {"description": "When the change happened in Relvo.", "format": "date-time", "title": "Occurred At", "type": "string"}, "organization_id": {"description": "The organization the event belongs to.", "format": "uuid", "title": "Organization Id", "type": "string"}, "schema_version": {"description": "Version of this event type's `data` schema.", "minimum": 1.0, "title": "Schema Version", "type": "integer"}, "type": {"const": "contract.amended", "description": "The event type.", "title": "Type", "type": "string"}}, "required": ["id", "schema_version", "occurred_at", "organization_id", "created_at", "type", "data"], "title": "ContractAmendedEvent", "type": "object"}, "ContractAmendmentReconciliation": {"additionalProperties": false, "description": "Rebilling of already-billed periods after an amendment.\n\nThis is a status record maintained by Relvo, not an editable resource, so it has\nno `version` and no `ETag`.\n\n`status` values:\n- `queued`: waiting to run.\n- `running`: in progress.\n- `succeeded`: finished; the affected periods were rebilled.\n- `blocked`: cannot proceed until the problem in `blocker_code` is resolved.\n- `failed`: stopped with an error.", "properties": {"blocker_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Stable code of the reason the reconciliation is blocked; null otherwise.", "examples": ["billing_recompute_blocked"], "title": "Blocker Code"}, "completed_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When it finished; null until it succeeds or fails.", "examples": ["2026-06-01T12:00:30.000Z"], "title": "Completed At"}, "contract_id": {"description": "Stable id of the contract that was amended.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10"], "format": "uuid", "title": "Contract Id", "type": "string"}, "created_at": {"description": "When the reconciliation was queued.", "examples": ["2026-06-01T12:00:00.000Z"], "format": "date-time", "title": "Created At", "type": "string"}, "id": {"description": "Reconciliation id.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a21"], "format": "uuid", "title": "Id", "type": "string"}, "started_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When it started running; null while queued.", "examples": ["2026-06-01T12:00:05.000Z"], "title": "Started At"}, "status": {"description": "Progress of the reconciliation.", "enum": ["queued", "running", "succeeded", "blocked", "failed"], "examples": ["succeeded"], "title": "Status", "type": "string"}, "updated_at": {"description": "When the record last changed.", "examples": ["2026-06-01T12:00:30.000Z"], "format": "date-time", "title": "Updated At", "type": "string"}}, "required": ["id", "contract_id", "status", "created_at", "updated_at"], "title": "ContractAmendmentReconciliation", "type": "object"}, "ContractBillingInterval": {"description": "Billing cadence of the bound price.\n\n- `one_time`: billed once.\n- `weekly`, `monthly`, `quarterly`, `semiannual`, `yearly`: billed once per\n  week, month, three months, six months or year respectively.", "enum": ["one_time", "weekly", "monthly", "quarterly", "semiannual", "yearly"], "title": "ContractBillingInterval", "type": "string"}, "ContractBillingSchedule": {"additionalProperties": false, "description": "When billing cycles start.\n\nLeave `month` and `year` unset for calendar-aligned cycles, optionally starting on\n`day` (31 means the last day of the month). Set both `month` and `year` to anchor\nthe cycles to that specific date.", "example": {"day": 1}, "properties": {"day": {"anyOf": [{"maximum": 31.0, "minimum": 1.0, "type": "integer"}, {"type": "null"}], "description": "Day of the month each billing cycle starts on, from 1 to 31. 31 means the last day of the month.", "examples": [1], "title": "Day"}, "month": {"anyOf": [{"maximum": 12.0, "minimum": 1.0, "type": "integer"}, {"type": "null"}], "description": "Month of the anchor date, from 1 to 12. Set together with `year`; leave both unset for calendar-aligned cycles.", "examples": [1], "title": "Month"}, "year": {"anyOf": [{"type": "integer"}, {"type": "null"}], "description": "Year of the anchor date. Set together with `month`.", "examples": [2026], "title": "Year"}}, "title": "ContractBillingSchedule", "type": "object"}, "ContractCancelOption": {"description": "When a cancellation takes effect.\n\n- `immediate`: cancel as of now.\n- `requested_date`: cancel as of a given date or instant, past or future.", "enum": ["immediate", "requested_date"], "title": "ContractCancelOption", "type": "string"}, "ContractCancelledEvent": {"additionalProperties": false, "description": "`contract.cancelled`: A contract was cancelled.", "properties": {"created_at": {"description": "When the event entered the event log. The `created_at_from`/`created_at_to` filters and the 30-day retention window apply to it.", "format": "date-time", "title": "Created At", "type": "string"}, "data": {"$ref": "#/components/schemas/ContractEventData", "description": "The event's payload, typed by `type`."}, "id": {"description": "Event id; the same value as the `Relvo-Event-Id` header of every delivery of this event. Use it to deduplicate.", "format": "uuid", "title": "Id", "type": "string"}, "occurred_at": {"description": "When the change happened in Relvo.", "format": "date-time", "title": "Occurred At", "type": "string"}, "organization_id": {"description": "The organization the event belongs to.", "format": "uuid", "title": "Organization Id", "type": "string"}, "schema_version": {"description": "Version of this event type's `data` schema.", "minimum": 1.0, "title": "Schema Version", "type": "integer"}, "type": {"const": "contract.cancelled", "description": "The event type.", "title": "Type", "type": "string"}}, "required": ["id", "schema_version", "occurred_at", "organization_id", "created_at", "type", "data"], "title": "ContractCancelledEvent", "type": "object"}, "ContractComments": {"additionalProperties": false, "description": "The operational comments of a contract.", "properties": {"comments": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Operational comments; null when cleared.", "examples": ["Renewal negotiated by the account team."], "title": "Comments"}, "contract_id": {"description": "Stable contract id.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10"], "format": "uuid", "title": "Contract Id", "type": "string"}, "version": {"description": "Concurrency version of the contract after the change; equals the ETag.", "examples": [4], "title": "Version", "type": "integer"}}, "required": ["contract_id", "version"], "title": "ContractComments", "type": "object"}, "ContractCommercialReference": {"additionalProperties": false, "description": "A commercial document reference to quote on a routed invoice.\n\nAttach references at phases[].invoice_route.invoices[].commercial_references.\nEach invoice route may contain at most one reference of each kind.", "example": {"number": "PO-2026-00417", "reference_date": "2026-07-01", "type": "purchase_order"}, "properties": {"number": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Referenced document number or folio; omit or use null when not yet available.", "examples": ["PO-2026-00417"], "title": "Number"}, "reference_date": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Referenced document date in YYYY-MM-DD format; omit when unknown.", "examples": ["2026-07-01"], "title": "Reference Date"}, "type": {"$ref": "#/components/schemas/ContractCommercialReferenceKind", "description": "Kind of document referenced, such as a purchase order.", "examples": ["purchase_order"]}}, "required": ["type"], "title": "ContractCommercialReference", "type": "object"}, "ContractCommercialReferenceKind": {"description": "SII-coded subset of `CommercialReferenceKind` quoted on the routed invoice. Send the string value, not the SII code. SII TpoDocRef mappings: `invoice` → `33`; `invoice_exempt` → `34`; `receipt` → `39`; `receipt_exempt` → `41`; `invoice_settlement` → `43`; `purchase_invoice` → `46`; `dispatch_guide` → `52`; `debit_note` → `56`; `credit_note` → `61`; `export_invoice` → `110`; `export_debit_note` → `111`; `export_credit_note` → `112`; `purchase_order` → `801`; `purchase_note` → `802`; `hes` → `HES`; `contract_reference` → `803`. Generic buyer_reference has no SII code and is not supported on contracts.", "enum": ["invoice", "invoice_exempt", "receipt", "receipt_exempt", "invoice_settlement", "purchase_invoice", "dispatch_guide", "debit_note", "credit_note", "export_invoice", "export_debit_note", "export_credit_note", "purchase_order", "purchase_note", "hes", "contract_reference"], "title": "ContractCommercialReferenceKind", "type": "string", "x-sii-reference-codes": {"contract_reference": 803, "credit_note": 61, "debit_note": 56, "dispatch_guide": 52, "export_credit_note": 112, "export_debit_note": 111, "export_invoice": 110, "hes": "HES", "invoice": 33, "invoice_exempt": 34, "invoice_settlement": 43, "purchase_invoice": 46, "purchase_note": 802, "purchase_order": 801, "receipt": 39, "receipt_exempt": 41}}, "ContractCreationStatus": {"description": "The status a contract is created in.\n\n- `draft`: create it for review; it does not bill until activated.\n- `active`: activate it on creation so it bills from its `start_date`.", "enum": ["draft", "active"], "title": "ContractCreationStatus", "type": "string"}, "ContractDocument": {"additionalProperties": false, "description": "A signed PDF attached to a contract.\n\nDocuments are never edited: a new document supersedes an old one, so they carry\nno `version` and no `ETag`.", "properties": {"contract_id": {"description": "Contract the document is attached to.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a11"], "format": "uuid", "title": "Contract Id", "type": "string"}, "created_at": {"description": "When the document was attached, in UTC.", "examples": ["2026-01-01T00:00:00.000Z"], "format": "date-time", "title": "Created At", "type": "string"}, "filename": {"description": "Original filename of the uploaded PDF.", "examples": ["msa-2026-signed.pdf"], "title": "Filename", "type": "string"}, "id": {"description": "Document id.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10"], "format": "uuid", "title": "Id", "type": "string"}, "is_current": {"description": "True when no later document replaces this one.", "examples": [true], "title": "Is Current", "type": "boolean"}, "kind": {"$ref": "#/components/schemas/ContractDocumentKind", "description": "Role the document plays in the agreement.", "examples": ["principal_agreement"]}, "page_count": {"description": "Number of pages in the PDF.", "examples": [12], "title": "Page Count", "type": "integer"}, "revision_number": {"anyOf": [{"type": "integer"}, {"type": "null"}], "description": "Contract revision this document backs. Null when it backs the contract as a whole rather than one revision.", "examples": [2], "title": "Revision Number"}, "sha256": {"description": "SHA-256 hash of the file contents, hex-encoded, for integrity checks.", "examples": ["9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"], "title": "Sha256", "type": "string"}, "signed_on": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Date the document was signed, or null when not provided.", "examples": ["2026-01-01"], "title": "Signed On"}, "size_bytes": {"description": "Size of the PDF file in bytes.", "examples": [482133], "title": "Size Bytes", "type": "integer"}, "superseded_by_document_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Later document that replaces this one, or null when it is current.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a13"], "title": "Superseded By Document Id"}, "supersedes_document_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Earlier document this one replaces, or null when it replaces none.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a12"], "title": "Supersedes Document Id"}, "title": {"description": "Human-readable title of the document.", "examples": ["Master Services Agreement 2026"], "title": "Title", "type": "string"}}, "required": ["id", "contract_id", "revision_number", "kind", "title", "signed_on", "filename", "page_count", "size_bytes", "sha256", "supersedes_document_id", "superseded_by_document_id", "is_current", "created_at"], "title": "ContractDocument", "type": "object"}, "ContractDocumentKind": {"description": "Role a signed document plays in the commercial agreement.\n\n- `principal_agreement`: the main signed contract.\n- `annex`: an annex or schedule attached to the agreement.\n- `addendum`: an addendum that modifies the agreement.\n- `terms`: general terms and conditions.\n- `purchase_order`: a purchase order issued by the customer.\n- `other`: any other supporting document.", "enum": ["principal_agreement", "annex", "addendum", "terms", "purchase_order", "other"], "title": "ContractDocumentKind", "type": "string"}, "ContractDocumentList": {"additionalProperties": false, "description": "One page of a contract lineage's documents, oldest first.", "properties": {"items": {"description": "Documents of the contract on this page, oldest first.", "items": {"$ref": "#/components/schemas/ContractDocument"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same contract. Null on the last page.", "title": "Next Cursor"}}, "required": ["items"], "title": "ContractDocumentList", "type": "object"}, "ContractEventData": {"additionalProperties": false, "description": "A contract changed lifecycle; read it for its current state.", "properties": {"contract_id": {"description": "The contract; read it with `GET /public/contracts/{contract_id}`.", "format": "uuid", "title": "Contract Id", "type": "string"}, "customer_id": {"description": "The contracted customer; read it with `GET /public/customers/{customer_id}`.", "format": "uuid", "title": "Customer Id", "type": "string"}}, "required": ["contract_id", "customer_id"], "title": "ContractEventData", "type": "object"}, "ContractExternalReference": {"additionalProperties": false, "description": "A link from this contract to a record in an outside system, such as a CRM or ERP.\n\nWhat you send on write is what reads return.", "properties": {"id": {"description": "Record id in that system.", "examples": ["0065g00000XyZabAAF"], "maxLength": 256, "minLength": 1, "title": "Id", "type": "string"}, "system": {"description": "External system, e.g. `salesforce`.", "examples": ["salesforce"], "maxLength": 64, "minLength": 1, "title": "System", "type": "string"}, "type": {"description": "Record type in that system, e.g. `opportunity`.", "examples": ["opportunity"], "maxLength": 64, "minLength": 1, "title": "Type", "type": "string"}, "url": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Link to the record in that system, if it has one.", "examples": ["https://example.my.salesforce.com/0065g00000XyZabAAF"], "title": "Url"}}, "required": ["system", "type", "id"], "title": "ContractExternalReference", "type": "object"}, "ContractImport": {"additionalProperties": false, "description": "A contract PDF accepted for asynchronous import.", "properties": {"import_id": {"description": "Import job id.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a70"], "format": "uuid", "title": "Import Id", "type": "string"}, "status": {"$ref": "#/components/schemas/ContractImportStatus", "description": "Import job status at acceptance.", "examples": ["queued"]}}, "required": ["import_id", "status"], "title": "ContractImport", "type": "object"}, "ContractImportDetail": {"additionalProperties": false, "description": "Current state of a contract import job.", "properties": {"contract_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Contract the import created; set once `status` is `applied`.", "title": "Contract Id"}, "created_at": {"description": "When the import was accepted.", "format": "date-time", "title": "Created At", "type": "string"}, "import_id": {"description": "Import job id.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a70"], "format": "uuid", "title": "Import Id", "type": "string"}, "status": {"$ref": "#/components/schemas/ContractImportStatus", "description": "Current import job status."}, "updated_at": {"description": "When the import job last changed.", "format": "date-time", "title": "Updated At", "type": "string"}}, "required": ["import_id", "status", "created_at", "updated_at"], "title": "ContractImportDetail", "type": "object"}, "ContractImportStatus": {"description": "Lifecycle of a contract import job.\n\n- `queued`: accepted and waiting to be processed.\n- `processing`: the document is being read and turned into a contract proposal.\n- `review_required`: the proposal needs a person to review or complete it.\n- `approval_ready`: the proposal is complete and waiting for approval.\n- `applying`: the approved proposal is being turned into a contract.\n- `applied`: the contract was created.\n- `failed`: the import could not be completed.", "enum": ["queued", "processing", "review_required", "approval_ready", "applying", "applied", "failed"], "title": "ContractImportStatus", "type": "string"}, "ContractInvoiceLine": {"additionalProperties": false, "description": "One line shown on an invoice, combining the amounts of its placements.", "properties": {"name_on_invoice": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Label printed on the invoice line; null uses the price's own label.", "examples": ["Platform subscription"], "title": "Name On Invoice"}, "placements": {"description": "Prices whose amounts are added together on this line.", "items": {"$ref": "#/components/schemas/ContractPricePlacement"}, "maxItems": 200, "minItems": 1, "title": "Placements", "type": "array"}}, "required": ["placements"], "title": "ContractInvoiceLine", "type": "object"}, "ContractInvoiceRoute": {"additionalProperties": false, "description": "How a phase's prices are laid out across invoices and invoice lines.", "properties": {"invoices": {"description": "Invoices the phase produces each billing period.", "items": {"$ref": "#/components/schemas/ContractRoutedInvoice"}, "minItems": 1, "title": "Invoices", "type": "array"}}, "required": ["invoices"], "title": "ContractInvoiceRoute", "type": "object"}, "ContractListSortField": {"description": "A key the contracts list can be ordered by.\n\n- `created_at`: when the contract was created.\n- `name`: contract name, case-insensitive.\n- `customer_name`: the customer's display name, case-insensitive.\n- `start_date`: the contract's start date.\n- `status`: lifecycle order (draft, then active, paused, completed,\n  cancelled), not alphabetical.\n\nTies break deterministically in the same direction.", "enum": ["created_at", "name", "customer_name", "start_date", "status"], "title": "ContractListSortField", "type": "string"}, "ContractPauseBillingBehavior": {"description": "What happens to billing when the contract is paused.\n\n- `bill_through_pause`: immediately invoice the service delivered up to the\n  pause.\n- `hold_unbilled`: stop billing without invoicing the in-progress period at\n  pause time.", "enum": ["bill_through_pause", "hold_unbilled"], "title": "ContractPauseBillingBehavior", "type": "string"}, "ContractPaymentTerms": {"additionalProperties": false, "description": "Payment terms fixed for a contract revision; zero days means due on receipt.", "properties": {"days": {"description": "Days after the invoice date that payment is due; 0 means on receipt.", "examples": [30], "minimum": 0.0, "title": "Days", "type": "integer"}}, "required": ["days"], "title": "ContractPaymentTerms", "type": "object"}, "ContractPhase": {"additionalProperties": false, "description": "One phase of a contract: a period with its own prices and invoicing.", "properties": {"activation_kind": {"$ref": "#/components/schemas/ContractPhaseActivation", "description": "Whether the phase runs on dates or starts at a milestone.", "examples": ["time_window"]}, "amount_selectors": {"description": "Rules that bill only the lowest or highest of several candidate prices.", "items": {"$ref": "#/components/schemas/AmountSelector"}, "title": "Amount Selectors", "type": "array"}, "caps": {"description": "Maximum spend limits; amounts above a cap are credited back.", "items": {"$ref": "#/components/schemas/Cap"}, "title": "Caps", "type": "array"}, "commitments": {"description": "Minimum spend commitments; a shortfall is billed as a true-up.", "items": {"$ref": "#/components/schemas/Commitment"}, "title": "Commitments", "type": "array"}, "credit_grants": {"description": "Recurring or one-time phase credit grant commercial terms.", "items": {"$ref": "#/components/schemas/PhaseCreditSchedule"}, "maxItems": 50, "title": "Credit Grants", "type": "array"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Free-text description of the phase.", "examples": ["Introductory pricing for the first year."], "title": "Description"}, "discounts": {"description": "Discounts applied during the phase.", "items": {"discriminator": {"mapping": {"amount": "#/components/schemas/AmountDiscount", "percentage": "#/components/schemas/PercentageDiscount", "usage": "#/components/schemas/UsageDiscount"}, "propertyName": "discount_type"}, "oneOf": [{"$ref": "#/components/schemas/UsageDiscount"}, {"$ref": "#/components/schemas/AmountDiscount"}, {"$ref": "#/components/schemas/PercentageDiscount"}]}, "title": "Discounts", "type": "array"}, "effective_from": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "First day, inclusive; null for a milestone phase.", "examples": ["2026-01-01"], "title": "Effective From"}, "effective_to": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Exclusive end day; null when the phase has no end date.", "examples": ["2027-01-01"], "title": "Effective To"}, "id": {"description": "Phase id.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a16"], "format": "uuid", "title": "Id", "type": "string"}, "invoice_route": {"$ref": "#/components/schemas/ContractInvoiceRoute", "description": "How the phase's prices are laid out on invoices."}, "name": {"description": "Contract-unique phase name; its identity across amendments.", "examples": ["Year 1"], "title": "Name", "type": "string"}, "prices": {"description": "Prices in force during the phase.", "items": {"$ref": "#/components/schemas/ContractPrice"}, "title": "Prices", "type": "array"}, "started_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When a milestone phase was started; null until then.", "examples": ["2026-03-01T00:00:00.000Z"], "title": "Started At"}}, "required": ["id", "name", "activation_kind", "invoice_route"], "title": "ContractPhase", "type": "object"}, "ContractPhaseActivation": {"description": "How a phase comes into force.\n\n- `time_window`: the phase is in force between its `effective_from` and\n  `effective_to` dates.\n- `milestone`: the phase is in force once its milestone is explicitly started,\n  and bills when the milestone is completed.", "enum": ["time_window", "milestone"], "title": "ContractPhaseActivation", "type": "string"}, "ContractPhaseInput": {"additionalProperties": false, "description": "One phase of a contract to create or amend: its prices, invoicing and dates.", "properties": {"activation_kind": {"$ref": "#/components/schemas/ContractPhaseActivation", "description": "Whether the phase runs on dates or starts at a milestone.", "examples": ["time_window"]}, "amount_selectors": {"description": "Rules that bill only the lowest or highest of several candidate prices.", "items": {"$ref": "#/components/schemas/AmountSelector"}, "title": "Amount Selectors", "type": "array"}, "caps": {"description": "Maximum spend limits; amounts above a cap are credited back.", "items": {"$ref": "#/components/schemas/Cap"}, "title": "Caps", "type": "array"}, "commitments": {"description": "Minimum spend commitments; a shortfall is billed as a true-up.", "items": {"$ref": "#/components/schemas/Commitment"}, "title": "Commitments", "type": "array"}, "credit_grants": {"description": "Recurring or one-time phase credit grant commercial terms.", "items": {"$ref": "#/components/schemas/PhaseCreditSchedule"}, "maxItems": 50, "title": "Credit Grants", "type": "array"}, "description": {"anyOf": [{"maxLength": 2000, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Free-text description of the phase.", "examples": ["Introductory pricing for the first year."], "title": "Description"}, "discounts": {"description": "Discounts applied during the phase.", "items": {"discriminator": {"mapping": {"amount": "#/components/schemas/AmountDiscount", "percentage": "#/components/schemas/PercentageDiscount", "usage": "#/components/schemas/UsageDiscount"}, "propertyName": "discount_type"}, "oneOf": [{"$ref": "#/components/schemas/UsageDiscount"}, {"$ref": "#/components/schemas/AmountDiscount"}, {"$ref": "#/components/schemas/PercentageDiscount"}]}, "title": "Discounts", "type": "array"}, "effective_from": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "First day of a `time_window` phase, inclusive.", "examples": ["2026-01-01"], "title": "Effective From"}, "effective_to": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Exclusive end day of a `time_window` phase; omit for no end date.", "examples": ["2027-01-01"], "title": "Effective To"}, "invoice_route": {"$ref": "#/components/schemas/ContractInvoiceRoute", "description": "Which invoice and line each price bills on, and to which billing entity."}, "name": {"description": "Phase name, unique within the contract; identifies it across amendments.", "examples": ["Year 1"], "maxLength": 100, "minLength": 1, "title": "Name", "type": "string"}, "price_allowances": {"additionalProperties": {"$ref": "#/components/schemas/UsageAllowanceInput"}, "description": "Free usage units per usage price, keyed by price id. Allowance windows are independent of the invoice cadence.", "propertyNames": {"format": "uuid"}, "title": "Price Allowances", "type": "object"}, "price_filters": {"additionalProperties": {"items": {"$ref": "#/components/schemas/UsageFilter"}, "type": "array"}, "description": "Usage event filters per usage price, keyed by price id, so that two prices for the same billable metric can bill different sets of events.", "propertyNames": {"format": "uuid"}, "title": "Price Filters", "type": "object"}, "price_usage_allocations": {"additionalProperties": {"$ref": "#/components/schemas/UsageAllocation"}, "description": "Splits a usage price's usage across billing entities by an event property, keyed by price id. Cannot be combined with `price_filters` for the same price.", "propertyNames": {"format": "uuid"}, "title": "Price Usage Allocations", "type": "object"}, "prices": {"description": "Ids of the prices in force; each must be routed exactly once.", "items": {"format": "uuid", "type": "string"}, "maxItems": 200, "minItems": 1, "title": "Prices", "type": "array"}}, "required": ["name", "activation_kind", "prices", "invoice_route"], "title": "ContractPhaseInput", "type": "object"}, "ContractPrefacturaOverrides": {"additionalProperties": false, "properties": {"currency_basis": {"anyOf": [{"enum": ["pricing", "issuance"], "type": "string"}, {"type": "null"}], "title": "Currency Basis"}, "show_filters": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Show Filters"}, "show_more_information": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Show More Information"}}, "title": "ContractPrefacturaOverrides", "type": "object"}, "ContractPrice": {"additionalProperties": false, "description": "One price in force during a phase.\n\nPricing details come from the bound price; the contract adds the billing entity,\nusage filters and usage allowance. The same usage price may appear several times\nwith different `filters`, so use `id` to tell the entries apart.", "properties": {"billable_metric_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Billable metric measured by a usage price; null for other kinds.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a14"], "title": "Billable Metric Id"}, "billing_entity_id": {"description": "Billing entity this line is invoiced to.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a13"], "format": "uuid", "title": "Billing Entity Id", "type": "string"}, "billing_interval": {"anyOf": [{"$ref": "#/components/schemas/ContractBillingInterval"}, {"type": "null"}], "description": "How often the price bills; null for a one-time price.", "examples": ["monthly"]}, "currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "Currency of the price.", "examples": ["CLP"]}, "filters": {"anyOf": [{"items": {"$ref": "#/components/schemas/ContractPriceFilter"}, "type": "array"}, {"type": "null"}], "description": "Usage event filters of this binding; null when unfiltered.", "title": "Filters"}, "id": {"description": "Id of this contract line, i.e. of this price within the phase.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10"], "format": "uuid", "title": "Id", "type": "string"}, "item_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Catalog item the price sells, if any.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a12"], "title": "Item Id"}, "name_on_invoice": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Line label defined on the price itself, if any.", "examples": ["API usage"], "title": "Name On Invoice"}, "name_on_invoice_override": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Line label set by this contract's invoice line, which replaces the price's own label; null when the contract sets none.", "examples": ["Platform usage - January"], "title": "Name On Invoice Override"}, "pay_in_advance": {"default": false, "description": "True when the price is billed at the start of its period; false when it is billed at the end.", "examples": [false], "title": "Pay In Advance", "type": "boolean"}, "price_id": {"description": "Id of the bound price.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a11"], "format": "uuid", "title": "Price Id", "type": "string"}, "price_type": {"$ref": "#/components/schemas/ContractPriceKind", "description": "Kind of price.", "examples": ["usage"]}, "pricing": {"description": "Pricing definition of the bound price, the same shape `Price.pricing` has.", "discriminator": {"mapping": {"formula": "#/components/schemas/FormulaPricing", "graduated": "#/components/schemas/GraduatedPricing", "graduated_percentage": "#/components/schemas/GraduatedPercentagePricing", "package": "#/components/schemas/PackagePricing", "percentage": "#/components/schemas/PercentagePricing", "standard": "#/components/schemas/StandardPricing", "volume": "#/components/schemas/VolumePricing"}, "propertyName": "model"}, "oneOf": [{"$ref": "#/components/schemas/StandardPricing"}, {"$ref": "#/components/schemas/GraduatedPricing"}, {"$ref": "#/components/schemas/VolumePricing"}, {"$ref": "#/components/schemas/PackagePricing"}, {"$ref": "#/components/schemas/PercentagePricing"}, {"$ref": "#/components/schemas/GraduatedPercentagePricing"}, {"$ref": "#/components/schemas/FormulaPricing"}], "title": "Pricing"}, "prorated": {"default": false, "description": "True when partial billing periods are charged proportionally.", "examples": [true], "title": "Prorated", "type": "boolean"}, "quantity_metric_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Billable metric whose value sets the quantity of a seat price.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a15"], "title": "Quantity Metric Id"}, "title": {"description": "Name of the bound price.", "examples": ["API requests"], "title": "Title", "type": "string"}, "units": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Quantity billed for a fixed price, as a decimal string; null for other price kinds.", "examples": ["1"], "title": "Units"}, "usage_allowance": {"anyOf": [{"$ref": "#/components/schemas/UsageAllowanceInput"}, {"type": "null"}], "description": "Free usage units granted on this price, if any."}}, "required": ["id", "price_id", "price_type", "title", "pricing", "currency", "billing_entity_id"], "title": "ContractPrice", "type": "object"}, "ContractPriceFilter": {"additionalProperties": false, "description": "A usage event property and the values that select events for a usage price.", "properties": {"key": {"description": "Name of the usage event property to match.", "examples": ["region"], "title": "Key", "type": "string"}, "values": {"description": "Property values that match; an event matches if it has any of them.", "examples": [["eu", "us"]], "items": {"type": "string"}, "title": "Values", "type": "array"}}, "required": ["key", "values"], "title": "ContractPriceFilter", "type": "object"}, "ContractPriceKind": {"description": "Kind of price bound on a contract line.\n\n- `fixed`: a recurring flat amount per billing period.\n- `usage`: priced from the metered quantity of a billable metric.\n- `seat`: priced per seat, from a metric that counts seats.\n- `one_time`: billed once, not per period.", "enum": ["fixed", "usage", "seat", "one_time"], "title": "ContractPriceKind", "type": "string"}, "ContractPricePlacement": {"additionalProperties": false, "description": "A phase price, optionally narrowed by a usage filter, placed on an invoice line.", "properties": {"filter": {"anyOf": [{"maxLength": 500, "type": "string"}, {"type": "null"}], "description": "Canonical filter of the placement, e.g. \"region=eu\"; null when unfiltered.", "examples": ["region=eu"], "title": "Filter"}, "price_id": {"description": "Id of the phase price this placement addresses.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a11"], "format": "uuid", "title": "Price Id", "type": "string"}}, "required": ["price_id"], "title": "ContractPricePlacement", "type": "object"}, "ContractResumeBillingCycleAnchor": {"description": "How the billing cycle continues when a paused contract is resumed.\n\n- `unchanged`: keep the original billing cycle dates.\n- `resume_date`: restart the billing cycle on the resume day.", "enum": ["unchanged", "resume_date"], "title": "ContractResumeBillingCycleAnchor", "type": "string"}, "ContractRoutedInvoice": {"additionalProperties": false, "description": "One invoice a phase produces each billing period.\n\n`name` identifies the invoice across amendments.", "properties": {"billing_entity_id": {"description": "Billing entity this invoice is issued to.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a13"], "format": "uuid", "title": "Billing Entity Id", "type": "string"}, "commercial_references": {"description": "Customer references, such as a purchase order number, printed on this invoice; at most one per type.", "items": {"$ref": "#/components/schemas/ContractCommercialReference"}, "title": "Commercial References", "type": "array"}, "invoice_currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "Currency the invoice is issued in.", "examples": ["CLP"]}, "lines": {"description": "Lines printed on this invoice, in order.", "items": {"$ref": "#/components/schemas/ContractInvoiceLine"}, "minItems": 1, "title": "Lines", "type": "array"}, "name": {"description": "Name of this invoice within the phase; stays the same across amendments.", "examples": ["Main invoice"], "maxLength": 255, "minLength": 1, "title": "Name", "type": "string"}, "payment_terms": {"anyOf": [{"$ref": "#/components/schemas/ContractPaymentTerms"}, {"type": "null"}], "description": "Payment terms for this invoice; null on input uses the billing entity's terms."}, "split_group": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Name shared by invoices that divide the same amounts between several billing entities. Set together with `split_weight`; null when the invoice is not split.", "examples": ["shared-costs"], "title": "Split Group"}, "split_weight": {"anyOf": [{"pattern": "^\\d+(\\.\\d+)?$", "type": "string"}, {"type": "null"}], "description": "Relative share of the split amounts this invoice receives, compared with the other invoices in the same `split_group`.", "examples": ["0.5"], "title": "Split Weight"}}, "required": ["name", "billing_entity_id", "invoice_currency", "lines"], "title": "ContractRoutedInvoice", "type": "object"}, "ContractSettingsResponse": {"properties": {"contract_id": {"format": "uuid", "title": "Contract Id", "type": "string"}, "effective": {"$ref": "#/components/schemas/EffectiveContractSettings"}, "fx_backfill": {"anyOf": [{"$ref": "#/components/schemas/DraftFxBackfillResponse"}, {"type": "null"}]}, "overrides": {"$ref": "#/components/schemas/ContractSettingsValues"}, "sources": {"$ref": "#/components/schemas/ContractSettingsSourceValues"}, "version": {"title": "Version", "type": "integer"}}, "required": ["contract_id", "version", "overrides", "effective", "sources"], "title": "ContractSettingsResponse", "type": "object"}, "ContractSettingsSourceValues": {"properties": {"pre_invoice_pdf": {"$ref": "#/components/schemas/ContractSettingsSources"}}, "required": ["pre_invoice_pdf"], "title": "ContractSettingsSourceValues", "type": "object"}, "ContractSettingsSources": {"properties": {"currency_basis": {"enum": ["organization", "contract"], "title": "Currency Basis", "type": "string"}, "show_filters": {"enum": ["organization", "contract"], "title": "Show Filters", "type": "string"}, "show_more_information": {"enum": ["organization", "contract"], "title": "Show More Information", "type": "string"}}, "required": ["currency_basis", "show_filters", "show_more_information"], "title": "ContractSettingsSources", "type": "object"}, "ContractSettingsValues": {"additionalProperties": false, "properties": {"pre_invoice_pdf": {"$ref": "#/components/schemas/ContractPrefacturaOverrides"}}, "required": ["pre_invoice_pdf"], "title": "ContractSettingsValues", "type": "object"}, "ContractStatus": {"description": "Lifecycle status of a contract.\n\n- `draft`: authored but not activated; it does not bill.\n- `active`: in force and billing. A contract with a future `start_date` is\n  `active` and starts billing on that date.\n- `paused`: temporarily stopped; no new billing until it is resumed.\n- `completed`: reached the end of its term.\n- `cancelled`: terminated before the end of its term.", "enum": ["draft", "active", "paused", "completed", "cancelled"], "title": "ContractStatus", "type": "string"}, "ContractSummary": {"additionalProperties": false, "description": "A contract as listed. Fetch the contract for phases and prices.", "properties": {"activated_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When the contract was activated; null while it is a draft.", "examples": ["2026-01-01T00:00:00.000Z"], "title": "Activated At"}, "commercial_reference": {"anyOf": [{"$ref": "#/components/schemas/ContractCommercialReference"}, {"type": "null"}], "description": "Customer reference for the contract, such as a purchase order."}, "completed_on": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Calendar day the contract completed.", "examples": ["2026-12-31"], "title": "Completed On"}, "contract_version_id": {"description": "Id of the current revision.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a17"], "format": "uuid", "title": "Contract Version Id", "type": "string"}, "created_at": {"description": "When the contract was created.", "examples": ["2026-01-01T00:00:00.000Z"], "format": "date-time", "title": "Created At", "type": "string"}, "customer_id": {"description": "Customer the contract is with.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a19"], "format": "uuid", "title": "Customer Id", "type": "string"}, "end_date": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Exclusive end date; null when the contract has no end date.", "examples": ["2027-01-01"], "title": "End Date"}, "id": {"description": "Stable contract id.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10"], "format": "uuid", "title": "Id", "type": "string"}, "integrity_violation_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Null for a healthy contract. Otherwise the stable code of the violated invariant; the contract is listed from its header only and reading it returns 422 `contracts.contract.integrity_violation`.", "title": "Integrity Violation Code"}, "name": {"description": "Contract name.", "examples": ["Acme 2026 subscription"], "title": "Name", "type": "string"}, "phase_count": {"default": 0, "description": "Number of phases.", "examples": [2], "title": "Phase Count", "type": "integer"}, "price_count": {"default": 0, "description": "Number of prices across all phases.", "examples": [5], "title": "Price Count", "type": "integer"}, "revision_number": {"description": "Revision number of the current revision.", "examples": [1], "title": "Revision Number", "type": "integer"}, "start_date": {"description": "First service day.", "examples": ["2026-01-01"], "format": "date", "title": "Start Date", "type": "string"}, "status": {"$ref": "#/components/schemas/ContractStatus", "description": "Lifecycle status of the contract.", "examples": ["active"]}}, "required": ["id", "contract_version_id", "revision_number", "status", "name", "customer_id", "start_date", "created_at"], "title": "ContractSummary", "type": "object"}, "ContractSummaryPage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/ContractSummary"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[ContractSummary]", "type": "object"}, "ContractValidity": {"additionalProperties": false, "description": "Overall validity dates of the contract, independent of individual phase dates.", "properties": {"end_date": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Exclusive end date; null means the contract has no end date.", "examples": ["2027-01-01"], "title": "End Date"}, "start_date": {"description": "First service day, inclusive.", "examples": ["2026-01-01"], "format": "date", "title": "Start Date", "type": "string"}}, "required": ["start_date", "end_date"], "title": "ContractValidity", "type": "object"}, "CorrectUsageEventRequest": {"additionalProperties": false, "description": "Correct a usage event without editing it.", "properties": {"operation": {"$ref": "#/components/schemas/UsageEventCorrectionOperation", "description": "`void` retires the event; `replace` supersedes it.", "examples": ["replace"]}, "replacement_event": {"anyOf": [{"$ref": "#/components/schemas/UsageEventReplacementRequest"}, {"type": "null"}], "description": "Required for `replace`; not allowed for `void`."}}, "required": ["operation"], "title": "CorrectUsageEventRequest", "type": "object"}, "CorrectionNoteStatus": {"description": "Lifecycle of a credit or debit note (both share the vocabulary).\n\n`draft`: created and still editable; it has no fiscal effect yet. `open`: issued; it\ncorrects the source invoice and its tax-authority outcome is reported on `fiscal`.\n`void`: an issued note withdrawn locally before the tax authority took it (a pending\nor accepted note cannot be voided). `cancelled`: a draft discarded with `DELETE`; it\nnever had a fiscal effect.", "enum": ["draft", "open", "void", "cancelled"], "title": "CorrectionNoteStatus", "type": "string"}, "CountRangeReport": {"additionalProperties": false, "description": "A count accumulated over an inclusive date range.", "properties": {"date_from": {"description": "First day of the range (inclusive).", "examples": ["2026-01-01"], "format": "date", "title": "Date From", "type": "string"}, "date_to": {"description": "Last day of the range (inclusive).", "examples": ["2026-01-31"], "format": "date", "title": "Date To", "type": "string"}, "value": {"description": "The count over the range.", "examples": [42], "title": "Value", "type": "integer"}}, "required": ["date_from", "date_to", "value"], "title": "CountRangeReport", "type": "object"}, "CountSnapshotReport": {"additionalProperties": false, "description": "A count measured at the end of one calendar day.", "properties": {"as_of": {"description": "Calendar day the snapshot is taken at (end of day).", "examples": ["2026-01-31"], "format": "date", "title": "As Of", "type": "string"}, "value": {"description": "The count on that day.", "examples": [42], "title": "Value", "type": "integer"}}, "required": ["as_of", "value"], "title": "CountSnapshotReport", "type": "object"}, "CountryEnum": {"description": "A country, as its ISO 3166-1 alpha-2 code (uppercase, e.g. `CL`, `US`).", "enum": ["AF", "AL", "DZ", "AD", "AO", "AI", "AG", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BA", "BW", "BN", "BG", "BF", "BI", "AM", "AR", "BR", "KH", "CM", "CA", "CV", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CG", "CD", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "SZ", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MK", "MP", "NO", "OM", "PK", "PW", "PS", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UM", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW"], "title": "CountryEnum", "type": "string"}, "CreateCatalogItemRequest": {"additionalProperties": false, "description": "Create a catalog item: a product or service you sell and price.", "properties": {"description": {"anyOf": [{"maxLength": 2000, "minLength": 5, "type": "string"}, {"type": "null"}], "description": "Free-text description.", "examples": ["Access to the public REST API, billed by usage."], "title": "Description"}, "name": {"description": "Display name of the item.", "examples": ["API platform"], "maxLength": 255, "minLength": 1, "title": "Name", "type": "string"}, "status": {"anyOf": [{"$ref": "#/components/schemas/ItemStatus"}, {"type": "null"}], "description": "Initial status; defaults to `active`.", "examples": ["active"]}}, "required": ["name"], "title": "CreateCatalogItemRequest", "type": "object"}, "CreateContactEmailInput": {"additionalProperties": false, "description": "One email entry in a create-contact body.", "properties": {"email": {"description": "Email address to add. Surrounding spaces are trimmed; it starts `active`.", "examples": ["billing@acmecorp.com"], "minLength": 1, "title": "Email", "type": "string"}}, "required": ["email"], "title": "CreateContactEmailInput", "type": "object"}, "CreateContactPhoneInput": {"additionalProperties": false, "description": "One phone entry in a create-contact body. ``country`` parses the number into E.164.", "properties": {"country": {"$ref": "#/components/schemas/PhoneCountry", "default": "CL", "description": "Country used to interpret a number written in national format.", "examples": ["CL"]}, "phone": {"description": "Phone number, in international (E.164) or national format. It is stored in E.164 and starts `active`.", "examples": ["+56912345678"], "minLength": 1, "title": "Phone", "type": "string"}}, "required": ["phone"], "title": "CreateContactPhoneInput", "type": "object"}, "CreateContactRequest": {"additionalProperties": false, "description": "Body for creating a contact: name, emails, phones and roles in one call.", "example": {"emails": [{"email": "billing@acmecorp.com"}], "name": "Jane Rivera", "phones": [{"phone": "+56912345678"}], "roles": [{"is_default": true, "role": "billing"}]}, "properties": {"emails": {"description": "Email addresses to add to the new contact.", "items": {"$ref": "#/components/schemas/CreateContactEmailInput"}, "title": "Emails", "type": "array"}, "first_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Given name. Omit or null to leave it unset.", "examples": ["Jane"], "title": "First Name"}, "last_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Family name. Omit or null to leave it unset.", "examples": ["Rivera"], "title": "Last Name"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Full name; prefer first_name and last_name for new writes.", "examples": ["Jane Rivera"], "title": "Name"}, "phones": {"description": "Phone numbers to add to the new contact.", "items": {"$ref": "#/components/schemas/CreateContactPhoneInput"}, "title": "Phones", "type": "array"}, "roles": {"description": "Correspondence the new contact should receive.", "items": {"$ref": "#/components/schemas/ContactRoleInput"}, "title": "Roles", "type": "array"}}, "title": "CreateContactRequest", "type": "object"}, "CreateContractImportRequest": {"description": "The multipart form body of `createContractImport`.", "properties": {"file": {"contentMediaType": "application/octet-stream", "description": "The signed contract, as a PDF of at most 20 MiB.", "title": "File", "type": "string"}}, "required": ["file"], "title": "CreateContractImportRequest", "type": "object"}, "CreateContractRequest": {"additionalProperties": false, "description": "Create a contract with a customer, as a draft or already active.", "example": {"customer_id": "0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a19", "issuer_billing_entity_id": "0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a12", "name": "Acme 2026 subscription", "phases": [{"activation_kind": "time_window", "effective_from": "2026-01-01", "effective_to": "2027-01-01", "invoice_route": {"invoices": [{"billing_entity_id": "0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a11", "invoice_currency": "CLP", "lines": [{"name_on_invoice": "Platform subscription", "placements": [{"price_id": "0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a31"}]}, {"name_on_invoice": "API usage", "placements": [{"price_id": "0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a32"}]}], "name": "Monthly invoice"}]}, "name": "Year 1", "prices": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a31", "0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a32"]}], "start_date": "2026-01-01"}, "properties": {"comments": {"anyOf": [{"maxLength": 2000, "minLength": 5, "type": "string"}, {"type": "null"}], "description": "Operational comments, at least 5 characters.", "examples": ["Renewal negotiated by the account team."], "title": "Comments"}, "customer_id": {"description": "Customer the contract is with.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a19"], "format": "uuid", "title": "Customer Id", "type": "string"}, "default_billing_schedule": {"$ref": "#/components/schemas/ContractBillingSchedule", "description": "Day, and optionally month and year, that billing cycles are anchored to. Defaults to calendar-aligned periods."}, "document_uri": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Link to the signed contract document.", "examples": ["https://example.com/contracts/acme-2026.pdf"], "title": "Document Uri"}, "external_approval": {"default": false, "description": "Set to true when invoices need approval outside Relvo before they are issued.", "examples": [false], "title": "External Approval", "type": "boolean"}, "external_refs": {"description": "Links to this contract in outside systems; at most 50.", "items": {"$ref": "#/components/schemas/ContractExternalReference"}, "maxItems": 50, "title": "External Refs", "type": "array"}, "issuer_billing_entity_id": {"description": "Billing entity that issues the invoices.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a20"], "format": "uuid", "title": "Issuer Billing Entity Id", "type": "string"}, "metadata": {"anyOf": [{"additionalProperties": {"type": "string"}, "type": "object"}, {"type": "null"}], "description": "Your own key/value pairs to store on the contract (for example your CRM deal id). Keys with an empty-string value are ignored. At most 50 keys; keys are 1-40 characters and may not contain `[` or `]`; values are strings of at most 500 characters.", "examples": [{"crm_deal_id": "deal_8812", "segment": "enterprise"}], "title": "Metadata"}, "name": {"description": "Contract name; must not be blank.", "examples": ["Acme 2026 subscription"], "maxLength": 255, "minLength": 1, "title": "Name", "type": "string"}, "phases": {"description": "Phases of the contract; phase names must be unique.", "items": {"$ref": "#/components/schemas/ContractPhaseInput"}, "maxItems": 50, "minItems": 1, "title": "Phases", "type": "array"}, "start_date": {"description": "First service day.", "examples": ["2026-01-01"], "format": "date", "title": "Start Date", "type": "string"}, "status": {"$ref": "#/components/schemas/ContractCreationStatus", "default": "active", "description": "`draft` to review before activating; `active` to start billing.", "examples": ["active"]}}, "required": ["name", "customer_id", "issuer_billing_entity_id", "start_date", "phases"], "title": "CreateContractRequest", "type": "object"}, "CreateFinancialCredit": {"additionalProperties": false, "description": "Grant money or metric units immediately, optionally creating a purchase invoice draft.", "properties": {"billing_entity_id": {"description": "The customer's billing entity receiving the credits and any purchase invoice.", "format": "uuid", "title": "Billing Entity Id", "type": "string"}, "create_invoice": {"default": false, "description": "Create a purchase invoice draft in the same transaction. Does not issue a fiscal document or charge a payment method.", "title": "Create Invoice", "type": "boolean"}, "customer_id": {"description": "Customer receiving the credits.", "format": "uuid", "title": "Customer Id", "type": "string"}, "effective_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Inclusive availability instant with an explicit timezone; microseconds are preserved. Omit for immediate availability.", "title": "Effective At"}, "expires_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Exclusive expiry instant with an explicit timezone; microseconds are preserved. Null means no expiry.", "title": "Expires At"}, "face_value": {"description": "Granted capacity, independently of the purchase price.", "discriminator": {"mapping": {"metric": "#/components/schemas/PhaseMetricCredit", "money": "#/components/schemas/PhaseCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/PhaseCurrencyCredit"}, {"$ref": "#/components/schemas/PhaseMetricCredit"}], "title": "Face Value"}, "name": {"description": "Human-readable credit name.", "maxLength": 255, "minLength": 1, "title": "Name", "type": "string"}, "origin": {"description": "Whether the entitlement was purchased or granted free of charge.", "enum": ["purchased", "promotional"], "title": "Origin", "type": "string"}, "purchase_date": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Purchase calendar date, independently of the audit instant.", "title": "Purchase Date"}, "purchase_invoice": {"anyOf": [{"$ref": "#/components/schemas/CreditPurchaseInvoice"}, {"type": "null"}], "description": "Required invoice details when create_invoice is true; otherwise omit."}, "purchase_price": {"$ref": "#/components/schemas/PhaseCreditMoney", "description": "Net purchase price and settlement currency; promotional grants require zero."}, "purchased_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Purchase audit instant with an explicit timezone; microseconds are preserved.", "title": "Purchased At"}}, "required": ["customer_id", "billing_entity_id", "name", "origin", "face_value", "purchase_price"], "title": "CreateFinancialCredit", "type": "object"}, "CreateFixedPriceRequest": {"additionalProperties": false, "description": "A fixed price: `pricing.amount` x `units` every interval.", "properties": {"currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency every amount of this price is expressed in.", "examples": ["CLP"]}, "interval": {"$ref": "#/components/schemas/PriceInterval", "description": "Recurrence; `one_time` for a non-recurring price.", "examples": ["monthly"]}, "item_id": {"description": "Catalog item this price bills for.", "examples": ["0191f3c1-8a20-7b3c-9d4e-2a1b3c4d5e6f"], "format": "uuid", "title": "Item Id", "type": "string"}, "name": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Display name of the price. Defaults to the item / metric name.", "examples": ["Platform subscription"], "title": "Name"}, "name_on_invoice": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Invoice line label override. Invoice line label. May use `{{month}}`, `{{year}}` and `{{service_period}}`. Service periods render as dd/mm/yyyy - dd/mm/yyyy, with disjoint ranges separated by '; '. Referencing service_period requires complete service dates; unresolved or overlong output is rejected. Month/year are substituted from the line's billing period (e.g. `\"saas bulk {{month}} {{year}}\"` prints `\"saas bulk agosto 2026\"`). Any other variable is rejected.", "examples": ["Platform subscription {{month}} {{year}}"], "title": "Name On Invoice"}, "pay_in_advance": {"description": "True bills at the start of the period; false in arrears.", "examples": [true], "title": "Pay In Advance", "type": "boolean"}, "pricing": {"description": "Pricing definition. Fixed prices always use the `standard` model.", "discriminator": {"mapping": {"standard": "#/components/schemas/StandardPricing"}, "propertyName": "model"}, "oneOf": [{"$ref": "#/components/schemas/StandardPricing"}], "title": "Pricing"}, "prorated": {"description": "True bills a partial period (for example when a contract starts mid-month) in proportion to the days covered; false always bills the full amount.", "examples": [true], "title": "Prorated", "type": "boolean"}, "status": {"$ref": "#/components/schemas/PriceLifecycleStatus", "description": "`active` is usable on a contract at once; `draft` is not.", "examples": ["active"]}, "type": {"const": "fixed", "description": "Price type discriminator; `fixed` for this request.", "title": "Type", "type": "string"}, "units": {"description": "Quantity billed, as a decimal string. `\"1\"` for one unit.", "examples": ["1"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Units", "type": "string"}}, "required": ["currency", "interval", "status", "type", "item_id", "units", "pay_in_advance", "prorated", "pricing"], "title": "CreateFixedPriceRequest", "type": "object"}, "CreateGuidedBillableMetricRequest": {"additionalProperties": false, "description": "A metric compiled from a structured definition (event name + aggregation).", "properties": {"definition_mode": {"const": "guided", "description": "Always `guided` for this request shape.", "title": "Definition Mode", "type": "string"}, "description": {"anyOf": [{"maxLength": 2000, "minLength": 5, "type": "string"}, {"type": "null"}], "description": "Internal explanation of what the metric measures.", "examples": ["Number of billable API requests made in the period."], "title": "Description"}, "filters": {"description": "Event properties and values that prices can target separately, such as a different rate per region (at most 100 per metric).", "items": {"$ref": "#/components/schemas/NewBillableMetricFilter"}, "maxItems": 100, "title": "Filters", "type": "array"}, "item_id": {"description": "ID of the catalog item this metric measures.", "examples": ["01936f2e-5a7b-7c3d-9e1f-2a3b4c5d6e7f"], "format": "uuid", "title": "Item Id", "type": "string"}, "metric_definition": {"$ref": "#/components/schemas/MetricDefinition", "description": "Event name and aggregation the metric's SQL is generated from."}, "name": {"description": "Name of the metric shown in the dashboard.", "examples": ["API requests"], "maxLength": 255, "minLength": 1, "title": "Name", "type": "string"}, "name_on_invoice": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Name printed on invoice lines for this metric. Defaults to `name`.", "examples": ["API requests"], "title": "Name On Invoice"}}, "required": ["item_id", "name", "definition_mode", "metric_definition"], "title": "CreateGuidedBillableMetricRequest", "type": "object"}, "CreateSeatMetricRequest": {"additionalProperties": false, "description": "Create a seat metric for one contract, so a seat price can bill its seat count.", "properties": {"code": {"description": "Unique within the contract; lowercase letters, digits and `_` (e.g. `admin_seats`).", "examples": ["admin_seats"], "maxLength": 100, "minLength": 1, "pattern": "^[a-z0-9_]+$", "title": "Code", "type": "string"}, "contract_id": {"description": "ID of the contract the seat metric belongs to.", "examples": ["01936f2e-3b5c-7a1b-8c9d-0e1f2a3b4c5d"], "format": "uuid", "title": "Contract Id", "type": "string"}, "description": {"anyOf": [{"maxLength": 2000, "minLength": 5, "type": "string"}, {"type": "null"}], "description": "Internal explanation of what the seats represent.", "examples": ["Users with administrator access to the customer's workspace."], "title": "Description"}, "name": {"description": "Name of the seat metric shown in the dashboard.", "examples": ["Admin seats"], "maxLength": 255, "minLength": 1, "title": "Name", "type": "string"}, "name_on_invoice": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Name printed on invoice lines for these seats. Defaults to `name`.", "examples": ["Admin seats"], "title": "Name On Invoice"}}, "required": ["contract_id", "code", "name"], "title": "CreateSeatMetricRequest", "type": "object"}, "CreateSeatPriceRequest": {"additionalProperties": false, "description": "A seat price, the seat count resolved from a seat metric each period.\n\n`standard` bills `pricing.amount` per seat. `graduated` and `volume` price the\nseat count through tiers; a tier's `flat_amount` adds a fixed base fee (for\nexample a first tier `0`-`10` with `unit_amount: \"0\"` and `flat_amount:\n\"500\"` is a platform fee that includes ten seats).", "properties": {"currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency every amount of this price is expressed in.", "examples": ["CLP"]}, "interval": {"$ref": "#/components/schemas/PriceInterval", "description": "Recurrence; `one_time` for a non-recurring price.", "examples": ["monthly"]}, "item_id": {"description": "Catalog item this price bills for.", "examples": ["0191f3c1-8a20-7b3c-9d4e-2a1b3c4d5e6f"], "format": "uuid", "title": "Item Id", "type": "string"}, "minimum_quantity": {"anyOf": [{"description": "Non-negative decimal amount as a string, e.g. `\"1000\"` or `\"10.50\"`.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "type": "string"}, {"type": "null"}], "description": "Minimum number of seats billed per period, even when fewer are in use. Null for no minimum.", "examples": ["5"], "title": "Minimum Quantity"}, "name": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Display name of the price. Defaults to the item / metric name.", "examples": ["Platform subscription"], "title": "Name"}, "name_on_invoice": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Invoice line label override. Invoice line label. May use `{{month}}`, `{{year}}` and `{{service_period}}`. Service periods render as dd/mm/yyyy - dd/mm/yyyy, with disjoint ranges separated by '; '. Referencing service_period requires complete service dates; unresolved or overlong output is rejected. Month/year are substituted from the line's billing period (e.g. `\"saas bulk {{month}} {{year}}\"` prints `\"saas bulk agosto 2026\"`). Any other variable is rejected.", "examples": ["Platform subscription {{month}} {{year}}"], "title": "Name On Invoice"}, "pay_in_advance": {"description": "True bills at the start of the period; false in arrears.", "examples": [true], "title": "Pay In Advance", "type": "boolean"}, "pricing": {"description": "Pricing definition, selected by `model`: `standard`, `graduated` or `volume`. `free_units` and `pricing_group_keys` do not apply to seats; a free allowance is a first tier priced at `0`. A `volume` seat price cannot be paid in advance.", "discriminator": {"mapping": {"graduated": "#/components/schemas/GraduatedPricing", "standard": "#/components/schemas/StandardPricing", "volume": "#/components/schemas/VolumePricing"}, "propertyName": "model"}, "oneOf": [{"$ref": "#/components/schemas/StandardPricing"}, {"$ref": "#/components/schemas/GraduatedPricing"}, {"$ref": "#/components/schemas/VolumePricing"}], "title": "Pricing"}, "prorated": {"description": "True bills a partial service period (contract start or end inside the period) in proportion to the days covered (a tier `flat_amount` included); false always bills the full period. Only seat prices billed in arrears can be prorated.", "examples": [true], "title": "Prorated", "type": "boolean"}, "quantity_strategy": {"$ref": "#/components/schemas/SeatQuantityStrategy", "description": "How the period's seat count is derived from seat events.", "examples": ["snapshot_end"]}, "seat_metric_id": {"description": "Seat metric the seat count is resolved from.", "examples": ["0191f3c1-ac42-7d5e-9f60-4c3d5e6f7081"], "format": "uuid", "title": "Seat Metric Id", "type": "string"}, "status": {"$ref": "#/components/schemas/PriceLifecycleStatus", "description": "`active` is usable on a contract at once; `draft` is not.", "examples": ["active"]}, "type": {"const": "seat", "description": "Price type discriminator; `seat` for this request.", "title": "Type", "type": "string"}}, "required": ["currency", "interval", "status", "type", "item_id", "seat_metric_id", "quantity_strategy", "pay_in_advance", "prorated", "pricing"], "title": "CreateSeatPriceRequest", "type": "object"}, "CreateSqlBillableMetricRequest": {"additionalProperties": false, "description": "A metric defined by a raw SQL aggregate expression.", "properties": {"definition_mode": {"const": "sql", "description": "Always `sql` for this request shape.", "title": "Definition Mode", "type": "string"}, "description": {"anyOf": [{"maxLength": 2000, "minLength": 5, "type": "string"}, {"type": "null"}], "description": "Internal explanation of what the metric measures.", "examples": ["Number of billable API requests made in the period."], "title": "Description"}, "filters": {"description": "Event properties and values that prices can target separately, such as a different rate per region (at most 100 per metric).", "items": {"$ref": "#/components/schemas/NewBillableMetricFilter"}, "maxItems": 100, "title": "Filters", "type": "array"}, "item_id": {"description": "ID of the catalog item this metric measures.", "examples": ["01936f2e-5a7b-7c3d-9e1f-2a3b4c5d6e7f"], "format": "uuid", "title": "Item Id", "type": "string"}, "name": {"description": "Name of the metric shown in the dashboard.", "examples": ["API requests"], "maxLength": 255, "minLength": 1, "title": "Name", "type": "string"}, "name_on_invoice": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Name printed on invoice lines for this metric. Defaults to `name`.", "examples": ["API requests"], "title": "Name On Invoice"}, "sql_expression": {"description": "Aggregate SQL expression evaluated over the period's usage events. It must restrict itself to an `event_name`; event properties are read from `properties`.", "examples": ["SUM(CASE WHEN event_name = 'api_request' THEN (properties->>'tokens')::numeric END)"], "maxLength": 4000, "minLength": 1, "title": "Sql Expression", "type": "string"}, "usage_entry_schema": {"anyOf": [{"$ref": "#/components/schemas/UsageEntrySchema"}, {"type": "null"}], "description": "Shape of usage entered by hand for this metric. Null if usage is never entered by hand."}}, "required": ["item_id", "name", "definition_mode", "sql_expression"], "title": "CreateSqlBillableMetricRequest", "type": "object"}, "CreateUsagePriceRequest": {"additionalProperties": false, "description": "A usage price: bills the quantity a billable metric aggregates.\n\nSend `billable_metric_id` for every model except `formula`, which instead takes\n`item_id` and binds its metrics in `pricing.metric_bindings`.", "properties": {"billable_metric_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Billable metric whose period quantity is priced. Required unless `pricing.model` is `formula`.", "examples": ["0191f3c1-9b31-7c4d-8e5f-3b2c4d5e6f70"], "title": "Billable Metric Id"}, "currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency every amount of this price is expressed in.", "examples": ["CLP"]}, "interval": {"$ref": "#/components/schemas/PriceInterval", "description": "Recurrence; `one_time` for a non-recurring price.", "examples": ["monthly"]}, "item_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Catalog item the formula price bills for. Required when `pricing.model` is `formula`; otherwise omit.", "title": "Item Id"}, "name": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Display name of the price. Defaults to the item / metric name.", "examples": ["Platform subscription"], "title": "Name"}, "name_on_invoice": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Invoice line label override. Invoice line label. May use `{{month}}`, `{{year}}` and `{{service_period}}`. Service periods render as dd/mm/yyyy - dd/mm/yyyy, with disjoint ranges separated by '; '. Referencing service_period requires complete service dates; unresolved or overlong output is rejected. Month/year are substituted from the line's billing period (e.g. `\"saas bulk {{month}} {{year}}\"` prints `\"saas bulk agosto 2026\"`). Any other variable is rejected.", "examples": ["Platform subscription {{month}} {{year}}"], "title": "Name On Invoice"}, "pricing": {"description": "Pricing definition, selected by `model`.", "discriminator": {"mapping": {"formula": "#/components/schemas/FormulaPricing", "graduated": "#/components/schemas/GraduatedPricing", "graduated_percentage": "#/components/schemas/GraduatedPercentagePricing", "package": "#/components/schemas/PackagePricing", "percentage": "#/components/schemas/PercentagePricing", "standard": "#/components/schemas/StandardPricing", "volume": "#/components/schemas/VolumePricing"}, "propertyName": "model"}, "oneOf": [{"$ref": "#/components/schemas/StandardPricing"}, {"$ref": "#/components/schemas/GraduatedPricing"}, {"$ref": "#/components/schemas/VolumePricing"}, {"$ref": "#/components/schemas/PackagePricing"}, {"$ref": "#/components/schemas/PercentagePricing"}, {"$ref": "#/components/schemas/GraduatedPercentagePricing"}, {"$ref": "#/components/schemas/FormulaPricing"}], "title": "Pricing"}, "status": {"$ref": "#/components/schemas/PriceLifecycleStatus", "description": "`active` is usable on a contract at once; `draft` is not.", "examples": ["active"]}, "type": {"const": "usage", "description": "Price type discriminator; `usage` for this request.", "title": "Type", "type": "string"}}, "required": ["currency", "interval", "status", "type", "pricing"], "title": "CreateUsagePriceRequest", "type": "object"}, "CreateWebhookEndpointRequest": {"additionalProperties": false, "description": "Registers a URL to receive webhook events.", "example": {"endpoint_url": "https://hooks.acmecorp.com/relvo", "subscriptions": [{"event_type": "invoice.issued", "schema_version": 1}]}, "properties": {"endpoint_url": {"description": "Absolute `https://` URL Relvo POSTs deliveries to. An organization may register a given URL only once among its non-deleted endpoints.", "examples": ["https://hooks.acmecorp.com/relvo"], "maxLength": 2048, "title": "Endpoint Url", "type": "string"}, "subscriptions": {"description": "Event types this endpoint receives. Each pair may appear only once.", "items": {"$ref": "#/components/schemas/WebhookSubscription"}, "title": "Subscriptions", "type": "array"}}, "required": ["endpoint_url", "subscriptions"], "title": "CreateWebhookEndpointRequest", "type": "object"}, "CreatedWebhookEndpoint": {"additionalProperties": false, "description": "A newly registered webhook endpoint, its signing secret and its verification challenge.", "properties": {"endpoint_url": {"description": "Destination URL.", "examples": ["https://hooks.acmecorp.com/relvo"], "title": "Endpoint Url", "type": "string"}, "id": {"description": "Webhook endpoint ID.", "examples": ["01909e26-8c1d-7a2b-9e3f-4a5b6c7d8e9f"], "format": "uuid", "title": "Id", "type": "string"}, "signing_secret": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "The HMAC signing secret, returned **only** by the call that minted it. `null` when the same `Idempotency-Key` is replayed: the secret is never stored in retrievable form, so store it immediately.", "examples": ["q3Zr8Xw1Lk5vN0bT7yHc2Jm9Fd4Sg6Ae1Pu8Ri3Oz5Wx7Ky0Bn2Ml4Vj6Ch9Qt1Ds"], "title": "Signing Secret"}, "status": {"$ref": "#/components/schemas/WebhookEndpointStatus", "description": "Endpoint lifecycle status. `pending_verification`: receives no deliveries until `POST /public/webhook-endpoints/{endpoint_id}/verify` succeeds. `active`: receives deliveries for its subscriptions. `disabled`: deliveries are paused until `POST /public/webhook-endpoints/{endpoint_id}/enable`. `deleted`: terminal.", "examples": ["active"]}, "subscriptions": {"description": "Subscribed event types, sorted by `event_type`.", "items": {"$ref": "#/components/schemas/WebhookSubscription"}, "title": "Subscriptions", "type": "array"}, "verification_challenge": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "The challenge `verify` sends to your URL. Returned only on the first response; `null` on an idempotent replay.", "examples": ["Yt7nK2pQ9wLx4cR8vB1mZ6hF3sJ0dG5aE"], "title": "Verification Challenge"}, "version": {"description": "Optimistic-concurrency version. Send it back as `If-Match` on every write.", "examples": [1], "minimum": 1.0, "title": "Version", "type": "integer"}}, "required": ["id", "endpoint_url", "status", "subscriptions", "version", "signing_secret", "verification_challenge"], "title": "CreatedWebhookEndpoint", "type": "object"}, "CreditBalance": {"description": "Aggregate capacity for one customer billing entity and one exact currency or metric.", "properties": {"billing_entity_id": {"description": "Customer billing entity owning the balance.", "format": "uuid", "title": "Billing Entity Id", "type": "string"}, "consumed": {"description": "Capacity consumed by finalized invoices.", "discriminator": {"mapping": {"metric": "#/components/schemas/FinancialMetricCredit", "money": "#/components/schemas/FinancialCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/FinancialCurrencyCredit"}, {"$ref": "#/components/schemas/FinancialMetricCredit"}], "title": "Consumed"}, "customer_id": {"description": "Customer owning the balance.", "format": "uuid", "title": "Customer Id", "type": "string"}, "evaluated_as_of": {"description": "Instant at which capacity was evaluated.", "format": "date-time", "title": "Evaluated As Of", "type": "string"}, "expired": {"description": "Capacity retired by expiry.", "discriminator": {"mapping": {"metric": "#/components/schemas/FinancialMetricCredit", "money": "#/components/schemas/FinancialCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/FinancialCurrencyCredit"}, {"$ref": "#/components/schemas/FinancialMetricCredit"}], "title": "Expired"}, "granted": {"description": "Total capacity granted.", "discriminator": {"mapping": {"metric": "#/components/schemas/FinancialMetricCredit", "money": "#/components/schemas/FinancialCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/FinancialCurrencyCredit"}, {"$ref": "#/components/schemas/FinancialMetricCredit"}], "title": "Granted"}, "remaining": {"description": "Remaining capacity, including reservations.", "discriminator": {"mapping": {"metric": "#/components/schemas/FinancialMetricCredit", "money": "#/components/schemas/FinancialCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/FinancialCurrencyCredit"}, {"$ref": "#/components/schemas/FinancialMetricCredit"}], "title": "Remaining"}, "reserved": {"description": "Capacity reserved by invoices.", "discriminator": {"mapping": {"metric": "#/components/schemas/FinancialMetricCredit", "money": "#/components/schemas/FinancialCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/FinancialCurrencyCredit"}, {"$ref": "#/components/schemas/FinancialMetricCredit"}], "title": "Reserved"}, "restored": {"description": "Capacity restored through corrections.", "discriminator": {"mapping": {"metric": "#/components/schemas/FinancialMetricCredit", "money": "#/components/schemas/FinancialCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/FinancialCurrencyCredit"}, {"$ref": "#/components/schemas/FinancialMetricCredit"}], "title": "Restored"}, "revoked": {"description": "Unused capacity explicitly revoked.", "discriminator": {"mapping": {"metric": "#/components/schemas/FinancialMetricCredit", "money": "#/components/schemas/FinancialCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/FinancialCurrencyCredit"}, {"$ref": "#/components/schemas/FinancialMetricCredit"}], "title": "Revoked"}, "rollover_received": {"anyOf": [{"discriminator": {"mapping": {"metric": "#/components/schemas/FinancialMetricCredit", "money": "#/components/schemas/FinancialCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/FinancialCurrencyCredit"}, {"$ref": "#/components/schemas/FinancialMetricCredit"}]}, {"type": "null"}], "description": "Capacity received through rollover.", "title": "Rollover Received"}, "rollover_transferred": {"anyOf": [{"discriminator": {"mapping": {"metric": "#/components/schemas/FinancialMetricCredit", "money": "#/components/schemas/FinancialCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/FinancialCurrencyCredit"}, {"$ref": "#/components/schemas/FinancialMetricCredit"}]}, {"type": "null"}], "description": "Capacity transferred through rollover.", "title": "Rollover Transferred"}, "spendable": {"description": "Capacity currently available for new reservations.", "discriminator": {"mapping": {"metric": "#/components/schemas/FinancialMetricCredit", "money": "#/components/schemas/FinancialCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/FinancialCurrencyCredit"}, {"$ref": "#/components/schemas/FinancialMetricCredit"}], "title": "Spendable"}}, "required": ["customer_id", "billing_entity_id", "evaluated_as_of", "granted", "remaining", "reserved", "spendable", "consumed", "restored", "expired", "revoked", "rollover_received", "rollover_transferred"], "title": "CreditBalance", "type": "object"}, "CreditBalancePage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/CreditBalance"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[CreditBalance]", "type": "object"}, "CreditCustomerSummary": {"description": "A customer with complete balances, paginated by customers rather than allowances.", "properties": {"balances": {"description": "Separate balances per billing entity and currency or metric; never summed across assets.", "items": {"$ref": "#/components/schemas/CreditBalance"}, "title": "Balances", "type": "array"}, "customer_id": {"description": "Customer owning the credits.", "format": "uuid", "title": "Customer Id", "type": "string"}, "customer_name": {"description": "Customer display name.", "title": "Customer Name", "type": "string"}, "grant_count": {"description": "Number of financial grants belonging to the customer.", "title": "Grant Count", "type": "integer"}}, "required": ["customer_id", "customer_name", "grant_count", "balances"], "title": "CreditCustomerSummary", "type": "object"}, "CreditCustomerSummaryPage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/CreditCustomerSummary"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[CreditCustomerSummary]", "type": "object"}, "CreditGrant": {"additionalProperties": false, "description": "Complete stable credit grant configuration and current availability.", "properties": {"amount": {"description": "Configured entitlement, excluding rollover. Creation supports fifteen integer and ten fractional digits.", "title": "Amount", "type": "number"}, "availableBalance": {"description": "Exact currently usable, unreserved capacity; can exceed amount following rollover.", "title": "Availablebalance", "type": "number"}, "billingFrequency": {"description": "Frequency at which the grant purchase is charged.", "enum": ["ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "title": "Billingfrequency", "type": "string"}, "contractId": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Amendment-stable contract lineage ID for phase grants; null for customer grants.", "title": "Contractid"}, "costOfCredit": {"anyOf": [{"type": "number"}, {"type": "null"}], "description": "Amount charged for the credit, zero for free credit. Creation cannot exceed the granted amount.", "title": "Costofcredit"}, "createdAt": {"description": "UTC instant when this commercial grant configuration was first created.", "title": "Createdat", "type": "string"}, "creditUnitType": {"description": "CURRENCY for currency-denominated credit or METRIC for units of a billable metric.", "enum": ["CURRENCY", "METRIC"], "title": "Creditunittype", "type": "string"}, "currency": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "ISO-4217 denomination; null for metric grants.", "title": "Currency"}, "customerId": {"description": "Customer receiving or owning the credit grant.", "format": "uuid", "title": "Customerid", "type": "string"}, "effectiveDate": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "First valid UTC calendar date, inclusive; null leaves the start unrestricted.", "title": "Effectivedate"}, "expiryDate": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Last valid UTC calendar date, inclusive; null means no expiry.", "title": "Expirydate"}, "grantRefreshFrequency": {"description": "Frequency at which a new allowance is granted, independently of purchase cadence.", "enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "title": "Grantrefreshfrequency", "type": "string"}, "id": {"description": "Stable grant resource ID, retained across refreshes.", "format": "uuid", "title": "Id", "type": "string"}, "integrationIds": {"description": "External integration identifiers, at most one per service.", "items": {"$ref": "#/components/schemas/IntegrationId"}, "title": "Integrationids", "type": "array"}, "metricId": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Metric denomination ID, null for currency grants.", "title": "Metricid"}, "name": {"description": "Human-readable grant name, up to 256 characters. Defaults to Credit grant on creation.", "title": "Name", "type": "string"}, "phaseId": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Current phase ID for phase grants; null for customer grants.", "title": "Phaseid"}, "restrictToPrices": {"description": "Eligible phase price IDs, resolving an unrestricted phase grant to all of its prices; empty for customer grants.", "items": {"type": "string"}, "title": "Restricttoprices", "type": "array"}, "rolloverMode": {"description": "Whether unused unreserved credit rolls over on refresh and across a phase transition.", "enum": ["NONE", "ON_GRANT_REFRESH", "ON_GRANT_REFRESH_AND_PHASE"], "title": "Rollovermode", "type": "string"}, "scope": {"description": "CUSTOMER for standalone grants, SCHEDULE for contract phase grants.", "enum": ["CUSTOMER", "SCHEDULE"], "title": "Scope", "type": "string"}, "sequenceAccountId": {"description": "Relvo organization ID under the Sequence-compatible account field name.", "format": "uuid", "title": "Sequenceaccountid", "type": "string"}, "sourceGrantId": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Stable predecessor grant ID for cross-phase rollover; null when no distinct predecessor applies.", "title": "Sourcegrantid"}, "state": {"$ref": "#/components/schemas/GrantState", "description": "Independent grant-level issuance and calendar validity."}, "taxRateId": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Tax rate applied to the credit purchase, or null.", "title": "Taxrateid"}, "updatedAt": {"description": "UTC instant of the latest configuration change; balance, issuance and refresh activity do not update it.", "title": "Updatedat", "type": "string"}}, "required": ["id", "sequenceAccountId", "customerId", "scope", "contractId", "phaseId", "name", "creditUnitType", "currency", "metricId", "amount", "availableBalance", "state", "costOfCredit", "taxRateId", "effectiveDate", "expiryDate", "createdAt", "updatedAt", "grantRefreshFrequency", "billingFrequency", "rolloverMode", "sourceGrantId", "restrictToPrices", "integrationIds"], "title": "CreditGrant", "type": "object"}, "CreditJournalEntry": {"description": "One immutable financial credit movement.", "properties": {"billing_entity_id": {"description": "Customer billing entity owning the credits.", "format": "uuid", "title": "Billing Entity Id", "type": "string"}, "customer_id": {"description": "Customer owning the credits.", "format": "uuid", "title": "Customer Id", "type": "string"}, "effective_at": {"description": "When the capacity movement takes effect, retaining exact microseconds.", "format": "date-time", "title": "Effective At", "type": "string"}, "grant_id": {"description": "Financial allowance affected by the movement.", "format": "uuid", "title": "Grant Id", "type": "string"}, "id": {"description": "Immutable journal entry ID.", "format": "uuid", "title": "Id", "type": "string"}, "invoice_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Related invoice, if any.", "title": "Invoice Id"}, "kind": {"description": "Type of immutable capacity movement.", "enum": ["grant", "rollover_in", "rollover_out", "reserve", "release", "consume", "expire", "revoke", "reverse_consumption"], "title": "Kind", "type": "string"}, "occurred_at": {"description": "When the operation occurred, retaining exact microseconds.", "format": "date-time", "title": "Occurred At", "type": "string"}, "reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Optional reason recorded for revocation.", "title": "Reason"}, "retired_value": {"description": "Capacity retired rather than returned to spendability.", "discriminator": {"mapping": {"metric": "#/components/schemas/FinancialMetricCredit", "money": "#/components/schemas/FinancialCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/FinancialCurrencyCredit"}, {"$ref": "#/components/schemas/FinancialMetricCredit"}], "title": "Retired Value"}, "value": {"description": "Exact capacity moved.", "discriminator": {"mapping": {"metric": "#/components/schemas/FinancialMetricCredit", "money": "#/components/schemas/FinancialCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/FinancialCurrencyCredit"}, {"$ref": "#/components/schemas/FinancialMetricCredit"}], "title": "Value"}}, "required": ["id", "grant_id", "customer_id", "billing_entity_id", "kind", "value", "retired_value", "occurred_at", "effective_at", "invoice_id"], "title": "CreditJournalEntry", "type": "object"}, "CreditJournalEntryPage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/CreditJournalEntry"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[CreditJournalEntry]", "type": "object"}, "CreditMutation": {"description": "Original immutable result of a credit command; idempotent retries replay this result.", "properties": {"changed": {"description": "Whether the command changed the financial grant.", "title": "Changed", "type": "boolean"}, "face_value": {"description": "Exact granted capacity.", "discriminator": {"mapping": {"metric": "#/components/schemas/FinancialMetricCredit", "money": "#/components/schemas/FinancialCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/FinancialCurrencyCredit"}, {"$ref": "#/components/schemas/FinancialMetricCredit"}], "title": "Face Value"}, "id": {"description": "Financial credit grant ID.", "format": "uuid", "title": "Id", "type": "string"}, "purchase_invoice_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Created purchase invoice draft, or null.", "title": "Purchase Invoice Id"}, "version": {"description": "Grant version after the command; also returned as ETag.", "title": "Version", "type": "integer"}}, "required": ["id", "version", "face_value", "purchase_invoice_id", "changed"], "title": "CreditMutation", "type": "object"}, "CreditNote": {"additionalProperties": false, "description": "A credit note: a fiscal document that reduces or cancels the amount owed on an issued\ninvoice.", "properties": {"created_at": {"description": "When the note was created.", "examples": ["2026-02-15T12:00:00Z"], "format": "date-time", "title": "Created At", "type": "string"}, "currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency of every amount on the note; the invoice currency.", "examples": ["CLP"]}, "customer_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Customer the note is addressed to.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a13"], "title": "Customer Id"}, "fiscal": {"$ref": "#/components/schemas/FiscalDocument", "description": "The tax document behind the note."}, "gross_amount": {"description": "Tax-inclusive total of the note.", "examples": ["119000"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Gross Amount", "type": "string"}, "id": {"description": "Credit note id.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a31"], "format": "uuid", "title": "Id", "type": "string"}, "invoice_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Invoice the note credits; null for an imported note whose invoice is not in Relvo.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10"], "title": "Invoice Id"}, "issue_date": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Fiscal issue date; null on a draft that has none yet.", "examples": ["2026-02-15"], "title": "Issue Date"}, "issued_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When the note was issued; null until issued.", "examples": ["2026-02-15T12:05:00Z"], "title": "Issued At"}, "lines": {"description": "The note's lines, in document order.", "items": {"$ref": "#/components/schemas/CreditNoteLine"}, "title": "Lines", "type": "array"}, "net_amount": {"description": "Tax-exclusive total of the note's lines.", "examples": ["100000"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Net Amount", "type": "string"}, "status": {"$ref": "#/components/schemas/CorrectionNoteStatus", "description": "Lifecycle status: `draft` (editable, no fiscal effect), `open` (issued), `void` (issued and then voided) or `cancelled` (a draft discarded before issuing).", "examples": ["open"]}, "tax_amount": {"description": "Total tax of the note.", "examples": ["19000"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Tax Amount", "type": "string"}, "updated_at": {"description": "When the note last changed (issuance, fiscal outcome, void or discard).", "examples": ["2026-02-15T12:10:00Z"], "format": "date-time", "title": "Updated At", "type": "string"}, "version": {"description": "Concurrency version; send it as `If-Match` to change the note.", "examples": [2], "title": "Version", "type": "integer"}, "voided_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When the note was voided; null unless void.", "examples": ["2026-02-20T09:00:00Z"], "title": "Voided At"}}, "required": ["id", "version", "invoice_id", "customer_id", "status", "issue_date", "net_amount", "tax_amount", "gross_amount", "currency", "lines", "fiscal", "created_at", "updated_at", "issued_at", "voided_at"], "title": "CreditNote", "type": "object"}, "CreditNoteCreate": {"additionalProperties": false, "description": "A new draft credit note that reduces or cancels the amount owed on an issued invoice.", "example": {"invoice_id": "0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "issue_date": "2026-02-15", "lines": []}, "properties": {"invoice_id": {"description": "Issued invoice the note credits.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10"], "format": "uuid", "title": "Invoice Id", "type": "string"}, "issue_date": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Fiscal issue date. Optional on a draft; `issue` sets it.", "examples": ["2026-02-15"], "title": "Issue Date"}, "lines": {"default": [], "description": "Lines to credit. Omit or send `[]` to credit everything that remains on the invoice (a full cancellation).", "items": {"$ref": "#/components/schemas/CreditNoteLineInput"}, "title": "Lines", "type": "array"}}, "required": ["invoice_id"], "title": "CreditNoteCreate", "type": "object"}, "CreditNoteFiscalRejectedData": {"additionalProperties": false, "description": "The tax authority rejected a credit note.", "properties": {"credit_note_id": {"description": "The credit note.", "format": "uuid", "title": "Credit Note Id", "type": "string"}, "rejection_reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Authority message explaining the rejection.", "title": "Rejection Reason"}, "source_invoice_id": {"description": "The invoice the credit note corrects.", "format": "uuid", "title": "Source Invoice Id", "type": "string"}}, "required": ["credit_note_id", "source_invoice_id", "rejection_reason"], "title": "CreditNoteFiscalRejectedData", "type": "object"}, "CreditNoteFiscalRejectedEvent": {"additionalProperties": false, "description": "`credit_note.fiscal_rejected`: The tax authority rejected a credit note.", "properties": {"created_at": {"description": "When the event entered the event log. The `created_at_from`/`created_at_to` filters and the 30-day retention window apply to it.", "format": "date-time", "title": "Created At", "type": "string"}, "data": {"$ref": "#/components/schemas/CreditNoteFiscalRejectedData", "description": "The event's payload, typed by `type`."}, "id": {"description": "Event id; the same value as the `Relvo-Event-Id` header of every delivery of this event. Use it to deduplicate.", "format": "uuid", "title": "Id", "type": "string"}, "occurred_at": {"description": "When the change happened in Relvo.", "format": "date-time", "title": "Occurred At", "type": "string"}, "organization_id": {"description": "The organization the event belongs to.", "format": "uuid", "title": "Organization Id", "type": "string"}, "schema_version": {"description": "Version of this event type's `data` schema.", "minimum": 1.0, "title": "Schema Version", "type": "integer"}, "type": {"const": "credit_note.fiscal_rejected", "description": "The event type.", "title": "Type", "type": "string"}}, "required": ["id", "schema_version", "occurred_at", "organization_id", "created_at", "type", "data"], "title": "CreditNoteFiscalRejectedEvent", "type": "object"}, "CreditNoteIssue": {"additionalProperties": false, "description": "Issues a draft credit note, giving it fiscal effect.", "properties": {"issue_date": {"description": "Fiscal issue date of the note.", "examples": ["2026-02-15"], "format": "date", "title": "Issue Date", "type": "string"}}, "required": ["issue_date"], "title": "CreditNoteIssue", "type": "object"}, "CreditNoteIssuedData": {"additionalProperties": false, "description": "The tax authority accepted a credit note.", "properties": {"credit_note_id": {"description": "The credit note.", "format": "uuid", "title": "Credit Note Id", "type": "string"}, "fiscal_uuid": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Tax authority document id, when the provider gives one.", "title": "Fiscal Uuid"}, "folio": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Fiscal folio number.", "title": "Folio"}, "source_invoice_id": {"description": "The invoice the credit note corrects.", "format": "uuid", "title": "Source Invoice Id", "type": "string"}}, "required": ["credit_note_id", "source_invoice_id", "fiscal_uuid", "folio"], "title": "CreditNoteIssuedData", "type": "object"}, "CreditNoteIssuedEvent": {"additionalProperties": false, "description": "`credit_note.issued`: The tax authority accepted a credit note.", "properties": {"created_at": {"description": "When the event entered the event log. The `created_at_from`/`created_at_to` filters and the 30-day retention window apply to it.", "format": "date-time", "title": "Created At", "type": "string"}, "data": {"$ref": "#/components/schemas/CreditNoteIssuedData", "description": "The event's payload, typed by `type`."}, "id": {"description": "Event id; the same value as the `Relvo-Event-Id` header of every delivery of this event. Use it to deduplicate.", "format": "uuid", "title": "Id", "type": "string"}, "occurred_at": {"description": "When the change happened in Relvo.", "format": "date-time", "title": "Occurred At", "type": "string"}, "organization_id": {"description": "The organization the event belongs to.", "format": "uuid", "title": "Organization Id", "type": "string"}, "schema_version": {"description": "Version of this event type's `data` schema.", "minimum": 1.0, "title": "Schema Version", "type": "integer"}, "type": {"const": "credit_note.issued", "description": "The event type.", "title": "Type", "type": "string"}}, "required": ["id", "schema_version", "occurred_at", "organization_id", "created_at", "type", "data"], "title": "CreditNoteIssuedEvent", "type": "object"}, "CreditNoteLine": {"additionalProperties": false, "description": "One line of a credit note.", "properties": {"currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency of the line amounts."}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Optional line description.", "title": "Description"}, "gross_amount": {"description": "Tax-inclusive line amount.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Gross Amount", "type": "string"}, "id": {"description": "Line id.", "format": "uuid", "title": "Id", "type": "string"}, "line_number": {"description": "1-based position of the line on the document.", "title": "Line Number", "type": "integer"}, "mode": {"anyOf": [{"$ref": "#/components/schemas/CreditNoteLineMode"}, {"type": "null"}], "description": "How the line was credited; null for a line imported from the tax authority.", "examples": ["net_amount_credit"]}, "net_amount": {"description": "Tax-exclusive line amount.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Net Amount", "type": "string"}, "quantity": {"anyOf": [{"pattern": "^\\d+(\\.\\d+)?$", "type": "string"}, {"type": "null"}], "description": "Quantity, as a non-negative decimal string.", "title": "Quantity"}, "source_invoice_line_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Source invoice line this line corrects. Null for a debit `additional_charge` and for imported credit lines that credit no known invoice line.", "title": "Source Invoice Line Id"}, "tax_amount": {"description": "Tax on the line.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Tax Amount", "type": "string"}, "title": {"description": "Line title printed on the fiscal document.", "title": "Title", "type": "string"}}, "required": ["id", "line_number", "source_invoice_line_id", "title", "description", "quantity", "net_amount", "tax_amount", "gross_amount", "currency", "mode"], "title": "CreditNoteLine", "type": "object"}, "CreditNoteLineInput": {"additionalProperties": false, "description": "One invoice line to credit, and how much of it.", "properties": {"gross_amount": {"anyOf": [{"description": "Non-negative decimal amount as a string, e.g. `\"1000\"` or `\"10.50\"`.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "type": "string"}, {"type": "null"}], "description": "Tax-inclusive amount to credit, in the invoice currency.", "examples": ["119000"], "title": "Gross Amount"}, "mode": {"$ref": "#/components/schemas/CreditNoteLineMode", "description": "`quantity_credit` requires only `quantity`; `net_amount_credit` only `net_amount`; `gross_amount_credit` only `gross_amount`; `full_remaining` credits the line's whole remaining capacity and takes none of them.", "examples": ["net_amount_credit"]}, "net_amount": {"anyOf": [{"description": "Non-negative decimal amount as a string, e.g. `\"1000\"` or `\"10.50\"`.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "type": "string"}, {"type": "null"}], "description": "Tax-exclusive amount to credit, in the invoice currency.", "examples": ["100000"], "title": "Net Amount"}, "quantity": {"anyOf": [{"description": "Non-negative decimal amount as a string, e.g. `\"1000\"` or `\"10.50\"`.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "type": "string"}, {"type": "null"}], "description": "Quantity to credit.", "examples": ["2"], "title": "Quantity"}, "source_invoice_line_id": {"description": "Source invoice line being credited.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a24"], "format": "uuid", "title": "Source Invoice Line Id", "type": "string"}}, "required": ["mode", "source_invoice_line_id"], "title": "CreditNoteLineInput", "type": "object"}, "CreditNoteLineMode": {"description": "How a credit line is measured against its source invoice line.\n\n- `full_remaining`: credits everything that has not yet been credited on the line.\n- `quantity_credit`: credits a number of units at the line's unit price.\n- `net_amount_credit`: credits a tax-exclusive amount; tax is derived from the line's rate.\n- `gross_amount_credit`: credits a tax-inclusive amount; the net and tax split is derived.", "enum": ["full_remaining", "quantity_credit", "net_amount_credit", "gross_amount_credit"], "title": "CreditNoteLineMode", "type": "string"}, "CreditNoteList": {"additionalProperties": false, "description": "A page of credit notes; pass `next_cursor` as `cursor` to fetch the next page.", "properties": {"items": {"description": "The credit notes on this page.", "items": {"$ref": "#/components/schemas/CreditNote"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Pass as `cursor` for the next page; null on the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items", "next_cursor"], "title": "CreditNoteList", "type": "object"}, "CreditPurchaseInvoice": {"additionalProperties": false, "description": "Invoice draft for the purchased credits, committed atomically with the grant.", "properties": {"issue_date": {"description": "Invoice issue calendar date.", "format": "date", "title": "Issue Date", "type": "string"}, "issuer_billing_entity_id": {"description": "Your legal entity issuing the purchase invoice.", "format": "uuid", "title": "Issuer Billing Entity Id", "type": "string"}, "item_id": {"description": "Active catalog item used for the purchase line.", "format": "uuid", "title": "Item Id", "type": "string"}, "payment_terms_days": {"description": "Days from the issue date until payment is due; zero means due on receipt.", "minimum": 0.0, "title": "Payment Terms Days", "type": "integer"}, "tax_rate_ids": {"description": "Optional statutory VAT reference; must agree with invoicing fiscal policy.", "items": {"format": "uuid", "type": "string"}, "maxItems": 1, "title": "Tax Rate Ids", "type": "array"}, "title": {"description": "Description on the purchase invoice.", "maxLength": 255, "minLength": 1, "title": "Title", "type": "string"}}, "required": ["issuer_billing_entity_id", "item_id", "title", "issue_date", "payment_terms_days"], "title": "CreditPurchaseInvoice", "type": "object"}, "CurrencyCodeEnum": {"description": "A currency, as its ISO 4217 alphabetic code (uppercase, e.g. `CLP`, `USD`).\n\nIncludes `CLF` (Chile's Unidad de Fomento) and a few widely used\nnon-ISO territorial codes (`CKD`, `FOK`, `GGP`, `IMP`, `JEP`, `KID`, `TVD`).", "enum": ["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CKD", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "EHP", "ERN", "ETB", "EUR", "FJD", "FKP", "FOK", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "IMP", "INR", "IQD", "IRR", "ISK", "JEP", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KID", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRU", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PND", "PRB", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SLS", "SOS", "SRD", "SSP", "STN", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TVD", "TWD", "TZS", "UAH", "CLF", "UGX", "USD", "UYU", "UZS", "VED", "VES", "VND", "VUV", "WST", "XAF", "XCD", "XOF", "XPF", "YER", "ZAR", "ZMW", "ZWB", "ZWL"], "title": "CurrencyCodeEnum", "type": "string"}, "CurrencyConversion": {"additionalProperties": false, "description": "The official exchange rate between two currencies at a given instant.", "properties": {"as_of": {"description": "The instant the rate was resolved for (UTC).", "examples": ["2026-09-16T12:00:00Z"], "format": "date-time", "title": "As Of", "type": "string"}, "base_currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency converted from.", "examples": ["USD"]}, "quote_currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency converted to.", "examples": ["CLP"]}, "rate": {"description": "Units of `quote_currency` per 1 unit of `base_currency`, as an exact decimal string.", "examples": ["950.12"], "title": "Rate", "type": "string"}, "rate_date": {"description": "Calendar date the rate was published for. May be earlier than the `as_of` date.", "examples": ["2026-09-15"], "format": "date", "title": "Rate Date", "type": "string"}, "source": {"$ref": "#/components/schemas/CurrencyConversionSource", "description": "Publisher of the rate.", "examples": ["bcch"]}}, "required": ["base_currency", "quote_currency", "rate", "rate_date", "as_of", "source"], "title": "CurrencyConversion", "type": "object"}, "CurrencyConversionSource": {"description": "Publisher of an official rate.\n\n- `bcch`: Banco Central de Chile.\n- `ecb`: European Central Bank.\n- `derived`: a cross rate composed from two official rates.", "enum": ["bcch", "ecb", "derived"], "title": "CurrencyConversionSource", "type": "string"}, "Customer": {"additionalProperties": false, "description": "A customer of the token's organization.", "example": {"assigned_member_ids": [], "code": "ACME-CORP", "created_at": "2026-07-01T09:15:00.000Z", "default_billing_entity_id": "01909e26-e2b5-7f6d-9a7b-8c0d1e2f3a4b", "display_name": "Acme Corp", "external_references": [{"id": "ACC-88213", "type": "salesforce", "url": "https://acme.my.salesforce.com/ACC-88213"}], "id": "01909e26-7f2b-7c3e-8b1a-2f4e6d8a1c3b", "is_active": true, "metadata": {"crm_account_id": "ACC-88213", "segment": "enterprise"}, "updated_at": "2026-07-01T09:15:00.000Z", "version": 1}, "properties": {"assigned_member_ids": {"description": "Ids of the organization's team members responsible for this customer (for example account managers). They are copied and set as reply-to on emails sent to the customer. Empty when nobody is assigned.", "examples": [["01909e26-5d4c-7b3a-9e8f-1a2b3c4d5e6f"]], "items": {"format": "uuid", "type": "string"}, "title": "Assigned Member Ids", "type": "array"}, "code": {"description": "Your own short code for the customer, unique within the organization.", "examples": ["ACME-CORP"], "title": "Code", "type": "string"}, "created_at": {"description": "When the customer was created (UTC, RFC 3339).", "examples": ["2026-07-01T09:15:00.000Z"], "format": "date-time", "title": "Created At", "type": "string"}, "default_billing_entity_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "The billing entity used by default when invoicing this customer; null until a billing entity is created.", "examples": ["01909e26-e2b5-7f6d-9a7b-8c0d1e2f3a4b"], "title": "Default Billing Entity Id"}, "deleted_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When the customer was deleted (UTC, RFC 3339). Always null except on deletion tombstones returned by the customer list with `include_deleted=true`; deleting a customer also sets `updated_at`, so `updated_since` picks the deletion up.", "examples": [null], "title": "Deleted At"}, "display_name": {"description": "Name shown for the customer across the platform and in lists.", "examples": ["Acme Corp"], "title": "Display Name", "type": "string"}, "external_references": {"description": "Pointers to this customer's records in other systems (CRM, ERP, ...).", "items": {"$ref": "#/components/schemas/CustomerExternalReference"}, "title": "External References", "type": "array"}, "id": {"description": "Unique identifier of the customer.", "examples": ["01909e26-7f2b-7c3e-8b1a-2f4e6d8a1c3b"], "format": "uuid", "title": "Id", "type": "string"}, "is_active": {"description": "Whether the customer is active. Filter the customer list on it with `is_active`.", "examples": [true], "title": "Is Active", "type": "boolean"}, "metadata": {"additionalProperties": {"type": "string"}, "description": "Your own key/value pairs for this customer, returned exactly as stored. Relvo never interprets them. Empty object when none are set.", "examples": [{"crm_account_id": "ACC-88213", "segment": "enterprise"}], "title": "Metadata", "type": "object"}, "updated_at": {"description": "When the customer was last changed (UTC, RFC 3339).", "examples": ["2026-07-01T09:15:00.000Z"], "format": "date-time", "title": "Updated At", "type": "string"}, "version": {"description": "Version of the customer, incremented on every change. Equals the `ETag` header; send it as `If-Match` when updating or deleting.", "examples": [1], "title": "Version", "type": "integer"}}, "required": ["id", "code", "display_name", "is_active", "created_at", "updated_at", "version"], "title": "Customer", "type": "object"}, "CustomerCreateRequest": {"additionalProperties": false, "description": "Body of ``POST /customers``. Billing entities are created separately.", "example": {"assigned_member_ids": [], "code": "ACME-CORP", "display_name": "Acme Corp", "external_references": [{"id": "ACC-88213", "type": "salesforce", "url": "https://acme.my.salesforce.com/ACC-88213"}]}, "properties": {"assigned_member_ids": {"description": "Ids of the organization's team members responsible for this customer. They are copied and set as reply-to on emails sent to the customer. Each id must exist.", "examples": [["01909e26-5d4c-7b3a-9e8f-1a2b3c4d5e6f"]], "items": {"format": "uuid", "type": "string"}, "title": "Assigned Member Ids", "type": "array"}, "code": {"description": "Your own short code for the customer. Must be unique within the organization.", "examples": ["ACME-CORP"], "minLength": 1, "title": "Code", "type": "string"}, "display_name": {"description": "Name shown for the customer across the platform and in lists.", "examples": ["Acme Corp"], "minLength": 1, "title": "Display Name", "type": "string"}, "external_references": {"description": "Pointers to this customer's records in other systems (CRM, ERP, ...).", "items": {"$ref": "#/components/schemas/CustomerExternalReference"}, "title": "External References", "type": "array"}, "metadata": {"anyOf": [{"additionalProperties": {"type": "string"}, "type": "object"}, {"type": "null"}], "description": "Your own key/value pairs to store on the customer (for example your CRM id). Keys with an empty-string value are ignored. At most 50 keys; keys are 1-40 characters and may not contain `[` or `]`; values are strings of at most 500 characters.", "examples": [{"crm_account_id": "ACC-88213", "segment": "enterprise"}], "title": "Metadata"}}, "required": ["code", "display_name"], "title": "CustomerCreateRequest", "type": "object"}, "CustomerCreatedEvent": {"additionalProperties": false, "description": "`customer.created`: A customer was created.", "properties": {"created_at": {"description": "When the event entered the event log. The `created_at_from`/`created_at_to` filters and the 30-day retention window apply to it.", "format": "date-time", "title": "Created At", "type": "string"}, "data": {"$ref": "#/components/schemas/CustomerEventData", "description": "The event's payload, typed by `type`."}, "id": {"description": "Event id; the same value as the `Relvo-Event-Id` header of every delivery of this event. Use it to deduplicate.", "format": "uuid", "title": "Id", "type": "string"}, "occurred_at": {"description": "When the change happened in Relvo.", "format": "date-time", "title": "Occurred At", "type": "string"}, "organization_id": {"description": "The organization the event belongs to.", "format": "uuid", "title": "Organization Id", "type": "string"}, "schema_version": {"description": "Version of this event type's `data` schema.", "minimum": 1.0, "title": "Schema Version", "type": "integer"}, "type": {"const": "customer.created", "description": "The event type.", "title": "Type", "type": "string"}}, "required": ["id", "schema_version", "occurred_at", "organization_id", "created_at", "type", "data"], "title": "CustomerCreatedEvent", "type": "object"}, "CustomerDeletedEvent": {"additionalProperties": false, "description": "`customer.deleted`: A customer was deleted.", "properties": {"created_at": {"description": "When the event entered the event log. The `created_at_from`/`created_at_to` filters and the 30-day retention window apply to it.", "format": "date-time", "title": "Created At", "type": "string"}, "data": {"$ref": "#/components/schemas/CustomerEventData", "description": "The event's payload, typed by `type`."}, "id": {"description": "Event id; the same value as the `Relvo-Event-Id` header of every delivery of this event. Use it to deduplicate.", "format": "uuid", "title": "Id", "type": "string"}, "occurred_at": {"description": "When the change happened in Relvo.", "format": "date-time", "title": "Occurred At", "type": "string"}, "organization_id": {"description": "The organization the event belongs to.", "format": "uuid", "title": "Organization Id", "type": "string"}, "schema_version": {"description": "Version of this event type's `data` schema.", "minimum": 1.0, "title": "Schema Version", "type": "integer"}, "type": {"const": "customer.deleted", "description": "The event type.", "title": "Type", "type": "string"}}, "required": ["id", "schema_version", "occurred_at", "organization_id", "created_at", "type", "data"], "title": "CustomerDeletedEvent", "type": "object"}, "CustomerEventData": {"additionalProperties": false, "description": "A customer changed; read it for its current state.", "properties": {"customer_id": {"description": "The customer; read it with `GET /public/customers/{customer_id}`. After `customer.deleted` the read returns `404`.", "format": "uuid", "title": "Customer Id", "type": "string"}}, "required": ["customer_id"], "title": "CustomerEventData", "type": "object"}, "CustomerExternalReference": {"additionalProperties": false, "description": "A pointer to the same record in another system (CRM, ERP, ...).\n\nIdentical on input and output; ``id`` is what the customer list's\n``external_reference`` filter matches.", "example": {"id": "ACC-88213", "type": "salesforce", "url": "https://acme.my.salesforce.com/ACC-88213"}, "properties": {"id": {"description": "The record's identifier in the external system. The customer list's `external_reference` filter matches on this value.", "examples": ["ACC-88213"], "minLength": 1, "title": "Id", "type": "string"}, "type": {"description": "Free-form name of the external system the record lives in.", "examples": ["salesforce"], "minLength": 1, "title": "Type", "type": "string"}, "url": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Link to the record in the external system. Null when not provided.", "examples": ["https://acme.my.salesforce.com/ACC-88213"], "title": "Url"}}, "required": ["type", "id"], "title": "CustomerExternalReference", "type": "object"}, "CustomerListSortField": {"description": "A key the customers list can be ordered by. Ties break on the customer id.\n\n`created_at` orders by when the customer was created; `display_name` by\ndisplay name, ignoring case; `status` puts active customers before inactive\nones in ascending order.", "enum": ["created_at", "display_name", "status"], "title": "CustomerListSortField", "type": "string"}, "CustomerPage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/Customer"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[Customer]", "type": "object"}, "CustomerPaymentMethod": {"additionalProperties": false, "description": "A payment method assigned to one of a customer's billing entities.\n\nAt most one active assignment per billing entity has `is_default` true; making one the\ndefault removes the flag from the previous one.", "properties": {"billing_entity_id": {"description": "The billing entity the payment method is assigned to.", "examples": ["01909e26-e2b5-7f6d-9a7b-8c0d1e2f3a4b"], "format": "uuid", "title": "Billing Entity Id", "type": "string"}, "created_at": {"description": "When the resource was created (UTC, RFC 3339).", "examples": ["2026-07-01T09:15:00.000Z"], "format": "date-time", "title": "Created At", "type": "string"}, "customer_id": {"description": "The customer the billing entity belongs to.", "examples": ["01909e26-7f2b-7c3e-8b1a-2f4e6d8a1c3b"], "format": "uuid", "title": "Customer Id", "type": "string"}, "id": {"description": "Unique identifier of this assignment.", "examples": ["01909e26-9a20-7c3e-8b1a-2f4e6d8a1c3b"], "format": "uuid", "title": "Id", "type": "string"}, "is_active": {"description": "Whether the assignment is in effect. Removed assignments are inactive.", "examples": [true], "title": "Is Active", "type": "boolean"}, "is_default": {"description": "Whether this is the billing entity's default payment method.", "examples": [true], "title": "Is Default", "type": "boolean"}, "payment_method": {"$ref": "#/components/schemas/PaymentMethod", "description": "The assigned payment method."}, "updated_at": {"description": "When the resource was last changed (UTC, RFC 3339).", "examples": ["2026-07-01T09:15:00.000Z"], "format": "date-time", "title": "Updated At", "type": "string"}, "version": {"description": "Version of the assignment, incremented on every change. Equals the `ETag` header; send it as `If-Match` when updating.", "examples": [1], "title": "Version", "type": "integer"}}, "required": ["created_at", "updated_at", "id", "customer_id", "billing_entity_id", "is_active", "is_default", "payment_method", "version"], "title": "CustomerPaymentMethod", "type": "object"}, "CustomerPaymentMethodCreateRequest": {"additionalProperties": false, "description": "Body of ``POST /customers/{customer_id}/payment-methods``.", "example": {"billing_entity_id": "01909e26-e2b5-7f6d-9a7b-8c0d1e2f3a4b", "is_default": true, "payment_method_id": "01909e26-9a10-7c3e-8b1a-2f4e6d8a1c3b"}, "properties": {"billing_entity_id": {"description": "One of this customer's billing entities.", "examples": ["01909e26-e2b5-7f6d-9a7b-8c0d1e2f3a4b"], "format": "uuid", "title": "Billing Entity Id", "type": "string"}, "is_default": {"default": false, "description": "Make this the billing entity's default payment method.", "examples": [true], "title": "Is Default", "type": "boolean"}, "payment_method_id": {"description": "The payment method to assign.", "examples": ["01909e26-9a10-7c3e-8b1a-2f4e6d8a1c3b"], "format": "uuid", "title": "Payment Method Id", "type": "string"}}, "required": ["billing_entity_id", "payment_method_id"], "title": "CustomerPaymentMethodCreateRequest", "type": "object"}, "CustomerPaymentMethodPage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/CustomerPaymentMethod"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[CustomerPaymentMethod]", "type": "object"}, "CustomerPaymentMethodUpdateRequest": {"additionalProperties": false, "description": "Body of ``PATCH /customers/{customer_id}/payment-methods/{assignment_id}``.", "example": {"is_default": true}, "properties": {"is_default": {"description": "`true` makes this the billing entity's default payment method; `false` removes the default flag.", "examples": [true], "title": "Is Default", "type": "boolean"}}, "required": ["is_default"], "title": "CustomerPaymentMethodUpdateRequest", "type": "object"}, "CustomerUpdateRequest": {"additionalProperties": false, "description": "Body of ``PATCH /customers/{customer_id}``.\n\nOmitted fields are left unchanged. ``external_references`` and\n``assigned_member_ids`` replace the whole list when sent. To change the\ndefault billing entity send its id; send ``null`` to clear it.\n``metadata`` merges: listed keys are set, a key sent as ``\"\"`` is removed,\nand ``null`` removes every key.", "example": {"default_billing_entity_id": "01909e26-e2b5-7f6d-9a7b-8c0d1e2f3a4b", "display_name": "Acme Corporation"}, "properties": {"assigned_member_ids": {"anyOf": [{"items": {"format": "uuid", "type": "string"}, "type": "array"}, {"type": "null"}], "description": "Replaces the whole list of assigned team members when sent. Omit to keep it; cannot be null (send `[]` to unassign everyone).", "examples": [["01909e26-5d4c-7b3a-9e8f-1a2b3c4d5e6f"]], "title": "Assigned Member Ids"}, "code": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "description": "New customer code, unique within the organization. Omit to keep it; cannot be null.", "examples": ["ACME-CORP"], "title": "Code"}, "default_billing_entity_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Id of one of this customer's billing entities to make the default. Send `null` to clear the default; omit to keep it.", "examples": ["01909e26-e2b5-7f6d-9a7b-8c0d1e2f3a4b"], "title": "Default Billing Entity Id"}, "display_name": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "description": "New display name. Omit to keep it; cannot be null.", "examples": ["Acme Corporation"], "title": "Display Name"}, "external_references": {"anyOf": [{"items": {"$ref": "#/components/schemas/CustomerExternalReference"}, "type": "array"}, {"type": "null"}], "description": "Replaces the whole list of external references when sent. Omit to keep it; cannot be null (send `[]` to remove all).", "title": "External References"}, "metadata": {"anyOf": [{"additionalProperties": {"type": "string"}, "type": "object"}, {"type": "null"}], "description": "Merged into the stored metadata: each key sent is set, a key sent with an empty string `\"\"` is removed, other keys are kept. Send `null` to remove every key; omit to keep it. At most 50 keys; keys are 1-40 characters and may not contain `[` or `]`; values are strings of at most 500 characters. The limits apply to the merged result.", "examples": [{"legacy_id": "", "segment": "mid-market"}], "title": "Metadata"}}, "title": "CustomerUpdateRequest", "type": "object"}, "CustomerUpdatedEvent": {"additionalProperties": false, "description": "`customer.updated`: A customer's code, name, external references or default billing entity changed.", "properties": {"created_at": {"description": "When the event entered the event log. The `created_at_from`/`created_at_to` filters and the 30-day retention window apply to it.", "format": "date-time", "title": "Created At", "type": "string"}, "data": {"$ref": "#/components/schemas/CustomerEventData", "description": "The event's payload, typed by `type`."}, "id": {"description": "Event id; the same value as the `Relvo-Event-Id` header of every delivery of this event. Use it to deduplicate.", "format": "uuid", "title": "Id", "type": "string"}, "occurred_at": {"description": "When the change happened in Relvo.", "format": "date-time", "title": "Occurred At", "type": "string"}, "organization_id": {"description": "The organization the event belongs to.", "format": "uuid", "title": "Organization Id", "type": "string"}, "schema_version": {"description": "Version of this event type's `data` schema.", "minimum": 1.0, "title": "Schema Version", "type": "integer"}, "type": {"const": "customer.updated", "description": "The event type.", "title": "Type", "type": "string"}}, "required": ["id", "schema_version", "occurred_at", "organization_id", "created_at", "type", "data"], "title": "CustomerUpdatedEvent", "type": "object"}, "DatePeriod": {"additionalProperties": false, "description": "A range of calendar days; both ends are inclusive.", "properties": {"end": {"description": "Last day of the period, inclusive.", "examples": ["2026-01-31"], "format": "date", "title": "End", "type": "string"}, "start": {"description": "First day of the period, inclusive.", "examples": ["2026-01-01"], "format": "date", "title": "Start", "type": "string"}}, "required": ["start", "end"], "title": "DatePeriod", "type": "object"}, "DebitNote": {"additionalProperties": false, "description": "A debit note: a fiscal document that raises the amount owed on an issued invoice.", "properties": {"created_at": {"description": "When the note was created.", "examples": ["2026-02-15T12:00:00Z"], "format": "date-time", "title": "Created At", "type": "string"}, "currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency of every amount on the note; the invoice currency.", "examples": ["CLP"]}, "customer_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Customer the note is addressed to.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a13"], "title": "Customer Id"}, "fiscal": {"$ref": "#/components/schemas/FiscalDocument", "description": "The tax document behind the note."}, "gross_amount": {"description": "Tax-inclusive total of the note.", "examples": ["59500"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Gross Amount", "type": "string"}, "id": {"description": "Debit note id.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a30"], "format": "uuid", "title": "Id", "type": "string"}, "invoice_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Invoice the note debits; null for an imported note whose invoice is not in Relvo.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10"], "title": "Invoice Id"}, "issue_date": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Fiscal issue date; null on a draft that has none yet.", "examples": ["2026-02-15"], "title": "Issue Date"}, "issued_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When the note was issued; null until issued.", "examples": ["2026-02-15T12:05:00Z"], "title": "Issued At"}, "lines": {"description": "The note's lines, in document order.", "items": {"$ref": "#/components/schemas/DebitNoteLine"}, "title": "Lines", "type": "array"}, "net_amount": {"description": "Tax-exclusive total of the note's lines.", "examples": ["50000"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Net Amount", "type": "string"}, "status": {"$ref": "#/components/schemas/CorrectionNoteStatus", "description": "Lifecycle status: `draft` (editable, no fiscal effect), `open` (issued), `void` (issued and then voided) or `cancelled` (a draft discarded before issuing).", "examples": ["open"]}, "tax_amount": {"description": "Total tax of the note.", "examples": ["9500"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Tax Amount", "type": "string"}, "updated_at": {"description": "When the note last changed (issuance, fiscal outcome, void or discard).", "examples": ["2026-02-15T12:10:00Z"], "format": "date-time", "title": "Updated At", "type": "string"}, "version": {"description": "Concurrency version; send it as `If-Match` to change the note.", "examples": [2], "title": "Version", "type": "integer"}, "voided_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When the note was voided; null unless void.", "examples": ["2026-02-20T09:00:00Z"], "title": "Voided At"}}, "required": ["id", "version", "invoice_id", "customer_id", "status", "issue_date", "net_amount", "tax_amount", "gross_amount", "currency", "lines", "fiscal", "created_at", "updated_at", "issued_at", "voided_at"], "title": "DebitNote", "type": "object"}, "DebitNoteCreate": {"additionalProperties": false, "description": "A new draft debit note that raises the amount owed on an issued invoice.", "properties": {"invoice_id": {"description": "Issued invoice the note debits.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10"], "format": "uuid", "title": "Invoice Id", "type": "string"}, "issue_date": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Fiscal issue date. Optional on a draft; `issue` sets it.", "examples": ["2026-02-15"], "title": "Issue Date"}, "lines": {"description": "At least one explicit debit line.", "items": {"$ref": "#/components/schemas/DebitNoteLineInput"}, "minItems": 1, "title": "Lines", "type": "array"}}, "required": ["invoice_id", "lines"], "title": "DebitNoteCreate", "type": "object"}, "DebitNoteFiscalRejectedData": {"additionalProperties": false, "description": "The tax authority rejected a debit note.", "properties": {"debit_note_id": {"description": "The debit note.", "format": "uuid", "title": "Debit Note Id", "type": "string"}, "rejection_reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Authority message explaining the rejection.", "title": "Rejection Reason"}, "source_invoice_id": {"description": "The invoice the debit note corrects.", "format": "uuid", "title": "Source Invoice Id", "type": "string"}}, "required": ["debit_note_id", "source_invoice_id", "rejection_reason"], "title": "DebitNoteFiscalRejectedData", "type": "object"}, "DebitNoteFiscalRejectedEvent": {"additionalProperties": false, "description": "`debit_note.fiscal_rejected`: The tax authority rejected a debit note.", "properties": {"created_at": {"description": "When the event entered the event log. The `created_at_from`/`created_at_to` filters and the 30-day retention window apply to it.", "format": "date-time", "title": "Created At", "type": "string"}, "data": {"$ref": "#/components/schemas/DebitNoteFiscalRejectedData", "description": "The event's payload, typed by `type`."}, "id": {"description": "Event id; the same value as the `Relvo-Event-Id` header of every delivery of this event. Use it to deduplicate.", "format": "uuid", "title": "Id", "type": "string"}, "occurred_at": {"description": "When the change happened in Relvo.", "format": "date-time", "title": "Occurred At", "type": "string"}, "organization_id": {"description": "The organization the event belongs to.", "format": "uuid", "title": "Organization Id", "type": "string"}, "schema_version": {"description": "Version of this event type's `data` schema.", "minimum": 1.0, "title": "Schema Version", "type": "integer"}, "type": {"const": "debit_note.fiscal_rejected", "description": "The event type.", "title": "Type", "type": "string"}}, "required": ["id", "schema_version", "occurred_at", "organization_id", "created_at", "type", "data"], "title": "DebitNoteFiscalRejectedEvent", "type": "object"}, "DebitNoteIssue": {"additionalProperties": false, "description": "Issues a draft debit note, giving it fiscal effect.", "properties": {"issue_date": {"description": "Fiscal issue date of the note.", "examples": ["2026-02-15"], "format": "date", "title": "Issue Date", "type": "string"}}, "required": ["issue_date"], "title": "DebitNoteIssue", "type": "object"}, "DebitNoteIssuedData": {"additionalProperties": false, "description": "The tax authority accepted a debit note.", "properties": {"debit_note_id": {"description": "The debit note.", "format": "uuid", "title": "Debit Note Id", "type": "string"}, "fiscal_uuid": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Tax authority document id, when the provider gives one.", "title": "Fiscal Uuid"}, "folio": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Fiscal folio number.", "title": "Folio"}, "source_invoice_id": {"description": "The invoice the debit note corrects.", "format": "uuid", "title": "Source Invoice Id", "type": "string"}}, "required": ["debit_note_id", "source_invoice_id", "fiscal_uuid", "folio"], "title": "DebitNoteIssuedData", "type": "object"}, "DebitNoteIssuedEvent": {"additionalProperties": false, "description": "`debit_note.issued`: The tax authority accepted a debit note.", "properties": {"created_at": {"description": "When the event entered the event log. The `created_at_from`/`created_at_to` filters and the 30-day retention window apply to it.", "format": "date-time", "title": "Created At", "type": "string"}, "data": {"$ref": "#/components/schemas/DebitNoteIssuedData", "description": "The event's payload, typed by `type`."}, "id": {"description": "Event id; the same value as the `Relvo-Event-Id` header of every delivery of this event. Use it to deduplicate.", "format": "uuid", "title": "Id", "type": "string"}, "occurred_at": {"description": "When the change happened in Relvo.", "format": "date-time", "title": "Occurred At", "type": "string"}, "organization_id": {"description": "The organization the event belongs to.", "format": "uuid", "title": "Organization Id", "type": "string"}, "schema_version": {"description": "Version of this event type's `data` schema.", "minimum": 1.0, "title": "Schema Version", "type": "integer"}, "type": {"const": "debit_note.issued", "description": "The event type.", "title": "Type", "type": "string"}}, "required": ["id", "schema_version", "occurred_at", "organization_id", "created_at", "type", "data"], "title": "DebitNoteIssuedEvent", "type": "object"}, "DebitNoteLine": {"additionalProperties": false, "description": "One line of a debit note.", "properties": {"currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency of the line amounts."}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Optional line description.", "title": "Description"}, "gross_amount": {"description": "Tax-inclusive line amount.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Gross Amount", "type": "string"}, "id": {"description": "Line id.", "format": "uuid", "title": "Id", "type": "string"}, "line_number": {"description": "1-based position of the line on the document.", "title": "Line Number", "type": "integer"}, "mode": {"$ref": "#/components/schemas/DebitNoteLineMode", "description": "What the line charges: an increase to an invoice line or a new charge.", "examples": ["additional_charge"]}, "net_amount": {"description": "Tax-exclusive line amount.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Net Amount", "type": "string"}, "quantity": {"anyOf": [{"pattern": "^\\d+(\\.\\d+)?$", "type": "string"}, {"type": "null"}], "description": "Quantity, as a non-negative decimal string.", "title": "Quantity"}, "reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Why the charge was added; null for `source_line_adjustment` lines.", "examples": ["Late payment"], "title": "Reason"}, "source_invoice_line_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Source invoice line this line corrects. Null for a debit `additional_charge` and for imported credit lines that credit no known invoice line.", "title": "Source Invoice Line Id"}, "tax_amount": {"description": "Tax on the line.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Tax Amount", "type": "string"}, "title": {"description": "Line title printed on the fiscal document.", "title": "Title", "type": "string"}}, "required": ["id", "line_number", "source_invoice_line_id", "title", "description", "quantity", "net_amount", "tax_amount", "gross_amount", "currency", "mode", "reason"], "title": "DebitNoteLine", "type": "object"}, "DebitNoteLineInput": {"additionalProperties": false, "description": "One line of a new debit note, with its amounts stated explicitly.", "properties": {"description": {"anyOf": [{"maxLength": 1000, "type": "string"}, {"type": "null"}], "description": "Optional longer description printed under the title.", "examples": ["Interest on invoice paid 15 days late"], "title": "Description"}, "gross_amount": {"description": "Tax-inclusive amount; must be positive.", "examples": ["59500"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Gross Amount", "type": "string"}, "mode": {"$ref": "#/components/schemas/DebitNoteLineMode", "description": "`source_line_adjustment` increases an existing source line and requires `source_invoice_line_id`; `additional_charge` adds a new charge, must not reference a source line and requires a non-blank `reason`.", "examples": ["additional_charge"]}, "net_amount": {"description": "Tax-exclusive amount, in the invoice currency.", "examples": ["50000"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Net Amount", "type": "string"}, "quantity": {"anyOf": [{"description": "Non-negative decimal amount as a string, e.g. `\"1000\"` or `\"10.50\"`.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "type": "string"}, {"type": "null"}], "description": "Quantity shown on the line; does not drive amounts.", "examples": ["1"], "title": "Quantity"}, "reason": {"anyOf": [{"maxLength": 1000, "type": "string"}, {"type": "null"}], "description": "Why the charge is added (`additional_charge`).", "examples": ["Late payment"], "title": "Reason"}, "source_invoice_line_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Source invoice line adjusted; only with `source_line_adjustment`.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a24"], "title": "Source Invoice Line Id"}, "tax_amount": {"description": "Tax on the line, in the invoice currency.", "examples": ["9500"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Tax Amount", "type": "string"}, "tax_rate": {"description": "Tax rate as a decimal ratio (`\"0\"` exempt, `\"0.19\"` Chilean VAT). Any other rate is 422 `invoicing_next_debit_note_tax_rate_unsupported`.", "examples": ["0.19"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Tax Rate", "type": "string"}, "title": {"description": "Line title (1-80 characters).", "examples": ["Late payment interest"], "maxLength": 80, "minLength": 1, "title": "Title", "type": "string"}}, "required": ["mode", "title", "net_amount", "tax_amount", "gross_amount", "tax_rate"], "title": "DebitNoteLineInput", "type": "object"}, "DebitNoteLineMode": {"description": "What a debit note line charges.\n\n- `source_line_adjustment`: increases the amount of an existing line of the invoice.\n- `additional_charge`: adds a new charge that is not on the invoice, such as late interest.", "enum": ["source_line_adjustment", "additional_charge"], "title": "DebitNoteLineMode", "type": "string"}, "DebitNoteList": {"additionalProperties": false, "description": "A page of debit notes; pass `next_cursor` as `cursor` to fetch the next page.", "properties": {"items": {"description": "The debit notes on this page.", "items": {"$ref": "#/components/schemas/DebitNote"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Pass as `cursor` for the next page; null on the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items", "next_cursor"], "title": "DebitNoteList", "type": "object"}, "DocumentFamily": {"description": "Default fiscal document issued to this billing entity.\n\n`invoice` is the domestic invoice (factura), `receipt` a consumer receipt\n(boleta) and `export_invoice` an export invoice (factura de exportación).", "enum": ["invoice", "receipt", "export_invoice"], "title": "DocumentFamily", "type": "string"}, "DraftFxBackfillResponse": {"properties": {"failed": {"title": "Failed", "type": "integer"}, "scan_failed": {"title": "Scan Failed", "type": "boolean"}, "unavailable": {"title": "Unavailable", "type": "integer"}, "updated": {"title": "Updated", "type": "integer"}}, "required": ["updated", "unavailable", "failed", "scan_failed"], "title": "DraftFxBackfillResponse", "type": "object"}, "EffectiveContractPrefacturaSettings": {"properties": {"currency_basis": {"enum": ["pricing", "issuance"], "title": "Currency Basis", "type": "string"}, "show_filters": {"title": "Show Filters", "type": "boolean"}, "show_more_information": {"title": "Show More Information", "type": "boolean"}}, "required": ["currency_basis", "show_filters", "show_more_information"], "title": "EffectiveContractPrefacturaSettings", "type": "object"}, "EffectiveContractSettings": {"properties": {"pre_invoice_pdf": {"$ref": "#/components/schemas/EffectiveContractPrefacturaSettings"}}, "required": ["pre_invoice_pdf"], "title": "EffectiveContractSettings", "type": "object"}, "ErrorResponse": {"description": "The envelope of every non-2xx response. Branch on `code`, which is stable; `message` is human-readable and may change. Every code is listed in the [errors guide](https://app.relvoerp.com/docs/product/guides/errors/).", "example": {"code": "insufficient_scope", "correlation_id": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "is_transient": false, "message": "API token lacks a required scope for this endpoint", "params": {}, "request_id": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10"}, "externalDocs": {"description": "Error code catalog", "url": "https://app.relvoerp.com/docs/product/guides/errors/"}, "properties": {"code": {"description": "Stable snake_case machine-readable error code, e.g. `insufficient_scope`, `idempotency_key_reused`, `validation_failed`.", "examples": ["insufficient_scope"], "pattern": "^[a-z][a-z0-9_]*$", "type": "string"}, "correlation_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Identifier shared by every request and job in the same flow."}, "is_transient": {"description": "`true` when the same request is expected to succeed if retried later with the same `Idempotency-Key`.", "type": "boolean"}, "message": {"description": "Human-readable explanation. Not stable; do not parse it.", "type": "string"}, "params": {"additionalProperties": true, "description": "Structured details for the error `code` (for example the offending fields or the current resource version). `{}` when the error has none.", "properties": {"truncated": {"description": "On `422`: `true` when more than 100 fields were rejected.", "type": "boolean"}, "validation_errors": {"description": "On `422`: every rejected field (at most 100).", "items": {"properties": {"loc": {"description": "Path to the offending value, e.g. `[\"body\", \"lines\", 0, \"quantity\"]`.", "items": {"anyOf": [{"type": "string"}, {"type": "integer"}]}, "type": "array"}, "message": {"description": "Human-readable explanation.", "type": "string"}, "type": {"description": "Stable machine-readable error type.", "type": "string"}}, "required": ["loc", "type", "message"], "type": "object"}, "maxItems": 100, "type": "array"}}, "type": "object"}, "request_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Identifier of this request (your `X-Request-ID` when you sent a valid one). Quote it when contacting support."}}, "required": ["code", "message", "request_id", "correlation_id", "params", "is_transient"], "title": "ErrorResponse", "type": "object"}, "EvaluateBillableMetricRequest": {"additionalProperties": false, "description": "What to evaluate: one billing entity's usage of the metric over a time window.", "properties": {"billing_entity_id": {"description": "The billing entity whose usage is evaluated.", "examples": ["01936f2e-2a4b-7f0a-9b8c-7d6e5f4a3b2c"], "format": "uuid", "title": "Billing Entity Id", "type": "string"}, "breakdown_by": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Event property to group the result by. The property must allow breakdown. Null for no breakdown.", "examples": ["region"], "title": "Breakdown By"}, "evaluation_mode": {"$ref": "#/components/schemas/BillableMetricEvaluationMode", "default": "billable", "description": "Whether the metric's own filters are applied (`billable`) or only yours (`raw`).", "examples": ["billable"]}, "expected_config_revision": {"anyOf": [{"minimum": 1.0, "type": "integer"}, {"type": "null"}], "description": "Fail with 409 when the metric changed since this revision.", "examples": [1], "title": "Expected Config Revision"}, "filters": {"additionalProperties": {"items": {"type": "string"}, "type": "array"}, "description": "Restricts the evaluation to these values of the metric's filters, keyed by property. Only filters on properties that allow filtering can be narrowed.", "examples": [{"region": ["us"]}], "title": "Filters", "type": "object"}, "timeframe": {"$ref": "#/components/schemas/BillableMetricEvaluationWindow", "description": "Time window whose usage events are evaluated."}}, "required": ["billing_entity_id", "timeframe"], "title": "EvaluateBillableMetricRequest", "type": "object"}, "EvaluatedBillableMetric": {"additionalProperties": false, "description": "The billable metric that was evaluated, as configured at evaluation time.", "properties": {"aggregation": {"description": "Aggregation method of the metric, or `custom` for SQL-defined metrics.", "examples": ["sum_agg"], "title": "Aggregation", "type": "string"}, "config_revision": {"description": "Configuration revision of the metric used. Send it as `expected_config_revision` to detect later changes.", "examples": [1], "title": "Config Revision", "type": "integer"}, "id": {"description": "ID of the billable metric.", "examples": ["01936f2e-4c6a-7b2c-8d0e-1f2a3b4c5d6e"], "format": "uuid", "title": "Id", "type": "string"}, "name": {"description": "Name of the billable metric.", "examples": ["API requests"], "title": "Name", "type": "string"}}, "required": ["id", "config_revision", "name", "aggregation"], "title": "EvaluatedBillableMetric", "type": "object"}, "EvaluatedEvent": {"additionalProperties": false, "description": "A usage event included in the evaluation.", "properties": {"id": {"description": "ID of the usage event.", "examples": ["01936f2e-8e0f-7a6b-8c4d-5e6f708192a3"], "format": "uuid", "title": "Id", "type": "string"}, "occurred_at": {"description": "When the usage happened, as reported by the sender.", "examples": ["2026-01-15T12:30:00.000Z"], "format": "date-time", "title": "Occurred At", "type": "string"}}, "required": ["id", "occurred_at"], "title": "EvaluatedEvent", "type": "object"}, "Event": {"description": "An event from the event log: the webhook envelope plus when it was logged.\n\nThe `data` shape depends on `type`; it is exactly what a webhook delivery of\nthe event carried.", "discriminator": {"mapping": {"contract.activated": "#/components/schemas/ContractActivatedEvent", "contract.amended": "#/components/schemas/ContractAmendedEvent", "contract.cancelled": "#/components/schemas/ContractCancelledEvent", "credit_note.fiscal_rejected": "#/components/schemas/CreditNoteFiscalRejectedEvent", "credit_note.issued": "#/components/schemas/CreditNoteIssuedEvent", "customer.created": "#/components/schemas/CustomerCreatedEvent", "customer.deleted": "#/components/schemas/CustomerDeletedEvent", "customer.updated": "#/components/schemas/CustomerUpdatedEvent", "debit_note.fiscal_rejected": "#/components/schemas/DebitNoteFiscalRejectedEvent", "debit_note.issued": "#/components/schemas/DebitNoteIssuedEvent", "invoice.drafted": "#/components/schemas/InvoiceDraftedEvent", "invoice.fiscal_rejected": "#/components/schemas/InvoiceFiscalRejectedEvent", "invoice.issued": "#/components/schemas/InvoiceIssuedEvent", "invoice.paid": "#/components/schemas/InvoicePaidEvent", "invoice.payment_received": "#/components/schemas/InvoicePaymentReceivedEvent", "invoice.voided": "#/components/schemas/InvoiceVoidedEvent", "message.received": "#/components/schemas/MessageReceivedEvent", "payment.succeeded": "#/components/schemas/PaymentSucceededEvent"}, "propertyName": "type"}, "oneOf": [{"$ref": "#/components/schemas/ContractActivatedEvent"}, {"$ref": "#/components/schemas/ContractAmendedEvent"}, {"$ref": "#/components/schemas/ContractCancelledEvent"}, {"$ref": "#/components/schemas/CreditNoteFiscalRejectedEvent"}, {"$ref": "#/components/schemas/CreditNoteIssuedEvent"}, {"$ref": "#/components/schemas/CustomerCreatedEvent"}, {"$ref": "#/components/schemas/CustomerDeletedEvent"}, {"$ref": "#/components/schemas/CustomerUpdatedEvent"}, {"$ref": "#/components/schemas/DebitNoteFiscalRejectedEvent"}, {"$ref": "#/components/schemas/DebitNoteIssuedEvent"}, {"$ref": "#/components/schemas/InvoiceDraftedEvent"}, {"$ref": "#/components/schemas/InvoiceFiscalRejectedEvent"}, {"$ref": "#/components/schemas/InvoiceIssuedEvent"}, {"$ref": "#/components/schemas/InvoicePaidEvent"}, {"$ref": "#/components/schemas/InvoicePaymentReceivedEvent"}, {"$ref": "#/components/schemas/InvoiceVoidedEvent"}, {"$ref": "#/components/schemas/MessageReceivedEvent"}, {"$ref": "#/components/schemas/PaymentSucceededEvent"}], "title": "Event"}, "EventPage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/Event"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[PublicEvent]", "type": "object"}, "FinancialCredit": {"description": "Immutable financial allowance and its current exact capacity counters.", "properties": {"billing_entity_id": {"description": "Customer billing entity owning the allowance.", "format": "uuid", "title": "Billing Entity Id", "type": "string"}, "consumed": {"description": "Capacity consumed by finalized invoices.", "discriminator": {"mapping": {"metric": "#/components/schemas/FinancialMetricCredit", "money": "#/components/schemas/FinancialCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/FinancialCurrencyCredit"}, {"$ref": "#/components/schemas/FinancialMetricCredit"}], "title": "Consumed"}, "created_at": {"description": "When the financial allowance was created.", "format": "date-time", "title": "Created At", "type": "string"}, "customer_id": {"description": "Customer owning the allowance.", "format": "uuid", "title": "Customer Id", "type": "string"}, "depleted": {"description": "Whether remaining capacity is zero.", "title": "Depleted", "type": "boolean"}, "effective_at": {"description": "Inclusive contractual availability instant; exact microseconds are retained.", "format": "date-time", "title": "Effective At", "type": "string"}, "evaluated_as_of": {"description": "Instant used to evaluate availability.", "format": "date-time", "title": "Evaluated As Of", "type": "string"}, "expired": {"description": "Capacity retired by expiry.", "discriminator": {"mapping": {"metric": "#/components/schemas/FinancialMetricCredit", "money": "#/components/schemas/FinancialCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/FinancialCurrencyCredit"}, {"$ref": "#/components/schemas/FinancialMetricCredit"}], "title": "Expired"}, "expires_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Exclusive contractual expiry instant; exact microseconds are retained.", "title": "Expires At"}, "face_value": {"description": "Original granted capacity.", "discriminator": {"mapping": {"metric": "#/components/schemas/FinancialMetricCredit", "money": "#/components/schemas/FinancialCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/FinancialCurrencyCredit"}, {"$ref": "#/components/schemas/FinancialMetricCredit"}], "title": "Face Value"}, "id": {"description": "Financial allowance ID; distinct from a recurring schedule configuration ID.", "format": "uuid", "title": "Id", "type": "string"}, "name": {"description": "Credit name.", "title": "Name", "type": "string"}, "origin": {"description": "Commercial origin of the credits.", "enum": ["purchased", "promotional"], "title": "Origin", "type": "string"}, "purchase_date": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Original purchase calendar date.", "title": "Purchase Date"}, "purchase_invoice_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Associated purchase invoice draft, if requested.", "title": "Purchase Invoice Id"}, "purchase_price": {"$ref": "#/components/schemas/FinancialCreditMoney", "description": "Original net purchase price, independent of capacity."}, "purchased_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Purchase audit instant, retaining microseconds.", "title": "Purchased At"}, "remaining": {"description": "Remaining capacity, including reservations.", "discriminator": {"mapping": {"metric": "#/components/schemas/FinancialMetricCredit", "money": "#/components/schemas/FinancialCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/FinancialCurrencyCredit"}, {"$ref": "#/components/schemas/FinancialMetricCredit"}], "title": "Remaining"}, "reserved": {"description": "Capacity reserved by invoices.", "discriminator": {"mapping": {"metric": "#/components/schemas/FinancialMetricCredit", "money": "#/components/schemas/FinancialCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/FinancialCurrencyCredit"}, {"$ref": "#/components/schemas/FinancialMetricCredit"}], "title": "Reserved"}, "restored": {"description": "Capacity restored through explicit corrections.", "discriminator": {"mapping": {"metric": "#/components/schemas/FinancialMetricCredit", "money": "#/components/schemas/FinancialCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/FinancialCurrencyCredit"}, {"$ref": "#/components/schemas/FinancialMetricCredit"}], "title": "Restored"}, "revoked": {"description": "Whether unused capacity has been revoked.", "title": "Revoked", "type": "boolean"}, "revoked_amount": {"description": "Unused capacity explicitly revoked.", "discriminator": {"mapping": {"metric": "#/components/schemas/FinancialMetricCredit", "money": "#/components/schemas/FinancialCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/FinancialCurrencyCredit"}, {"$ref": "#/components/schemas/FinancialMetricCredit"}], "title": "Revoked Amount"}, "rollover_received": {"anyOf": [{"discriminator": {"mapping": {"metric": "#/components/schemas/FinancialMetricCredit", "money": "#/components/schemas/FinancialCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/FinancialCurrencyCredit"}, {"$ref": "#/components/schemas/FinancialMetricCredit"}]}, {"type": "null"}], "description": "Capacity received through rollover.", "title": "Rollover Received"}, "rollover_transferred": {"anyOf": [{"discriminator": {"mapping": {"metric": "#/components/schemas/FinancialMetricCredit", "money": "#/components/schemas/FinancialCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/FinancialCurrencyCredit"}, {"$ref": "#/components/schemas/FinancialMetricCredit"}]}, {"type": "null"}], "description": "Capacity transferred through rollover.", "title": "Rollover Transferred"}, "spendable": {"description": "Capacity currently available for new reservations.", "discriminator": {"mapping": {"metric": "#/components/schemas/FinancialMetricCredit", "money": "#/components/schemas/FinancialCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/FinancialCurrencyCredit"}, {"$ref": "#/components/schemas/FinancialMetricCredit"}], "title": "Spendable"}, "state": {"$ref": "#/components/schemas/FinancialCreditState", "description": "Independent issuance and validity state."}, "version": {"description": "Current grant version, also returned as ETag on detail reads.", "title": "Version", "type": "integer"}}, "required": ["id", "customer_id", "billing_entity_id", "version", "name", "origin", "state", "face_value", "purchase_price", "remaining", "reserved", "spendable", "consumed", "restored", "expired", "revoked_amount", "rollover_received", "rollover_transferred", "effective_at", "expires_at", "purchased_at", "created_at", "evaluated_as_of", "purchase_date", "purchase_invoice_id", "revoked", "depleted"], "title": "FinancialCredit", "type": "object"}, "FinancialCreditMoney": {"description": "Exact currency amount without truncating cumulative financial results.", "properties": {"amount": {"description": "Exact decimal amount in major currency units.", "title": "Amount", "type": "string"}, "currency": {"description": "ISO-4217 currency code.", "title": "Currency", "type": "string"}}, "required": ["amount", "currency"], "title": "FinancialCreditMoney", "type": "object"}, "FinancialCreditPage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/FinancialCredit"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[FinancialCredit]", "type": "object"}, "FinancialCreditState": {"description": "Independent issuance and calendar validity axes.", "properties": {"issuance": {"description": "Whether the credit allowance has been issued, independently of payment.", "enum": ["pending", "issued"], "title": "Issuance", "type": "string"}, "validity": {"description": "Availability window evaluated at evaluated_as_of.", "enum": ["scheduled", "current", "expired"], "title": "Validity", "type": "string"}}, "required": ["issuance", "validity"], "title": "FinancialCreditState", "type": "object"}, "FinancialCurrencyCredit": {"description": "Capacity denominated in one currency.", "properties": {"kind": {"const": "money", "description": "Currency credit discriminator.", "title": "Kind", "type": "string"}, "money": {"$ref": "#/components/schemas/FinancialCreditMoney", "description": "Currency and exact capacity amount."}}, "required": ["kind", "money"], "title": "FinancialCurrencyCredit", "type": "object"}, "FinancialMetricCredit": {"description": "Exact units of one metric, including expanded exponent input and cumulative balances.", "properties": {"kind": {"const": "metric", "description": "Metric credit discriminator.", "title": "Kind", "type": "string"}, "metric_id": {"description": "Billable metric identifying the asset.", "format": "uuid", "title": "Metric Id", "type": "string"}, "quantity": {"description": "Exact fixed-point metric quantity; never rounded or truncated.", "title": "Quantity", "type": "string"}}, "required": ["kind", "metric_id", "quantity"], "title": "FinancialMetricCredit", "type": "object"}, "FiscalDocument": {"additionalProperties": false, "description": "Country-neutral facts of the tax document behind an invoice or note.", "properties": {"accepted_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When the authority accepted the document. Null unless accepted.", "examples": ["2026-01-31T12:05:00Z"], "title": "Accepted At"}, "document_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "The tax authority's own code for the document type, as an opaque string (e.g. `33` for a Chilean electronic invoice). Null before a document exists.", "examples": ["33"], "title": "Document Code"}, "jurisdiction": {"anyOf": [{"$ref": "#/components/schemas/CountryEnum"}, {"type": "null"}], "description": "ISO 3166-1 alpha-2 country whose tax authority governs the document. Null before a document exists.", "examples": ["CL"]}, "number": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Fiscal document number assigned by the authority. Null until assigned.", "examples": ["1234"], "title": "Number"}, "pdf_available": {"description": "Whether the fiscal PDF can be downloaded.", "examples": [true], "title": "Pdf Available", "type": "boolean"}, "rejected_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When the authority last rejected the document. Null if never rejected.", "examples": ["2026-01-31T12:05:00Z"], "title": "Rejected At"}, "status": {"$ref": "#/components/schemas/FiscalStatus", "description": "Tax-authority state of the document: `not_submitted` until it is issued, then `pending` until the authority answers `accepted` or `rejected`.", "examples": ["accepted"]}, "xml_available": {"description": "Whether the fiscal XML can be downloaded.", "examples": [true], "title": "Xml Available", "type": "boolean"}}, "required": ["status", "jurisdiction", "document_code", "number", "accepted_at", "rejected_at", "pdf_available", "xml_available"], "title": "FiscalDocument", "type": "object"}, "FiscalStatus": {"description": "Tax-authority state of a document's fiscal record.\n\n- `not_submitted`: the document has not been issued to the tax authority yet.\n- `pending`: submitted and awaiting the tax authority's answer.\n- `accepted`: the tax authority accepted the document.\n- `rejected`: the tax authority rejected the document.", "enum": ["not_submitted", "pending", "accepted", "rejected"], "title": "FiscalStatus", "type": "string"}, "FixedPrice": {"additionalProperties": false, "description": "A fixed price: `pricing.amount` x `units` billed every interval.", "properties": {"created_at": {"description": "When the price was created (UTC).", "examples": ["2026-01-01T00:00:00.000Z"], "format": "date-time", "title": "Created At", "type": "string"}, "currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency every amount of this price is expressed in.", "examples": ["CLP"]}, "id": {"description": "Unique identifier of the price.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10"], "format": "uuid", "title": "Id", "type": "string"}, "interval": {"$ref": "#/components/schemas/PriceInterval", "description": "Recurrence; `one_time` for a non-recurring price.", "examples": ["monthly"]}, "item_id": {"description": "Catalog item this price bills for.", "examples": ["0191f3c1-8a20-7b3c-9d4e-2a1b3c4d5e6f"], "format": "uuid", "title": "Item Id", "type": "string"}, "name": {"description": "Display name of the price.", "examples": ["Platform subscription"], "title": "Name", "type": "string"}, "name_on_invoice": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Invoice line label template. Null means the price name is used.", "examples": ["Platform subscription {{month}} {{year}}"], "title": "Name On Invoice"}, "pay_in_advance": {"description": "True bills at the start of the period; false in arrears.", "examples": [true], "title": "Pay In Advance", "type": "boolean"}, "pricing": {"description": "Pricing definition, selected by `model`.", "discriminator": {"mapping": {"formula": "#/components/schemas/FormulaPricing", "graduated": "#/components/schemas/GraduatedPricing", "graduated_percentage": "#/components/schemas/GraduatedPercentagePricing", "package": "#/components/schemas/PackagePricing", "percentage": "#/components/schemas/PercentagePricing", "standard": "#/components/schemas/StandardPricing", "volume": "#/components/schemas/VolumePricing"}, "propertyName": "model"}, "oneOf": [{"$ref": "#/components/schemas/StandardPricing"}, {"$ref": "#/components/schemas/GraduatedPricing"}, {"$ref": "#/components/schemas/VolumePricing"}, {"$ref": "#/components/schemas/PackagePricing"}, {"$ref": "#/components/schemas/PercentagePricing"}, {"$ref": "#/components/schemas/GraduatedPercentagePricing"}, {"$ref": "#/components/schemas/FormulaPricing"}], "title": "Pricing"}, "prorated": {"description": "True bills partial periods in proportion to the days covered.", "examples": [true], "title": "Prorated", "type": "boolean"}, "status": {"$ref": "#/components/schemas/PriceStatus", "description": "Current lifecycle status.", "examples": ["active"]}, "type": {"const": "fixed", "description": "Price type discriminator; always `fixed` for this object.", "title": "Type", "type": "string"}, "units": {"description": "Quantity billed, as a decimal string.", "examples": ["1"], "title": "Units", "type": "string"}, "updated_at": {"description": "When the price was last changed (UTC).", "examples": ["2026-01-01T00:00:00.000Z"], "format": "date-time", "title": "Updated At", "type": "string"}, "version": {"description": "Optimistic-concurrency version; send it back as `If-Match`.", "examples": [1], "title": "Version", "type": "integer"}}, "required": ["id", "name", "name_on_invoice", "currency", "interval", "status", "created_at", "updated_at", "version", "pricing", "type", "item_id", "units", "pay_in_advance", "prorated"], "title": "FixedPrice", "type": "object"}, "FlatCreateGrant": {"additionalProperties": false, "description": "Create one customer-owned currency grant outside any billing schedule.", "properties": {"amount": {"description": "Configured entitlement, excluding rollover. Creation supports fifteen integer and ten fractional digits.", "title": "Amount", "type": "number"}, "costOfCredit": {"description": "Amount charged for the credit, zero for free credit. Creation cannot exceed the granted amount.", "title": "Costofcredit", "type": "number"}, "currency": {"description": "Required ISO-4217 currency code. Customer creation supports currency grants only.", "title": "Currency", "type": "string"}, "customerId": {"description": "Customer receiving or owning the credit grant.", "format": "uuid", "title": "Customerid", "type": "string"}, "effectiveDate": {"description": "Required first valid UTC calendar date, inclusive, spelled YYYY-MM-DD.", "format": "date", "title": "Effectivedate", "type": "string"}, "expiryDate": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Last valid UTC calendar date, inclusive; null means no expiry.", "title": "Expirydate"}, "integrationIds": {"description": "External integration identifiers, at most one per service.", "items": {"$ref": "#/components/schemas/IntegrationIdInput"}, "maxItems": 50, "title": "Integrationids", "type": "array"}, "name": {"anyOf": [{"maxLength": 256, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Human-readable grant name, up to 256 characters. Defaults to Credit grant on creation.", "title": "Name"}}, "required": ["customerId", "currency", "amount", "costOfCredit", "effectiveDate"], "title": "FlatCreateGrant", "type": "object"}, "FormulaPricing": {"additionalProperties": false, "description": "A versioned expression over named billable metrics; the result is a period total.\n\nThe expression combines decimal numbers and the variables named in `metric_bindings`\nwith arithmetic (`+ - * /`), comparisons, conditionals and the functions `min`, `max`,\n`abs`, `floor` and `ceil`. Each variable takes the period total of its billable metric,\nand the result is billed as a single amount, in arrears and without proration.", "properties": {"expression": {"description": "Arithmetic expression that returns the period total in the price's currency.", "examples": ["max(100, calls * 0.2)"], "maxLength": 4096, "minLength": 1, "title": "Expression", "type": "string"}, "language_version": {"const": 1, "description": "Version of the expression language. Only `1` is supported.", "examples": [1], "title": "Language Version", "type": "integer"}, "metric_bindings": {"additionalProperties": {"format": "uuid", "type": "string"}, "description": "Expression variable name -> billable metric id.", "examples": [{"calls": "0191f3c1-9b31-7c4d-8e5f-3b2c4d5e6f70"}], "maxProperties": 32, "minProperties": 1, "title": "Metric Bindings", "type": "object"}, "model": {"const": "formula", "description": "Pricing model discriminator; always `formula` for this object.", "title": "Model", "type": "string"}}, "required": ["model", "expression", "language_version", "metric_bindings"], "title": "FormulaPricing", "type": "object"}, "GraduatedPercentagePricing": {"additionalProperties": false, "description": "Graduated percentages: each tier applies its own rate to the units inside it.", "properties": {"model": {"const": "graduated_percentage", "description": "Pricing model discriminator; always `graduated_percentage` for this object.", "title": "Model", "type": "string"}, "pricing_group_keys": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "description": "Usage prices only. Billable-metric filter keys the metered quantity is grouped by; each distinct combination of values is priced on its own. Null prices the whole quantity together.", "examples": [["region"]], "title": "Pricing Group Keys"}, "tiers": {"description": "Contiguous tiers, lowest first, starting at `0`. The last tier must be open-ended (`up_to: null`).", "items": {"$ref": "#/components/schemas/PercentageTier"}, "minItems": 1, "title": "Tiers", "type": "array"}}, "required": ["model", "tiers"], "title": "GraduatedPercentagePricing", "type": "object"}, "GraduatedPricing": {"additionalProperties": false, "description": "Graduated: each tier prices only the units inside it, and the tier amounts are added up.\n\nFor example, with tiers 0-1000 at 10 and 1000+ at 8, a quantity of 1500 bills\n1000 x 10 + 500 x 8.", "properties": {"free_units": {"anyOf": [{"minimum": 0.0, "type": "integer"}, {"type": "null"}], "description": "Usage prices only. Units per period that are not billed; only the quantity above this allowance is priced. Null means no free units.", "examples": [100], "title": "Free Units"}, "model": {"const": "graduated", "description": "Pricing model discriminator; always `graduated` for this object.", "title": "Model", "type": "string"}, "pricing_group_keys": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "description": "Usage prices only. Billable-metric filter keys the metered quantity is grouped by; each distinct combination of values is priced on its own. Null prices the whole quantity together.", "examples": [["region"]], "title": "Pricing Group Keys"}, "tiers": {"description": "Contiguous tiers, lowest first. The last tier must be open-ended (`up_to: null`).", "items": {"$ref": "#/components/schemas/Tier"}, "minItems": 1, "title": "Tiers", "type": "array"}}, "required": ["model", "tiers"], "title": "GraduatedPricing", "type": "object"}, "GrantPage": {"additionalProperties": false, "description": "One bounded page of customer and phase grant resources.", "properties": {"items": {"description": "Credit grants in deterministic creation order.", "items": {"$ref": "#/components/schemas/CreditGrant"}, "title": "Items", "type": "array"}, "pagination": {"$ref": "#/components/schemas/GrantPagination", "description": "Navigation cursors for the selected tenant, filters and order."}}, "required": ["items", "pagination"], "title": "GrantPage", "type": "object"}, "GrantPagination": {"additionalProperties": false, "description": "Bidirectional keyset navigation in the selected creation order.", "properties": {"after": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Cursor for the next page in the selected order; null at the end.", "title": "After"}, "before": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Cursor for the previous page in the selected order; null at the start.", "title": "Before"}, "totalResultSize": {"anyOf": [{"type": "integer"}, {"type": "null"}], "description": "Total matching resources when available; null avoids a count scan.", "title": "Totalresultsize"}}, "required": ["after", "before", "totalResultSize"], "title": "GrantPagination", "type": "object"}, "GrantState": {"additionalProperties": false, "description": "Independent issuance and UTC calendar validity.", "properties": {"issuance": {"description": "Grant-level funding state; ISSUED persists through refresh, depletion and expiry. It does not confirm payment.", "enum": ["PENDING", "ISSUED"], "title": "Issuance", "type": "string"}, "validity": {"description": "Independent UTC calendar validity; CURRENT does not imply funding or positive availability.", "enum": ["SCHEDULED", "CURRENT", "EXPIRED"], "title": "Validity", "type": "string"}}, "required": ["issuance", "validity"], "title": "GrantState", "type": "object"}, "IngestSeatEventRequest": {"additionalProperties": false, "description": "One seat change in an ingest batch.", "example": {"change_type": "added", "contract_id": "01909e26-bd7a-7c4b-8f5e-6a8b1c3d4e5f", "count": "5", "effective_date": "2026-07-15", "idempotency_key": "seat-evt-2026-07-15-001", "seat_metric_id": "01909e26-d1a4-7e6d-8b3c-9f0a1b2c3d4e", "timestamp": "2026-07-15T14:30:00Z"}, "properties": {"change_type": {"$ref": "#/components/schemas/SeatEventChangeType", "description": "`added` increases the seat count by `count`; `removed` decreases it; `set` makes the seat count exactly `count` from `effective_date`, so an integration can send the current total instead of deltas.", "examples": ["added"]}, "contract_id": {"description": "Contract whose seat count changes.", "examples": ["01909e26-bd7a-7c4b-8f5e-6a8b1c3d4e5f"], "format": "uuid", "title": "Contract Id", "type": "string"}, "count": {"description": "Whole-number string (for example `\"5\"`): seats added or removed, positive; for `set`, the seat count itself, zero or positive.", "examples": ["5"], "pattern": "^(0|[1-9][0-9]{0,8})$", "title": "Count", "type": "string"}, "effective_date": {"description": "Calendar date from which the seat change applies for billing.", "examples": ["2026-07-15"], "format": "date", "title": "Effective Date", "type": "string"}, "idempotency_key": {"description": "Client-chosen key that de-duplicates the change within the organization. Use letters, digits, `.`, `_` and `-`. Re-sending an ingested key with the same body is reported in `duplicate_idempotency_keys` and the stored change is kept. Re-sending it with a different body is reported in `validation_failed` with an error starting `idempotency_key_reused`. Re-using a key with a different body inside one batch rejects the batch with 409.", "examples": ["seat-evt-2026-07-15-001"], "minLength": 1, "title": "Idempotency Key", "type": "string"}, "seat_metric_id": {"description": "Seat metric the change applies to.", "examples": ["01909e26-d1a4-7e6d-8b3c-9f0a1b2c3d4e"], "format": "uuid", "title": "Seat Metric Id", "type": "string"}, "timestamp": {"description": "When the change happened, as an RFC 3339 date-time in UTC (`Z` or `+00:00`). More than 24 hours in the future is reported in `validation_failed`.", "examples": ["2026-07-15T14:30:00Z"], "format": "date-time", "title": "Timestamp", "type": "string"}}, "required": ["contract_id", "seat_metric_id", "change_type", "count", "effective_date", "timestamp", "idempotency_key"], "title": "IngestSeatEventRequest", "type": "object"}, "IngestSeatEventsRequest": {"additionalProperties": false, "description": "A batch of 1 to 500 seat changes.", "properties": {"events": {"description": "Seat changes to ingest, 1 to 500 per request. Invalid ones are reported in `validation_failed`.", "items": {"$ref": "#/components/schemas/IngestSeatEventRequest"}, "maxItems": 500, "minItems": 1, "title": "Events", "type": "array"}}, "required": ["events"], "title": "IngestSeatEventsRequest", "type": "object"}, "IngestUsageEventRequest": {"additionalProperties": false, "description": "One usage event in an ingest batch.", "example": {"event_name": "api_request", "external_customer_id": "cust-4821", "idempotency_key": "usage-evt-2026-07-15-001", "properties": {"endpoint": "/v1/charges", "requests": "42"}, "timestamp": "2026-07-15T14:30:00Z"}, "properties": {"customer_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Relvo customer id. Send exactly one of `customer_id` or `external_customer_id`.", "examples": ["01936f2e-1f3a-7e9b-8a7c-6d5e4f3a2b1c"], "title": "Customer Id"}, "event_name": {"description": "Event name identifying the action, for example `api_request`. Surrounding whitespace is trimmed; whitespace inside the name is rejected with 422.", "examples": ["api_request"], "minLength": 1, "title": "Event Name", "type": "string"}, "external_customer_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Your code for the customer. Send exactly one of `customer_id` or `external_customer_id`.", "examples": ["cust-4821"], "title": "External Customer Id"}, "idempotency_key": {"description": "Client-chosen key that de-duplicates the event within the organization. Use letters, digits, `.`, `_` and `-`. The same key with the same body is a duplicate and is not queued again; the same key with a different body rejects the whole batch with 409. Look receipts up later with `GET /usage-event-receipts?idempotency_key=...`.", "examples": ["usage-evt-2026-07-15-001"], "minLength": 1, "title": "Idempotency Key", "type": "string"}, "properties": {"$ref": "#/components/schemas/UsageEventProperties"}, "timestamp": {"description": "When the usage occurred, as an RFC 3339 date-time in UTC (`Z` or `+00:00`). Any other offset or a naive value is rejected with 422. A timestamp more than 1 hour in the future is not queued and is reported in `validation_failed`.", "examples": ["2026-07-15T14:30:00Z"], "format": "date-time", "title": "Timestamp", "type": "string"}}, "required": ["event_name", "timestamp", "idempotency_key"], "title": "IngestUsageEventRequest", "type": "object"}, "IngestUsageEventsRequest": {"additionalProperties": false, "description": "A batch of 1 to 500 usage events.", "example": {"events": [{"event_name": "api_request", "external_customer_id": "cust-4821", "idempotency_key": "usage-evt-2026-07-15-001", "properties": {"endpoint": "/v1/charges", "requests": "42"}, "timestamp": "2026-07-15T14:30:00Z"}, {"event_name": "api_request", "external_customer_id": "cust-4821", "idempotency_key": "usage-evt-2026-07-15-002", "properties": {"endpoint": "/v1/refunds", "requests": "3"}, "timestamp": "2026-07-15T14:31:00Z"}]}, "properties": {"events": {"description": "Events to ingest, 1 to 500 per request. Events are validated one by one: invalid events are reported in `validation_failed` and the rest are queued.", "items": {"$ref": "#/components/schemas/IngestUsageEventRequest"}, "maxItems": 500, "minItems": 1, "title": "Events", "type": "array"}}, "required": ["events"], "title": "IngestUsageEventsRequest", "type": "object"}, "IntegrationId": {"additionalProperties": false, "description": "An external accounting identifier; at most one per service.", "properties": {"id": {"description": "Identifier of the credit grant in the external service.", "title": "Id", "type": "string"}, "isPending": {"description": "Whether the external identifier is awaiting synchronization.", "title": "Ispending", "type": "boolean"}, "service": {"description": "Name of the external integration service.", "title": "Service", "type": "string"}}, "required": ["service", "id", "isPending"], "title": "IntegrationId", "type": "object"}, "IntegrationIdInput": {"additionalProperties": false, "description": "External identifier supplied with commercial configuration.", "properties": {"id": {"description": "Identifier of the credit grant in the external service.", "title": "Id", "type": "string"}, "isPending": {"default": false, "description": "Whether the external identifier is awaiting synchronization.", "title": "Ispending", "type": "boolean"}, "service": {"description": "Name of the external integration service.", "title": "Service", "type": "string"}}, "required": ["service", "id"], "title": "IntegrationIdInput", "type": "object"}, "Invoice": {"additionalProperties": false, "description": "An invoice, from draft through issuance, payment and correction.", "properties": {"balance": {"anyOf": [{"$ref": "#/components/schemas/InvoiceBalance"}, {"type": "null"}], "description": "What the customer still owes; null until the invoice is issued."}, "billing_entity_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "The customer billing entity invoiced.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a11"], "title": "Billing Entity Id"}, "billing_period": {"anyOf": [{"$ref": "#/components/schemas/DatePeriod"}, {"type": "null"}], "description": "Period the invoice bills."}, "cancelled_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When the draft was cancelled; null unless cancelled.", "examples": ["2026-01-20T10:00:00Z"], "title": "Cancelled At"}, "collection_payment_terms_days": {"anyOf": [{"type": "integer"}, {"type": "null"}], "description": "Separately agreed collection terms; null when the original document terms apply.", "title": "Collection Payment Terms Days"}, "comment": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Comment printed on the document.", "examples": ["Thank you for your business."], "title": "Comment"}, "commercial_references": {"description": "Commercial references printed on the invoice, such as purchase orders.", "items": {"$ref": "#/components/schemas/CommercialReference"}, "title": "Commercial References", "type": "array"}, "contract_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "The single contract behind the lines; null for manual or multi-contract invoices.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a14"], "title": "Contract Id"}, "contractual_due_date": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Original document deadline, retained when collection terms are renegotiated.", "title": "Contractual Due Date"}, "created_at": {"description": "When the invoice was created.", "examples": ["2026-01-31T12:00:00Z"], "format": "date-time", "title": "Created At", "type": "string"}, "currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency the invoice is issued in.", "examples": ["CLP"]}, "customer": {"anyOf": [{"$ref": "#/components/schemas/InvoiceCounterparty"}, {"type": "null"}], "description": "The customer's legal identity on the document; null until resolved."}, "customer_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "The customer invoiced; null while not yet resolved.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a13"], "title": "Customer Id"}, "delivered_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When delivery to the customer was confirmed; null until delivered.", "examples": ["2026-01-31T12:06:00Z"], "title": "Delivered At"}, "delivery_status": {"$ref": "#/components/schemas/InvoiceDeliveryStatus", "description": "Delivery of the invoice to the customer by email.", "examples": ["delivered"]}, "due_date": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Date payment is due; null without an issue date or payment terms.", "examples": ["2026-03-02"], "title": "Due Date"}, "fiscal": {"$ref": "#/components/schemas/FiscalDocument", "description": "The tax document behind the invoice."}, "id": {"description": "Invoice id, stable from draft through void.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10"], "format": "uuid", "title": "Id", "type": "string"}, "issuance_requirements": {"$ref": "#/components/schemas/InvoiceIssuanceRequirements"}, "issue_date": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Date printed as the issue date; null on a draft that has none yet.", "examples": ["2026-01-31"], "title": "Issue Date"}, "issued_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When the invoice was issued; null until issued.", "examples": ["2026-01-31T12:05:00Z"], "title": "Issued At"}, "issuer": {"anyOf": [{"$ref": "#/components/schemas/InvoiceCounterparty"}, {"type": "null"}], "description": "Your legal identity on the document; null until resolved."}, "issuer_billing_entity_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Your legal entity the invoice is issued from.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a12"], "title": "Issuer Billing Entity Id"}, "line_groups": {"description": "Groups that print related lines under one heading, in document order.", "items": {"$ref": "#/components/schemas/InvoiceLineGroup"}, "title": "Line Groups", "type": "array"}, "lines": {"description": "Every line of the invoice, in document order.", "items": {"$ref": "#/components/schemas/InvoiceLine"}, "title": "Lines", "type": "array"}, "metadata": {"additionalProperties": {"$ref": "#/components/schemas/JsonValue"}, "description": "Your own key-value data.", "examples": [{"erp_reference": "SO-10023"}], "title": "Metadata", "type": "object"}, "paid_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When the invoice became fully paid; null until then.", "examples": ["2026-02-28T09:00:00Z"], "title": "Paid At"}, "payment_status": {"$ref": "#/components/schemas/InvoicePaymentStatus", "description": "How much of the issued balance has been paid.", "examples": ["partially_paid"]}, "payment_terms_days": {"anyOf": [{"type": "integer"}, {"type": "null"}], "description": "Original document payment terms. Separately agreed collection terms are in collection_payment_terms_days; null when no terms apply.", "examples": [30], "title": "Payment Terms Days"}, "status": {"$ref": "#/components/schemas/InvoiceStatus", "description": "Lifecycle status of the invoice.", "examples": ["open"]}, "totals": {"description": "One entry per currency the lines are priced in. An issued invoice has exactly one, in `currency`.", "items": {"$ref": "#/components/schemas/InvoiceTotals"}, "title": "Totals", "type": "array"}, "updated_at": {"description": "When the invoice last changed (any edit, issuance, payment, delivery or fiscal outcome). The `updated_since` list filter compares against it.", "examples": ["2026-02-10T15:30:00Z"], "format": "date-time", "title": "Updated At", "type": "string"}, "version": {"description": "Concurrency version; send it as `If-Match` to change the invoice.", "examples": [3], "title": "Version", "type": "integer"}, "voided_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When the invoice became void; null unless void.", "examples": ["2026-03-05T10:00:00Z"], "title": "Voided At"}}, "required": ["id", "version", "status", "payment_status", "delivery_status", "currency", "customer_id", "billing_entity_id", "issuer_billing_entity_id", "contract_id", "issue_date", "due_date", "payment_terms_days", "billing_period", "comment", "metadata", "totals", "balance", "lines", "line_groups", "commercial_references", "issuance_requirements", "issuer", "customer", "fiscal", "created_at", "updated_at", "issued_at", "delivered_at", "paid_at", "voided_at", "cancelled_at"], "title": "Invoice", "type": "object"}, "InvoiceBalance": {"additionalProperties": false, "description": "What the issued invoice is owed, after its corrections and payments.\n\nAll amounts are in ``currency``, the invoice currency. While the invoice is\nnot void, ``due_amount = gross_amount + debited_amount - credited_amount -\npaid_amount``, where ``gross_amount`` is the single entry of ``totals``.", "properties": {"credited_amount": {"description": "Reduced by accepted credit notes against this invoice.", "examples": ["0"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Credited Amount", "type": "string"}, "currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency of every amount here.", "examples": ["CLP"]}, "debited_amount": {"description": "Raised by accepted debit notes against this invoice.", "examples": ["0"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Debited Amount", "type": "string"}, "due_amount": {"description": "Still owed by the customer; zero once fully paid. Negative when payments exceed what is owed, so the customer is owed that money back. A void invoice owes nothing, so its `due_amount` is minus whatever was paid on it.", "examples": ["690000"], "pattern": "^-?\\d+(\\.\\d+)?$", "title": "Due Amount", "type": "string"}, "paid_amount": {"description": "Payments applied to this invoice.", "examples": ["500000"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Paid Amount", "type": "string"}, "written_off_amount": {"description": "The part of `due_amount` written off as uncollectible. It stays in `due_amount`: a payment received later recovers it.", "examples": ["0"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Written Off Amount", "type": "string"}}, "required": ["currency", "debited_amount", "credited_amount", "paid_amount", "due_amount", "written_off_amount"], "title": "InvoiceBalance", "type": "object"}, "InvoiceCounterparty": {"additionalProperties": false, "description": "Legal identity printed on the document (frozen once issued).", "properties": {"address": {"anyOf": [{"$ref": "#/components/schemas/PostalAddress"}, {"type": "null"}], "description": "Registered postal address."}, "business_activity": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Registered line of business, where the jurisdiction prints one.", "examples": ["Servicios de consultoría informática"], "title": "Business Activity"}, "country": {"anyOf": [{"$ref": "#/components/schemas/CountryEnum"}, {"type": "null"}], "description": "ISO 3166-1 alpha-2 country the party is registered in.", "examples": ["CL"]}, "legal_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Registered legal name.", "examples": ["Comercial Andes SpA"], "title": "Legal Name"}, "tax_id": {"anyOf": [{"$ref": "#/components/schemas/TaxIdentifier"}, {"type": "null"}], "description": "Tax identifier, as printed."}}, "required": ["legal_name", "tax_id", "country", "address", "business_activity"], "title": "InvoiceCounterparty", "type": "object"}, "InvoiceCreate": {"additionalProperties": false, "description": "A new draft invoice for a customer billing entity.", "example": {"billing_entity_id": "0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a11", "currency": "CLP", "issue_date": "2026-01-31", "issuer_billing_entity_id": "0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a12", "lines": [{"currency": "CLP", "description": "Monthly subscription, January 2026", "net_amount": "1000000", "quantity": "1", "title": "Platform subscription"}], "payment_terms_days": 30}, "properties": {"billing_entity_id": {"description": "Customer billing entity to invoice. The receiver's legal identity is resolved from it and frozen when the invoice is issued.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a11"], "format": "uuid", "title": "Billing Entity Id", "type": "string"}, "billing_period": {"anyOf": [{"$ref": "#/components/schemas/DatePeriod"}, {"type": "null"}], "description": "Period the invoice bills, if any."}, "comment": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Comment printed on the document.", "examples": ["Thank you for your business."], "title": "Comment"}, "currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency the invoice is issued in. Must match the billing currency of the customer billing entity.", "examples": ["CLP"]}, "issue_date": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Date to print as the issue date. Omit to use the day the invoice is issued.", "examples": ["2026-01-31"], "title": "Issue Date"}, "issuer_billing_entity_id": {"description": "Your legal entity the invoice is issued from.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a12"], "format": "uuid", "title": "Issuer Billing Entity Id", "type": "string"}, "lines": {"default": [], "description": "Lines to add to the new draft, in order.", "items": {"$ref": "#/components/schemas/InvoiceLineInput"}, "maxItems": 200, "title": "Lines", "type": "array"}, "metadata": {"additionalProperties": {"$ref": "#/components/schemas/JsonValue"}, "description": "Your own key-value data, stored and returned as sent.", "examples": [{"erp_reference": "SO-10023"}], "title": "Metadata", "type": "object"}, "payment_terms_days": {"anyOf": [{"minimum": 0.0, "type": "integer"}, {"type": "null"}], "description": "Days from the issue date until payment is due. Omit to use the default terms of the customer billing entity.", "examples": [30], "title": "Payment Terms Days"}, "required_commercial_reference_kinds": {"default": [], "description": "Commercial reference kinds that must be registered before issuing.", "examples": [["purchase_order"]], "items": {"$ref": "#/components/schemas/CommercialReferenceKind"}, "title": "Required Commercial Reference Kinds", "type": "array"}, "requires_external_approval": {"default": false, "description": "Whether issuing must wait for an approval given outside Relvo.", "examples": [false], "title": "Requires External Approval", "type": "boolean"}}, "required": ["billing_entity_id", "issuer_billing_entity_id", "currency"], "title": "InvoiceCreate", "type": "object"}, "InvoiceDeliveryStatus": {"description": "Delivery of the invoice to the customer by email.\n\n- `not_sent`: no email has been requested.\n- `send_requested`: an email was requested and is queued.\n- `sent_to_provider`: the email was handed to the email provider.\n- `delivered`: the provider confirmed delivery to the recipient.\n- `delivery_failed`: the provider reported a failure or bounce; it can be resent.", "enum": ["not_sent", "send_requested", "sent_to_provider", "delivered", "delivery_failed"], "title": "InvoiceDeliveryStatus", "type": "string"}, "InvoiceDraftedData": {"additionalProperties": false, "description": "A draft invoice was created and awaits review before issuance.", "properties": {"invoice_id": {"description": "The draft invoice; read it with `GET /public/invoices/{invoice_id}`.", "format": "uuid", "title": "Invoice Id", "type": "string"}}, "required": ["invoice_id"], "title": "InvoiceDraftedData", "type": "object"}, "InvoiceDraftedEvent": {"additionalProperties": false, "description": "`invoice.drafted`: A draft invoice was created and awaits review before issuance.", "properties": {"created_at": {"description": "When the event entered the event log. The `created_at_from`/`created_at_to` filters and the 30-day retention window apply to it.", "format": "date-time", "title": "Created At", "type": "string"}, "data": {"$ref": "#/components/schemas/InvoiceDraftedData", "description": "The event's payload, typed by `type`."}, "id": {"description": "Event id; the same value as the `Relvo-Event-Id` header of every delivery of this event. Use it to deduplicate.", "format": "uuid", "title": "Id", "type": "string"}, "occurred_at": {"description": "When the change happened in Relvo.", "format": "date-time", "title": "Occurred At", "type": "string"}, "organization_id": {"description": "The organization the event belongs to.", "format": "uuid", "title": "Organization Id", "type": "string"}, "schema_version": {"description": "Version of this event type's `data` schema.", "minimum": 1.0, "title": "Schema Version", "type": "integer"}, "type": {"const": "invoice.drafted", "description": "The event type.", "title": "Type", "type": "string"}}, "required": ["id", "schema_version", "occurred_at", "organization_id", "created_at", "type", "data"], "title": "InvoiceDraftedEvent", "type": "object"}, "InvoiceDuplicate": {"additionalProperties": false, "description": "Options for copying an invoice into a new draft. Omit both fields to keep the parties.", "properties": {"billing_entity_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Invoice a different customer billing entity with the copy.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a11"], "title": "Billing Entity Id"}, "issuer_billing_entity_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Issue the copy from a different legal entity.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a12"], "title": "Issuer Billing Entity Id"}}, "title": "InvoiceDuplicate", "type": "object"}, "InvoiceFiscalRejectedData": {"additionalProperties": false, "description": "The tax authority rejected an invoice, or the customer claimed it.", "properties": {"invoice_id": {"description": "The invoice; read it with `GET /public/invoices/{invoice_id}`.", "format": "uuid", "title": "Invoice Id", "type": "string"}, "rejection_reason": {"description": "Authority message or customer claim code explaining the rejection.", "title": "Rejection Reason", "type": "string"}, "rejection_source": {"anyOf": [{"$ref": "#/components/schemas/InvoiceFiscalRejectionSource"}, {"type": "null"}], "description": "Who rejected the invoice; `null` when it was not recorded."}}, "required": ["invoice_id", "rejection_reason"], "title": "InvoiceFiscalRejectedData", "type": "object"}, "InvoiceFiscalRejectedEvent": {"additionalProperties": false, "description": "`invoice.fiscal_rejected`: The tax authority rejected an invoice.", "properties": {"created_at": {"description": "When the event entered the event log. The `created_at_from`/`created_at_to` filters and the 30-day retention window apply to it.", "format": "date-time", "title": "Created At", "type": "string"}, "data": {"$ref": "#/components/schemas/InvoiceFiscalRejectedData", "description": "The event's payload, typed by `type`."}, "id": {"description": "Event id; the same value as the `Relvo-Event-Id` header of every delivery of this event. Use it to deduplicate.", "format": "uuid", "title": "Id", "type": "string"}, "occurred_at": {"description": "When the change happened in Relvo.", "format": "date-time", "title": "Occurred At", "type": "string"}, "organization_id": {"description": "The organization the event belongs to.", "format": "uuid", "title": "Organization Id", "type": "string"}, "schema_version": {"description": "Version of this event type's `data` schema.", "minimum": 1.0, "title": "Schema Version", "type": "integer"}, "type": {"const": "invoice.fiscal_rejected", "description": "The event type.", "title": "Type", "type": "string"}}, "required": ["id", "schema_version", "occurred_at", "organization_id", "created_at", "type", "data"], "title": "InvoiceFiscalRejectedEvent", "type": "object"}, "InvoiceFiscalRejectionSource": {"description": "Who rejected the invoice.\n\n- `tax_authority`: the tax authority refused the document.\n- `customer_claim`: the customer claimed the accepted document before the tax\n  authority's deadline, which voids its fiscal acceptance.\n- `imported`: the document was already rejected when it was imported.", "enum": ["tax_authority", "customer_claim", "imported"], "title": "InvoiceFiscalRejectionSource", "type": "string"}, "InvoiceIssuanceRequirements": {"additionalProperties": false, "description": "What must be true before the draft can be issued.", "properties": {"missing_commercial_reference_kinds": {"description": "The required kinds not registered yet; issuing is blocked until empty.", "examples": [[]], "items": {"$ref": "#/components/schemas/CommercialReferenceKind"}, "title": "Missing Commercial Reference Kinds", "type": "array"}, "required_commercial_reference_kinds": {"description": "Reference kinds that must be registered before issuing.", "examples": [["purchase_order"]], "items": {"$ref": "#/components/schemas/CommercialReferenceKind"}, "title": "Required Commercial Reference Kinds", "type": "array"}, "requires_external_approval": {"description": "Whether issuing waits for an approval outside Relvo.", "examples": [false], "title": "Requires External Approval", "type": "boolean"}}, "required": ["required_commercial_reference_kinds", "missing_commercial_reference_kinds", "requires_external_approval"], "title": "InvoiceIssuanceRequirements", "type": "object"}, "InvoiceIssuedData": {"additionalProperties": false, "description": "The tax authority accepted an invoice; it is now fiscally issued.", "properties": {"fiscal_uuid": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Tax authority document id, when the provider gives one.", "title": "Fiscal Uuid"}, "folio": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Fiscal folio number.", "title": "Folio"}, "invoice_id": {"description": "The invoice; read it with `GET /public/invoices/{invoice_id}`.", "format": "uuid", "title": "Invoice Id", "type": "string"}}, "required": ["invoice_id", "fiscal_uuid", "folio"], "title": "InvoiceIssuedData", "type": "object"}, "InvoiceIssuedEvent": {"additionalProperties": false, "description": "`invoice.issued`: The tax authority accepted an invoice; it is now fiscally issued.", "properties": {"created_at": {"description": "When the event entered the event log. The `created_at_from`/`created_at_to` filters and the 30-day retention window apply to it.", "format": "date-time", "title": "Created At", "type": "string"}, "data": {"$ref": "#/components/schemas/InvoiceIssuedData", "description": "The event's payload, typed by `type`."}, "id": {"description": "Event id; the same value as the `Relvo-Event-Id` header of every delivery of this event. Use it to deduplicate.", "format": "uuid", "title": "Id", "type": "string"}, "occurred_at": {"description": "When the change happened in Relvo.", "format": "date-time", "title": "Occurred At", "type": "string"}, "organization_id": {"description": "The organization the event belongs to.", "format": "uuid", "title": "Organization Id", "type": "string"}, "schema_version": {"description": "Version of this event type's `data` schema.", "minimum": 1.0, "title": "Schema Version", "type": "integer"}, "type": {"const": "invoice.issued", "description": "The event type.", "title": "Type", "type": "string"}}, "required": ["id", "schema_version", "occurred_at", "organization_id", "created_at", "type", "data"], "title": "InvoiceIssuedEvent", "type": "object"}, "InvoiceLine": {"additionalProperties": false, "description": "One line of an invoice: what is charged, its amounts and its taxes.", "properties": {"amount_basis": {"$ref": "#/components/schemas/InvoiceLineAmountBasis", "description": "Whether the amount is `quantity` times `unit_price` or an exact total.", "examples": ["unit_rate"]}, "currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency of the line amounts.", "examples": ["CLP"]}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Optional line description.", "examples": ["Monthly subscription, January 2026"], "title": "Description"}, "gross_amount": {"description": "Tax-inclusive line amount.", "examples": ["1190000"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Gross Amount", "type": "string"}, "group_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Line group the line belongs to.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a23"], "title": "Group Id"}, "id": {"description": "Line id.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a24"], "format": "uuid", "title": "Id", "type": "string"}, "item_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Catalog item the line sells.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a21"], "title": "Item Id"}, "line_number": {"description": "1-based position on the document.", "examples": [1], "title": "Line Number", "type": "integer"}, "net_amount": {"description": "Tax-exclusive line amount.", "examples": ["1000000"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Net Amount", "type": "string"}, "price_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Catalog price the line uses.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a22"], "title": "Price Id"}, "quantity": {"description": "Quantity, as a non-negative decimal string. Zero is valid for zero-usage evidence and charges explained by adjustments such as a minimum commitment.", "examples": ["0", "1"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Quantity", "type": "string"}, "revenue_recognition": {"$ref": "#/components/schemas/RevenueRecognition", "description": "How the line's revenue is recognized."}, "service_period": {"anyOf": [{"$ref": "#/components/schemas/DatePeriod"}, {"type": "null"}], "description": "Period the line's service covers."}, "source": {"$ref": "#/components/schemas/InvoiceLineSource", "description": "`generated` lines come from billing; `manual` lines were authored by hand.", "examples": ["generated"]}, "tax_amount": {"description": "Total tax on the line.", "examples": ["190000"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Tax Amount", "type": "string"}, "taxes": {"description": "Every tax applied to the line; `tax_amount` is their sum.", "items": {"$ref": "#/components/schemas/InvoiceLineTax"}, "title": "Taxes", "type": "array"}, "title": {"description": "Line title printed on the document.", "examples": ["Platform subscription"], "title": "Title", "type": "string"}, "unit_of_measure": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Unit code, e.g. `hours`.", "examples": ["hours"], "title": "Unit Of Measure"}, "unit_price": {"anyOf": [{"description": "Non-negative decimal amount as a string, e.g. `\"1000\"` or `\"10.50\"`.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "type": "string"}, {"type": "null"}], "description": "Tax-exclusive price per unit; null for an `exact_total` line.", "examples": ["1000000"], "title": "Unit Price"}}, "required": ["id", "line_number", "title", "description", "quantity", "unit_price", "unit_of_measure", "amount_basis", "service_period", "item_id", "price_id", "group_id", "source", "revenue_recognition", "currency", "net_amount", "taxes", "tax_amount", "gross_amount"], "title": "InvoiceLine", "type": "object"}, "InvoiceLineAmountBasis": {"description": "How a line's amount was established.\n\n- `unit_rate`: the amount is `quantity` times `unit_price`.\n- `exact_total`: the amount was supplied as an exact total; `unit_price` is null.", "enum": ["unit_rate", "exact_total"], "title": "InvoiceLineAmountBasis", "type": "string"}, "InvoiceLineGroup": {"additionalProperties": false, "description": "A heading that groups related lines on the document, with their totals.", "properties": {"description": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Optional group description.", "examples": ["Implementation work delivered in January"], "title": "Description"}, "group_number": {"description": "1-based position of the group on the document.", "examples": [1], "title": "Group Number", "type": "integer"}, "id": {"description": "Group id; lines reference it as `group_id`.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a23"], "format": "uuid", "title": "Id", "type": "string"}, "title": {"description": "Group title printed on the document.", "examples": ["Professional services"], "title": "Title", "type": "string"}, "totals": {"description": "Totals of the group's lines, one entry per currency.", "items": {"$ref": "#/components/schemas/InvoiceTotals"}, "title": "Totals", "type": "array"}}, "required": ["id", "group_number", "title", "description", "totals"], "title": "InvoiceLineGroup", "type": "object"}, "InvoiceLineGroupInput": {"additionalProperties": false, "description": "A new line group, used to print related lines together under one heading.", "properties": {"description": {"anyOf": [{"maxLength": 1000, "type": "string"}, {"type": "null"}], "description": "Optional group description.", "examples": ["Implementation work delivered in January"], "title": "Description"}, "title": {"description": "Group title printed on the document.", "examples": ["Professional services"], "maxLength": 80, "minLength": 1, "title": "Title", "type": "string"}}, "required": ["title"], "title": "InvoiceLineGroupInput", "type": "object"}, "InvoiceLineGroupList": {"additionalProperties": false, "description": "Every line group of one invoice, in document order.", "properties": {"items": {"description": "The invoice's line groups.", "items": {"$ref": "#/components/schemas/InvoiceLineGroup"}, "title": "Items", "type": "array"}, "next_cursor": {"description": "Always null: this collection is bounded (the invoice's line groups, which the invoice resource also embeds whole).", "title": "Next Cursor", "type": "null"}}, "required": ["items", "next_cursor"], "title": "InvoiceLineGroupList", "type": "object"}, "InvoiceLineGroupUpdate": {"additionalProperties": false, "description": "Partial change to a line group; ``description: null`` clears it.", "properties": {"description": {"anyOf": [{"maxLength": 1000, "type": "string"}, {"type": "null"}], "description": "New group description; `null` clears it.", "examples": ["Implementation work delivered in January"], "title": "Description"}, "title": {"anyOf": [{"maxLength": 80, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "New group title.", "examples": ["Professional services"], "title": "Title"}}, "title": "InvoiceLineGroupUpdate", "type": "object"}, "InvoiceLineInput": {"additionalProperties": false, "description": "A line added by hand to a draft, priced by its final tax-exclusive amount.", "properties": {"currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency of `net_amount`.", "examples": ["CLP"]}, "description": {"anyOf": [{"maxLength": 1000, "type": "string"}, {"type": "null"}], "description": "Optional longer description printed under the title.", "examples": ["Monthly subscription, January 2026"], "title": "Description"}, "group_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Line group the line belongs to.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a23"], "title": "Group Id"}, "item_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Catalog item the line sells.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a21"], "title": "Item Id"}, "net_amount": {"description": "Final tax-exclusive line amount; the unit price is derived from it.", "examples": ["1000000"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Net Amount", "type": "string"}, "price_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Catalog price the line uses.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a22"], "title": "Price Id"}, "quantity": {"description": "Quantity, as a decimal string.", "examples": ["1"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Quantity", "type": "string"}, "revenue_recognition": {"anyOf": [{"$ref": "#/components/schemas/RevenueRecognitionInput"}, {"type": "null"}], "description": "How the line's revenue is recognized. Omit to let issuance freeze a default: straight_line over the line's service period, else over the invoice billing period, else point_in_time."}, "service_period": {"anyOf": [{"$ref": "#/components/schemas/DatePeriod"}, {"type": "null"}], "description": "Period the line's service covers, if any."}, "title": {"description": "Line title printed on the document.", "examples": ["Platform subscription"], "maxLength": 80, "minLength": 1, "title": "Title", "type": "string"}, "unit_of_measure": {"anyOf": [{"maxLength": 20, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Unit the quantity is expressed in, printed on the document.", "examples": ["hours"], "title": "Unit Of Measure"}}, "required": ["title", "quantity", "net_amount", "currency"], "title": "InvoiceLineInput", "type": "object"}, "InvoiceLineList": {"additionalProperties": false, "description": "Every line of one invoice, in document order.", "properties": {"items": {"description": "The invoice's lines.", "items": {"$ref": "#/components/schemas/InvoiceLine"}, "title": "Items", "type": "array"}, "next_cursor": {"description": "Always null: this collection is bounded (the invoice's lines, which the invoice resource also embeds whole).", "title": "Next Cursor", "type": "null"}}, "required": ["items", "next_cursor"], "title": "InvoiceLineList", "type": "object"}, "InvoiceLineSource": {"description": "Where a line came from.\n\n- `generated`: produced by billing from a contract.\n- `manual`: added by hand to a draft.", "enum": ["generated", "manual"], "title": "InvoiceLineSource", "type": "string"}, "InvoiceLineTax": {"additionalProperties": false, "description": "One tax applied to a line, in the line's currency.", "properties": {"name": {"description": "Tax name as configured, e.g. `IVA`.", "examples": ["IVA"], "title": "Name", "type": "string"}, "rate": {"description": "Rate as a ratio, as a decimal string, e.g. `0.19` for 19%.", "examples": ["0.19"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Rate", "type": "string"}, "tax_amount": {"description": "Tax charged.", "examples": ["190000"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Tax Amount", "type": "string"}, "taxable_amount": {"description": "Amount the rate was applied to.", "examples": ["1000000"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Taxable Amount", "type": "string"}, "treatment": {"$ref": "#/components/schemas/TaxTreatment", "description": "How the tax applies to the line.", "examples": ["taxable"]}}, "required": ["name", "rate", "treatment", "taxable_amount", "tax_amount"], "title": "InvoiceLineTax", "type": "object"}, "InvoiceLineUpdate": {"additionalProperties": false, "description": "Partial change to one draft line; only the fields sent change.", "properties": {"currency": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "New ISO 4217 currency of `net_amount`.", "examples": ["CLP"]}, "description": {"anyOf": [{"maxLength": 1000, "type": "string"}, {"type": "null"}], "description": "New line description.", "examples": ["Monthly subscription, January 2026"], "title": "Description"}, "group_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "New line group the line belongs to.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a23"], "title": "Group Id"}, "item_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "New catalog item the line sells.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a21"], "title": "Item Id"}, "net_amount": {"anyOf": [{"description": "Non-negative decimal amount as a string, e.g. `\"1000\"` or `\"10.50\"`.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "type": "string"}, {"type": "null"}], "description": "New final tax-exclusive line amount; the unit price is derived from it.", "examples": ["1000000"], "title": "Net Amount"}, "price_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "New catalog price the line uses.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a22"], "title": "Price Id"}, "quantity": {"anyOf": [{"pattern": "^\\d+(\\.\\d+)?$", "type": "string"}, {"type": "null"}], "description": "New quantity, as a decimal string.", "examples": ["2"], "title": "Quantity"}, "revenue_recognition": {"anyOf": [{"$ref": "#/components/schemas/RevenueRecognitionInput"}, {"type": "null"}], "description": "New revenue recognition instruction for the line."}, "service_period": {"anyOf": [{"$ref": "#/components/schemas/DatePeriod"}, {"type": "null"}], "description": "New period the line's service covers."}, "title": {"anyOf": [{"maxLength": 80, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "New line title.", "examples": ["Platform subscription"], "title": "Title"}, "unit_of_measure": {"anyOf": [{"maxLength": 20, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "New unit the quantity is expressed in.", "examples": ["hours"], "title": "Unit Of Measure"}}, "title": "InvoiceLineUpdate", "type": "object"}, "InvoiceList": {"additionalProperties": false, "description": "A page of invoices; pass `next_cursor` as `cursor` to fetch the next page.", "properties": {"items": {"description": "The invoices on this page.", "items": {"$ref": "#/components/schemas/Invoice"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Pass as `cursor` for the next page; null on the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items", "next_cursor"], "title": "InvoiceList", "type": "object"}, "InvoicePaidData": {"additionalProperties": false, "description": "An invoice became fully paid.", "properties": {"currency": {"description": "ISO 4217 currency code of the amount, uppercase.", "pattern": "^[A-Z]{3}$", "title": "Currency", "type": "string"}, "invoice_id": {"description": "The invoice; read it with `GET /public/invoices/{invoice_id}`.", "format": "uuid", "title": "Invoice Id", "type": "string"}, "paid_at": {"description": "When the invoice became fully paid.", "format": "date-time", "title": "Paid At", "type": "string"}, "total_amount": {"description": "The invoice total that is now paid, as a decimal string.", "pattern": "^\\d+(\\.\\d+)?$", "title": "Total Amount", "type": "string"}}, "required": ["invoice_id", "total_amount", "currency", "paid_at"], "title": "InvoicePaidData", "type": "object"}, "InvoicePaidEvent": {"additionalProperties": false, "description": "`invoice.paid`: An invoice became fully paid.", "properties": {"created_at": {"description": "When the event entered the event log. The `created_at_from`/`created_at_to` filters and the 30-day retention window apply to it.", "format": "date-time", "title": "Created At", "type": "string"}, "data": {"$ref": "#/components/schemas/InvoicePaidData", "description": "The event's payload, typed by `type`."}, "id": {"description": "Event id; the same value as the `Relvo-Event-Id` header of every delivery of this event. Use it to deduplicate.", "format": "uuid", "title": "Id", "type": "string"}, "occurred_at": {"description": "When the change happened in Relvo.", "format": "date-time", "title": "Occurred At", "type": "string"}, "organization_id": {"description": "The organization the event belongs to.", "format": "uuid", "title": "Organization Id", "type": "string"}, "schema_version": {"description": "Version of this event type's `data` schema.", "minimum": 1.0, "title": "Schema Version", "type": "integer"}, "type": {"const": "invoice.paid", "description": "The event type.", "title": "Type", "type": "string"}}, "required": ["id", "schema_version", "occurred_at", "organization_id", "created_at", "type", "data"], "title": "InvoicePaidEvent", "type": "object"}, "InvoicePaymentReceivedData": {"additionalProperties": false, "description": "A payment was applied to an invoice.", "properties": {"amount_paid": {"description": "Cumulative amount paid on the invoice after this payment, as a decimal string — not the amount of this payment alone.", "pattern": "^\\d+(\\.\\d+)?$", "title": "Amount Paid", "type": "string"}, "currency": {"description": "ISO 4217 currency code of the amount, uppercase.", "pattern": "^[A-Z]{3}$", "title": "Currency", "type": "string"}, "invoice_id": {"description": "The invoice; read it with `GET /public/invoices/{invoice_id}`.", "format": "uuid", "title": "Invoice Id", "type": "string"}, "payment_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "The payment that was applied, when the payment was recorded in Relvo.", "title": "Payment Id"}, "payment_status": {"$ref": "#/components/schemas/InvoicePaymentReceivedStatus"}}, "required": ["invoice_id", "amount_paid", "currency", "payment_status", "payment_id"], "title": "InvoicePaymentReceivedData", "type": "object"}, "InvoicePaymentReceivedEvent": {"additionalProperties": false, "description": "`invoice.payment_received`: A payment was applied to an invoice. `amount_paid` is the cumulative paid amount; a payment that is later reversed sends no event, so read the invoice for its current balance.", "properties": {"created_at": {"description": "When the event entered the event log. The `created_at_from`/`created_at_to` filters and the 30-day retention window apply to it.", "format": "date-time", "title": "Created At", "type": "string"}, "data": {"$ref": "#/components/schemas/InvoicePaymentReceivedData", "description": "The event's payload, typed by `type`."}, "id": {"description": "Event id; the same value as the `Relvo-Event-Id` header of every delivery of this event. Use it to deduplicate.", "format": "uuid", "title": "Id", "type": "string"}, "occurred_at": {"description": "When the change happened in Relvo.", "format": "date-time", "title": "Occurred At", "type": "string"}, "organization_id": {"description": "The organization the event belongs to.", "format": "uuid", "title": "Organization Id", "type": "string"}, "schema_version": {"description": "Version of this event type's `data` schema.", "minimum": 1.0, "title": "Schema Version", "type": "integer"}, "type": {"const": "invoice.payment_received", "description": "The event type.", "title": "Type", "type": "string"}}, "required": ["id", "schema_version", "occurred_at", "organization_id", "created_at", "type", "data"], "title": "InvoicePaymentReceivedEvent", "type": "object"}, "InvoicePaymentReceivedStatus": {"description": "How much of the invoice's balance is paid after this change.\n\n- `unpaid`: no payment applied.\n- `partially_paid`: some, but not all, of the amount owed is paid.\n- `paid`: the amount owed is fully paid.", "enum": ["unpaid", "partially_paid", "paid"], "title": "InvoicePaymentReceivedStatus", "type": "string"}, "InvoicePaymentStatus": {"description": "How much of an issued invoice's balance has been paid.\n\n- `unpaid`: no payment applied yet.\n- `partially_paid`: some, but not all, of the amount owed has been paid.\n- `paid`: the amount owed has been fully paid.\n\nOverdue is not a payment status: compare `due_date` with today instead.", "enum": ["unpaid", "partially_paid", "paid"], "title": "InvoicePaymentStatus", "type": "string"}, "InvoiceSortField": {"description": "Field the invoice list is sorted by.\n\n- `created_at`: when the invoice was created.\n- `issue_date`: the date printed as the issue date.\n- `issued_at`: when the invoice was issued.", "enum": ["created_at", "issue_date", "issued_at"], "title": "InvoiceSortField", "type": "string"}, "InvoiceSortOrder": {"description": "Sort direction of the invoice list. Only `desc` (newest first) is supported.", "enum": ["desc"], "title": "InvoiceSortOrder", "type": "string"}, "InvoiceStatus": {"description": "Lifecycle status of an invoice.\n\n- `upcoming`: a preview of an invoice a scheduled billing run will produce; not yet a draft.\n- `draft`: editable and without fiscal effect.\n- `open`: issued; its amounts and lines can no longer change.\n- `partially_voided`: issued, with part of its amount reversed by credit notes.\n- `void`: issued and fully reversed by credit notes.\n- `cancelled`: a draft abandoned before it was issued.", "enum": ["upcoming", "draft", "open", "partially_voided", "void", "cancelled"], "title": "InvoiceStatus", "type": "string"}, "InvoiceTotals": {"additionalProperties": false, "description": "Totals of the lines priced in one currency.", "properties": {"currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency of the amounts.", "examples": ["CLP"]}, "gross_amount": {"description": "Tax-inclusive total.", "examples": ["1190000"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Gross Amount", "type": "string"}, "net_amount": {"description": "Tax-exclusive total.", "examples": ["1000000"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Net Amount", "type": "string"}, "tax_amount": {"description": "Total tax.", "examples": ["190000"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Tax Amount", "type": "string"}}, "required": ["currency", "net_amount", "tax_amount", "gross_amount"], "title": "InvoiceTotals", "type": "object"}, "InvoiceUpdate": {"additionalProperties": false, "description": "Partial update of a draft: only the fields you send change.", "properties": {"billing_entity_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Customer billing entity to invoice instead. Send together with `issuer_billing_entity_id`.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a11"], "title": "Billing Entity Id"}, "billing_period": {"anyOf": [{"$ref": "#/components/schemas/DatePeriod"}, {"type": "null"}], "description": "Period the invoice bills. Send `null` to clear it."}, "comment": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Comment printed on the document. Send `null` to clear it.", "examples": ["Thank you for your business."], "title": "Comment"}, "currency": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "ISO 4217 currency to issue the invoice in.", "examples": ["CLP"]}, "issue_date": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Date to print as the issue date. Send `null` to clear it.", "examples": ["2026-01-31"], "title": "Issue Date"}, "issuer_billing_entity_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Your legal entity to issue the invoice from instead. Send together with `billing_entity_id`.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a12"], "title": "Issuer Billing Entity Id"}, "payment_terms_days": {"anyOf": [{"minimum": 0.0, "type": "integer"}, {"type": "null"}], "description": "Days from the issue date until payment is due. Can be changed but not cleared.", "examples": [30], "title": "Payment Terms Days"}}, "title": "InvoiceUpdate", "type": "object"}, "InvoiceVoidedData": {"additionalProperties": false, "description": "An issued invoice was voided by an accepted correction document.", "properties": {"credit_note_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "The accepted credit note that voided the invoice, when exactly one did.", "title": "Credit Note Id"}, "invoice_id": {"description": "The voided invoice; read it with `GET /public/invoices/{invoice_id}`.", "format": "uuid", "title": "Invoice Id", "type": "string"}}, "required": ["invoice_id", "credit_note_id"], "title": "InvoiceVoidedData", "type": "object"}, "InvoiceVoidedEvent": {"additionalProperties": false, "description": "`invoice.voided`: An issued invoice was voided by an accepted correction document.", "properties": {"created_at": {"description": "When the event entered the event log. The `created_at_from`/`created_at_to` filters and the 30-day retention window apply to it.", "format": "date-time", "title": "Created At", "type": "string"}, "data": {"$ref": "#/components/schemas/InvoiceVoidedData", "description": "The event's payload, typed by `type`."}, "id": {"description": "Event id; the same value as the `Relvo-Event-Id` header of every delivery of this event. Use it to deduplicate.", "format": "uuid", "title": "Id", "type": "string"}, "occurred_at": {"description": "When the change happened in Relvo.", "format": "date-time", "title": "Occurred At", "type": "string"}, "organization_id": {"description": "The organization the event belongs to.", "format": "uuid", "title": "Organization Id", "type": "string"}, "schema_version": {"description": "Version of this event type's `data` schema.", "minimum": 1.0, "title": "Schema Version", "type": "integer"}, "type": {"const": "invoice.voided", "description": "The event type.", "title": "Type", "type": "string"}}, "required": ["id", "schema_version", "occurred_at", "organization_id", "created_at", "type", "data"], "title": "InvoiceVoidedEvent", "type": "object"}, "ItemStatus": {"description": "Whether the item can be used by new metrics and prices.\n\n- `active`: available for new metrics and prices.\n- `inactive`: retired; it cannot be selected for new contracts, and existing uses keep working.", "enum": ["active", "inactive"], "title": "ItemStatus", "type": "string"}, "JsonValue": {}, "Message": {"additionalProperties": false, "description": "One email, inbound or outbound.", "properties": {"attachments": {"description": "Attachments; may be empty.", "items": {"$ref": "#/components/schemas/MessageAttachment"}, "title": "Attachments", "type": "array"}, "bcc": {"description": "`Bcc` addresses (outbound only; empty for inbound).", "examples": [[]], "items": {"type": "string"}, "title": "Bcc", "type": "array"}, "body_html": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Rendered HTML body of an outbound message; always null for inbound.", "examples": ["<p>Adjuntamos la factura 1234.</p>"], "title": "Body Html"}, "body_text": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Plain-text body. Inbound bodies are sanitized and quoted replies trimmed; null when the message has no text part.", "examples": ["Adjunto comprobante de pago de la factura 1234."], "title": "Body Text"}, "cc": {"description": "`Cc` addresses.", "examples": [["finanzas@customer.cl"]], "items": {"type": "string"}, "title": "Cc", "type": "array"}, "classification": {"anyOf": [{"$ref": "#/components/schemas/MessageClassification"}, {"type": "null"}], "description": "Inbound only: latest AI classification; null when none."}, "conversation_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Conversation the message belongs to; null when not threaded.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a62"], "title": "Conversation Id"}, "delivery_status": {"$ref": "#/components/schemas/MessageDeliveryStatus", "description": "Outbound: `requested` (queued), `sent`, `failed`, or `blocked_suppressed` (recipient on the suppression list). Inbound messages are always `received`.", "examples": ["received"]}, "direction": {"$ref": "#/components/schemas/MessageDirection", "description": "`outbound` for email Relvo sent, `inbound` for email Relvo received.", "examples": ["inbound"]}, "id": {"description": "Message id.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a61"], "format": "uuid", "title": "Id", "type": "string"}, "invoice_ids": {"description": "Invoices this message is about; may be empty.", "examples": [["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10"]], "items": {"format": "uuid", "type": "string"}, "title": "Invoice Ids", "type": "array"}, "occurred_at": {"description": "UTC ISO 8601 instant the send was requested (outbound) or received (inbound).", "examples": ["2026-01-31T12:00:00Z"], "format": "date-time", "title": "Occurred At", "type": "string"}, "recipients": {"description": "Every addressed recipient.", "items": {"$ref": "#/components/schemas/MessageParticipant"}, "title": "Recipients", "type": "array"}, "sender": {"$ref": "#/components/schemas/MessageParticipant", "description": "From address."}, "subject": {"description": "Email subject.", "examples": ["RE: Factura 1234"], "title": "Subject", "type": "string"}, "to": {"description": "`To` addresses.", "examples": [["ap@customer.cl"]], "items": {"type": "string"}, "title": "To", "type": "array"}}, "required": ["id", "conversation_id", "direction", "subject", "delivery_status", "occurred_at", "sender", "recipients", "to", "cc", "bcc", "body_text", "body_html", "invoice_ids", "attachments", "classification"], "title": "Message", "type": "object"}, "MessageAttachment": {"additionalProperties": false, "description": "A file attached to a message.", "properties": {"attachment_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Attachment id; null when not addressable.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a60"], "title": "Attachment Id"}, "content_type": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "MIME type; null when unknown.", "examples": ["application/pdf"], "title": "Content Type"}, "disposition": {"anyOf": [{"$ref": "#/components/schemas/MessageAttachmentDisposition"}, {"type": "null"}], "description": "`attachment` or `inline`; null when unknown.", "examples": ["attachment"]}, "filename": {"description": "File name as sent or received.", "examples": ["orden-de-compra-4500123.pdf"], "title": "Filename", "type": "string"}, "size_bytes": {"anyOf": [{"type": "integer"}, {"type": "null"}], "description": "Size in bytes; null when unknown.", "examples": [48213], "title": "Size Bytes"}}, "required": ["attachment_id", "filename", "content_type", "size_bytes", "disposition"], "title": "MessageAttachment", "type": "object"}, "MessageAttachmentData": {"additionalProperties": false, "description": "Attachment metadata named at receipt; content is never included.", "properties": {"content_type": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "MIME type declared by the sender, when present.", "title": "Content Type"}, "filename": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Attachment file name as sent, when present.", "title": "Filename"}, "id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Attachment id listed by `GET /public/messages/{message_id}`; null for messages ingested before ids were allocated.", "title": "Id"}}, "required": ["id", "filename", "content_type"], "title": "MessageAttachmentData", "type": "object"}, "MessageAttachmentDisposition": {"description": "How an attachment is presented.\n\n- `attachment`: a separate file attached to the email.\n- `inline`: embedded in the email body, such as an image.", "enum": ["attachment", "inline"], "title": "MessageAttachmentDisposition", "type": "string"}, "MessageClassification": {"additionalProperties": false, "description": "AI suggestion for human review, never financial or workflow truth.", "properties": {"artifacts": {"description": "Classifier labels for business documents the email refers to or attaches.", "examples": [["payment_proof"]], "items": {"type": "string"}, "title": "Artifacts", "type": "array"}, "confidence_score": {"description": "Decimal string between 0 and 1. A model score, not an amount.", "examples": ["0.87"], "title": "Confidence Score", "type": "string"}, "created_at": {"description": "UTC ISO 8601 instant the classification was made.", "examples": ["2026-01-31T12:01:00Z"], "format": "date-time", "title": "Created At", "type": "string"}, "needs_review": {"description": "True when a human should confirm the suggestion.", "examples": [false], "title": "Needs Review", "type": "boolean"}, "sender_origin": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Whether the email came from a person or an automated sender: `human`, `bounce`, `auto_reply`, `bank_notification`, `fiscal_system` or `erp_portal`. Read from the headers, not by the model. Null for emails classified before it was recorded.", "examples": ["human"], "title": "Sender Origin"}, "sender_role": {"description": "Classifier label for the sender's role: `external_customer`, `internal_operator` or `automated_system`.", "examples": ["external_customer"], "title": "Sender Role", "type": "string"}, "speech_act": {"description": "Classifier label for what the sender is doing, such as `provides`, `promises`, `requests`, `approves`, `disputes`, `rejects` or `acknowledges`.", "examples": ["promises"], "title": "Speech Act", "type": "string"}}, "required": ["speech_act", "sender_role", "artifacts", "confidence_score", "needs_review", "created_at"], "title": "MessageClassification", "type": "object"}, "MessageDeliveryStatus": {"description": "Delivery status of an email.\n\n- `requested`: an outbound email is queued for sending.\n- `sent`: the outbound email was handed to the mail provider.\n- `failed`: the outbound email could not be sent.\n- `blocked_suppressed`: not sent because the recipient is on the suppression list.\n- `received`: the email is inbound; every inbound email has this status.", "enum": ["requested", "sent", "failed", "blocked_suppressed", "received"], "title": "MessageDeliveryStatus", "type": "string"}, "MessageDirection": {"description": "Which way an email travelled.\n\n- `inbound`: received by Relvo.\n- `outbound`: sent by Relvo.", "enum": ["inbound", "outbound"], "title": "MessageDirection", "type": "string"}, "MessagePage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/Message"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[Message]", "type": "object"}, "MessageParticipant": {"additionalProperties": false, "description": "An email address taking part in a message, with its display name.", "properties": {"display_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Display name; null when none was given.", "examples": ["Cuentas por Pagar"], "title": "Display Name"}, "email": {"description": "Email address.", "examples": ["ap@customer.cl"], "title": "Email", "type": "string"}}, "required": ["email", "display_name"], "title": "MessageParticipant", "type": "object"}, "MessageReceivedData": {"additionalProperties": false, "description": "An inbound email reached the organization's messaging inbox.", "properties": {"attachments": {"description": "Attachment metadata only; content is never included.", "items": {"$ref": "#/components/schemas/MessageAttachmentData"}, "title": "Attachments", "type": "array"}, "conversation_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "The conversation the message was threaded into, when known.", "title": "Conversation Id"}, "invoice_ids": {"description": "Invoices the message was matched to.", "items": {"format": "uuid", "type": "string"}, "title": "Invoice Ids", "type": "array"}, "message_id": {"description": "The message; read it with `GET /public/messages/{message_id}`.", "format": "uuid", "title": "Message Id", "type": "string"}, "received_at": {"description": "When the message was received.", "format": "date-time", "title": "Received At", "type": "string"}, "sender_email": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Sender address, when known.", "title": "Sender Email"}, "subject": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Email subject line, when present.", "title": "Subject"}, "text_preview": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Short plain-text excerpt of the body, when present.", "title": "Text Preview"}}, "required": ["message_id", "conversation_id", "received_at", "sender_email", "subject", "text_preview", "attachments", "invoice_ids"], "title": "MessageReceivedData", "type": "object"}, "MessageReceivedEvent": {"additionalProperties": false, "description": "`message.received`: An inbound email reached the organization's messaging inbox.", "properties": {"created_at": {"description": "When the event entered the event log. The `created_at_from`/`created_at_to` filters and the 30-day retention window apply to it.", "format": "date-time", "title": "Created At", "type": "string"}, "data": {"$ref": "#/components/schemas/MessageReceivedData", "description": "The event's payload, typed by `type`."}, "id": {"description": "Event id; the same value as the `Relvo-Event-Id` header of every delivery of this event. Use it to deduplicate.", "format": "uuid", "title": "Id", "type": "string"}, "occurred_at": {"description": "When the change happened in Relvo.", "format": "date-time", "title": "Occurred At", "type": "string"}, "organization_id": {"description": "The organization the event belongs to.", "format": "uuid", "title": "Organization Id", "type": "string"}, "schema_version": {"description": "Version of this event type's `data` schema.", "minimum": 1.0, "title": "Schema Version", "type": "integer"}, "type": {"const": "message.received", "description": "The event type.", "title": "Type", "type": "string"}}, "required": ["id", "schema_version", "occurred_at", "organization_id", "created_at", "type", "data"], "title": "MessageReceivedEvent", "type": "object"}, "MetricAggregation": {"additionalProperties": false, "description": "How the metric's matching events are combined into one quantity per billing period.", "properties": {"method": {"$ref": "#/components/schemas/AggregationMethod", "description": "Aggregation applied to the matching events.", "examples": ["sum"]}, "property": {"anyOf": [{"maxLength": 255, "minLength": 1, "pattern": "^[A-Za-z0-9_]+$", "type": "string"}, {"type": "null"}], "description": "Key inside the event's `properties` whose values are aggregated. Required for every method except `count`.", "examples": ["tokens"], "title": "Property"}, "property_type": {"anyOf": [{"$ref": "#/components/schemas/UsageEntryPropertyType"}, {"type": "null"}], "description": "Data type of `property`. Required for every method except `count`; `unique_count` accepts `decimal` or `string`, the others need `decimal`.", "examples": ["decimal"]}}, "required": ["method"], "title": "MetricAggregation", "type": "object"}, "MetricDefinition": {"additionalProperties": false, "description": "Structured definition of a guided metric: which events it reads and how it combines them.", "properties": {"aggregation": {"$ref": "#/components/schemas/MetricAggregation", "description": "How the matching events are combined into one quantity."}, "event_name": {"description": "Name of the usage events this metric reads. Other events are ignored.", "examples": ["api_request"], "maxLength": 255, "minLength": 1, "pattern": "^\\S+$", "title": "Event Name", "type": "string"}, "schema_version": {"const": 1, "default": 1, "description": "Version of this definition format. Always `1`.", "examples": [1], "title": "Schema Version", "type": "integer"}}, "required": ["event_name", "aggregation"], "title": "MetricDefinition", "type": "object"}, "MoneyRangeReport": {"additionalProperties": false, "description": "An amount accumulated over an inclusive date range.", "properties": {"date_from": {"description": "First day of the range (inclusive).", "examples": ["2026-01-01"], "format": "date", "title": "Date From", "type": "string"}, "date_to": {"description": "Last day of the range (inclusive).", "examples": ["2026-01-31"], "format": "date", "title": "Date To", "type": "string"}, "value": {"$ref": "#/components/schemas/ReportMoney", "description": "The amount over the range."}}, "required": ["date_from", "date_to", "value"], "title": "MoneyRangeReport", "type": "object"}, "MoneySnapshotReport": {"additionalProperties": false, "description": "An amount measured at the end of one calendar day.", "properties": {"as_of": {"description": "Calendar day the snapshot is taken at (end of day).", "examples": ["2026-01-31"], "format": "date", "title": "As Of", "type": "string"}, "value": {"$ref": "#/components/schemas/ReportMoney", "description": "The amount on that day."}}, "required": ["as_of", "value"], "title": "MoneySnapshotReport", "type": "object"}, "NewBillableMetricFilter": {"additionalProperties": false, "description": "A dimensional filter to create: an event property key and its allowed values.", "properties": {"key": {"description": "Key inside the usage event's `properties` to filter on.", "examples": ["region"], "maxLength": 255, "minLength": 1, "pattern": "^[a-zA-Z0-9_]+$", "title": "Key", "type": "string"}, "values": {"description": "Values of `key` that prices can target separately.", "examples": [["us", "eu"]], "items": {"type": "string"}, "minItems": 1, "title": "Values", "type": "array"}}, "required": ["key", "values"], "title": "NewBillableMetricFilter", "type": "object"}, "PackagePricing": {"additionalProperties": false, "description": "Usage sold in blocks of `package_size`.\n\nWithout `overage_unit_amount`, the billable quantity is rounded up to whole packages\n(1 to 1000 units with a package size of 1000 bill one package). With it, the first\npackage is billed once and every unit beyond it is billed at `overage_unit_amount`.", "properties": {"amount": {"description": "Price of one package, in the price's currency.", "examples": ["50000.00"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Amount", "type": "string"}, "free_units": {"default": 0, "description": "Units per period deducted before packages are counted. `0` for none.", "examples": [0], "minimum": 0.0, "title": "Free Units", "type": "integer"}, "model": {"const": "package", "description": "Pricing model discriminator; always `package` for this object.", "title": "Model", "type": "string"}, "overage_unit_amount": {"anyOf": [{"description": "Non-negative decimal amount as a string, e.g. `\"1000\"` or `\"10.50\"`.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "type": "string"}, {"type": "null"}], "description": "Per-unit price for units beyond the first package. Null bills every started package in full instead.", "examples": ["45.00"], "title": "Overage Unit Amount"}, "package_size": {"description": "Number of units one package covers.", "examples": [1000], "exclusiveMinimum": 0.0, "title": "Package Size", "type": "integer"}, "pricing_group_keys": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "description": "Usage prices only. Billable-metric filter keys the metered quantity is grouped by; each distinct combination of values is priced on its own. Null prices the whole quantity together.", "examples": [["region"]], "title": "Pricing Group Keys"}}, "required": ["model", "amount", "package_size"], "title": "PackagePricing", "type": "object"}, "ParsedCommercialReference": {"additionalProperties": false, "description": "A commercial reference, such as a purchase order, read automatically from an inbound\nemail or its attachment and proposed for review.", "properties": {"attachment_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Attachment it was parsed from; null when parsed from the email body.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a60"], "title": "Attachment Id"}, "buyer_legal_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Buyer (counterparty) legal name as extracted; null when not found.", "examples": ["Comercial Andes SpA"], "title": "Buyer Legal Name"}, "candidate_invoice_ids": {"description": "Invoices the parser thinks this reference belongs to; may be empty.", "examples": [["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10"]], "items": {"format": "uuid", "type": "string"}, "title": "Candidate Invoice Ids", "type": "array"}, "commercial_reference_id": {"description": "Proposal id.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a80"], "format": "uuid", "title": "Commercial Reference Id", "type": "string"}, "created_at": {"description": "Instant the proposal was created.", "examples": ["2026-01-31T12:01:00Z"], "format": "date-time", "title": "Created At", "type": "string"}, "currency": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "ISO 4217 currency shared by net_amount and total_amount; null only when neither amount was extracted.", "examples": ["CLP"]}, "date": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Date printed on the reference (YYYY-MM-DD); null when not extracted.", "examples": ["2026-01-15"], "title": "Date"}, "extraction_run_id": {"description": "Parser run that produced the proposal.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a81"], "format": "uuid", "title": "Extraction Run Id", "type": "string"}, "fx_rate": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Decimal string. Exchange rate printed on the document, if any; null when not extracted.", "examples": ["950.12"], "title": "Fx Rate"}, "kind": {"$ref": "#/components/schemas/CommercialReferenceKind", "description": "Kind of document the reference cites.", "examples": ["purchase_order"]}, "message_id": {"description": "Inbound message the proposal was parsed from.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a61"], "format": "uuid", "title": "Message Id", "type": "string"}, "net_amount": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Decimal string. Tax-exclusive amount in `currency`; null when not extracted.", "examples": ["1250000"], "title": "Net Amount"}, "number": {"description": "Reference number as extracted.", "examples": ["OC-4500123456"], "title": "Number", "type": "string"}, "parse_status": {"$ref": "#/components/schemas/CommercialReferenceParseStatus", "description": "Reading status. Only `needs_review` proposals can be accepted or rejected via `POST /public/commercial-references/parsed/{id}/accept|reject`.", "examples": ["needs_review"]}, "provenance": {"$ref": "#/components/schemas/ParsedCommercialReferenceProvenance", "description": "AI decision metadata: model build, confidence and reasoning."}, "reference_description": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Free-text description extracted with the reference; null when none.", "examples": ["Servicios de consultoria enero 2026"], "title": "Reference Description"}, "source_commercial_reference_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Earlier proposal this one was derived from; null when none.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a82"], "title": "Source Commercial Reference Id"}, "tin": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Buyer tax id in canonical form (Chile: RUT without dots, e.g. `76086428-5`).", "examples": ["76086428-5"], "title": "Tin"}, "tin_country": {"anyOf": [{"pattern": "^[A-Z]{2}$", "type": "string"}, {"type": "null"}], "description": "ISO 3166-1 alpha-2 country of `tin`; null when unknown.", "examples": ["CL"], "title": "Tin Country"}, "total_amount": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Decimal string. Tax-inclusive amount in `currency`; null when not extracted.", "examples": ["1487500"], "title": "Total Amount"}, "updated_at": {"description": "Instant the proposal last changed.", "examples": ["2026-01-31T12:01:30Z"], "format": "date-time", "title": "Updated At", "type": "string"}, "version": {"description": "OCC version; also the `ETag`. Send it back as `If-Match` on actions.", "examples": [1], "minimum": 1.0, "title": "Version", "type": "integer"}, "warnings": {"description": "Parser and guardrail warnings; empty when none.", "items": {"$ref": "#/components/schemas/ParsedCommercialReferenceWarning"}, "title": "Warnings", "type": "array"}}, "required": ["commercial_reference_id", "kind", "number", "date", "reference_description", "net_amount", "total_amount", "currency", "fx_rate", "buyer_legal_name", "tin", "tin_country", "message_id", "attachment_id", "extraction_run_id", "source_commercial_reference_id", "candidate_invoice_ids", "warnings", "provenance", "parse_status", "version", "created_at", "updated_at"], "title": "ParsedCommercialReference", "type": "object"}, "ParsedCommercialReferenceAgent": {"additionalProperties": false, "description": "The AI agent build that produced the extraction.", "properties": {"agent_version": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Agent version.", "examples": ["1.4.0"], "title": "Agent Version"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Agent name.", "examples": ["commercial_reference_parser"], "title": "Name"}, "prompt_version": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Prompt version.", "examples": ["2026-09-01"], "title": "Prompt Version"}, "schema_version": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Output schema version.", "examples": ["3"], "title": "Schema Version"}}, "required": ["name", "agent_version", "prompt_version", "schema_version"], "title": "ParsedCommercialReferenceAgent", "type": "object"}, "ParsedCommercialReferencePage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/ParsedCommercialReference"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[ParsedCommercialReference]", "type": "object"}, "ParsedCommercialReferenceProvenance": {"additionalProperties": false, "description": "AI decision metadata for the extraction (model, confidence, reasoning).", "properties": {"agent": {"anyOf": [{"$ref": "#/components/schemas/ParsedCommercialReferenceAgent"}, {"type": "null"}], "description": "Agent build that produced the extraction; null when unknown."}, "confidence": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Decimal string in [0, 1]. The model's own confidence; null when not given.", "examples": ["0.72"], "title": "Confidence"}, "parse_status_decision": {"anyOf": [{"$ref": "#/components/schemas/ParsedCommercialReferenceStatusDecision"}, {"type": "null"}], "description": "Why the proposal received its status; null for older proposals."}, "reasoning_trace": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "The model's account of the extraction, for reviewers; null when none.", "examples": ["The attached PDF is a purchase order; its number appears in the header."], "title": "Reasoning Trace"}, "reference_role": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Role of this reference in the document: `primary_document`, `linked_reference` or `coequal_reference`; null when not determined.", "examples": ["primary_document"], "title": "Reference Role"}}, "required": ["confidence", "reasoning_trace", "agent", "reference_role", "parse_status_decision"], "title": "ParsedCommercialReferenceProvenance", "type": "object"}, "ParsedCommercialReferenceStatusDecision": {"additionalProperties": false, "description": "Why the parser assigned the proposal its `parse_status`.", "properties": {"confidence_band": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "How the model's confidence compares with the threshold, e.g. `at_or_above_threshold` or `below_threshold`.", "examples": ["below_threshold"], "title": "Confidence Band"}, "confidence_threshold": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Decimal string. Confidence needed for automatic acceptance.", "examples": ["0.85"], "title": "Confidence Threshold"}, "policy_version": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Version of the status policy applied.", "examples": ["1"], "title": "Policy Version"}, "reasons": {"description": "Stable reason codes behind the decision.", "examples": [["low_confidence"]], "items": {"type": "string"}, "title": "Reasons", "type": "array"}, "status": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Status the policy decided.", "examples": ["needs_review"], "title": "Status"}}, "required": ["status", "confidence_band", "confidence_threshold", "reasons", "policy_version"], "title": "ParsedCommercialReferenceStatusDecision", "type": "object"}, "ParsedCommercialReferenceWarning": {"additionalProperties": false, "description": "One parser or guardrail warning attached to a proposal.", "properties": {"code": {"description": "Stable warning code, e.g. `invalid_tin`, `invalid_tin_country`, `partial_source_failure`, `no_processable_source`, `fx_rate_unverifiable`. New codes may be added; treat unknown codes as informational.", "examples": ["invalid_tin"], "title": "Code", "type": "string"}, "context": {"additionalProperties": {"type": "string"}, "description": "Guardrail context as string key/value pairs; empty when none.", "examples": [{"tin": "76086428-4"}], "title": "Context", "type": "object"}, "count": {"anyOf": [{"type": "integer"}, {"type": "null"}], "description": "How many sources the warning covers, when the code counts them; else null.", "examples": [2], "title": "Count"}, "informational": {"description": "True when a check could not run as specified (e.g. `fx_rate_unverifiable`); shown as information, never as a block.", "examples": [false], "title": "Informational", "type": "boolean"}}, "required": ["code", "informational", "count", "context"], "title": "ParsedCommercialReferenceWarning", "type": "object"}, "PauseContractRequest": {"additionalProperties": false, "description": "Pause an active contract. ``billing_behavior`` defaults to ``hold_unbilled``.", "properties": {"billing_behavior": {"$ref": "#/components/schemas/ContractPauseBillingBehavior", "default": "hold_unbilled", "description": "Whether to invoice service delivered up to the pause right away.", "examples": ["hold_unbilled"]}, "effective_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When the pause takes effect. Defaults to now.", "examples": ["2026-05-01T00:00:00Z"], "title": "Effective At"}, "reason": {"anyOf": [{"maxLength": 2000, "type": "string"}, {"type": "null"}], "description": "Why the contract is being paused.", "examples": ["Customer requested a temporary hold."], "title": "Reason"}}, "title": "PauseContractRequest", "type": "object"}, "Payment": {"additionalProperties": false, "description": "Money a customer paid, and how it was applied to invoices.", "properties": {"allocations": {"description": "Where the payment was applied, one entry per invoice, ordered by invoice id.", "items": {"$ref": "#/components/schemas/PaymentAllocation"}, "title": "Allocations", "type": "array"}, "amount": {"description": "Amount received, in `currency`, as an exact decimal string.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Amount", "type": "string"}, "applied_amount": {"description": "Sum of `allocations[].amount`: how much of the payment settles invoices.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Applied Amount", "type": "string"}, "created_at": {"description": "When the payment was recorded in Relvo.", "format": "date-time", "title": "Created At", "type": "string"}, "currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency of every amount on the payment.", "examples": ["CLP"]}, "customer_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "The paying customer. `null` for a payment not yet attributed to a customer, for example a bank receipt still under review.", "title": "Customer Id"}, "external_reference": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "The payment processor's transaction id when `origin` is `payment_provider`; otherwise `null`.", "title": "External Reference"}, "id": {"description": "Payment ID.", "format": "uuid", "title": "Id", "type": "string"}, "origin": {"$ref": "#/components/schemas/PaymentOrigin", "description": "How the payment reached Relvo."}, "payment_method_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "The payment method the customer paid through, when known.", "title": "Payment Method Id"}, "received_at": {"description": "When the money was received.", "format": "date-time", "title": "Received At", "type": "string"}, "reversed_amount": {"description": "Amount returned to the payer afterwards (refunds and chargebacks).", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Reversed Amount", "type": "string"}, "status": {"$ref": "#/components/schemas/PaymentState", "description": "Lifecycle state.", "examples": ["succeeded"]}, "updated_at": {"description": "Last change to the payment, its allocations, or their reversals. Use it with the list's `updated_since` filter to sync incrementally.", "format": "date-time", "title": "Updated At", "type": "string"}}, "required": ["id", "customer_id", "amount", "currency", "status", "origin", "payment_method_id", "external_reference", "applied_amount", "reversed_amount", "allocations", "received_at", "created_at", "updated_at"], "title": "Payment", "type": "object"}, "PaymentAllocation": {"additionalProperties": false, "description": "The part of a payment applied to one invoice, net of any reversed application.", "properties": {"amount": {"description": "Amount applied to the invoice, in the payment's `currency`, as an exact decimal string. Always greater than zero: an application reversed in full is omitted.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Amount", "type": "string"}, "invoice_id": {"description": "The invoice this part of the payment settles.", "format": "uuid", "title": "Invoice Id", "type": "string"}}, "required": ["invoice_id", "amount"], "title": "PaymentAllocation", "type": "object"}, "PaymentMethod": {"additionalProperties": false, "description": "A way your organization collects payments, such as a bank transfer or a provider\ncheckout, that can be assigned to customers' billing entities.", "example": {"bank_account_id": "01909e26-9a11-7c3e-8b1a-2f4e6d8a1c3b", "created_at": "2026-07-01T09:15:00.000Z", "id": "01909e26-9a10-7c3e-8b1a-2f4e6d8a1c3b", "instructions_remainder": "Enviar comprobante a pagos@acme.cl", "is_active": true, "is_new_billing_account_default": false, "is_organization_default": true, "kind": "bank_transfer", "name": "Transferencia Banco de Chile", "supported_countries": ["CL"], "supported_currencies": ["CLP"], "updated_at": "2026-07-01T09:15:00.000Z", "version": 1}, "properties": {"bank_account_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Bank account whose details are shown to payers. Null when none is linked.", "examples": ["01909e26-9a11-7c3e-8b1a-2f4e6d8a1c3b"], "title": "Bank Account Id"}, "created_at": {"description": "When the resource was created (UTC, RFC 3339).", "examples": ["2026-07-01T09:15:00.000Z"], "format": "date-time", "title": "Created At", "type": "string"}, "id": {"description": "Unique identifier of the payment method.", "examples": ["01909e26-9a10-7c3e-8b1a-2f4e6d8a1c3b"], "format": "uuid", "title": "Id", "type": "string"}, "instructions_remainder": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Text shown after the linked bank account's details.", "examples": ["Enviar comprobante a pagos@acme.cl"], "title": "Instructions Remainder"}, "is_active": {"description": "Whether the method can be used. Inactive methods are never resolved.", "examples": [true], "title": "Is Active", "type": "boolean"}, "is_new_billing_account_default": {"description": "Whether this method is assigned as the default to billing entities created from now on. It never changes existing billing entities.", "examples": [false], "title": "Is New Billing Account Default", "type": "boolean"}, "is_organization_default": {"description": "Whether this is the fallback method for billing entities without a default of their own. It must be a `bank_transfer` with a bank account and no provider.", "examples": [true], "title": "Is Organization Default", "type": "boolean"}, "kind": {"$ref": "#/components/schemas/PaymentMethodKind", "description": "How the payer pays.", "examples": ["bank_transfer"]}, "name": {"description": "Name of the method, shown to your team and to payers.", "examples": ["Transferencia Banco de Chile"], "title": "Name", "type": "string"}, "payment_instructions": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Free-text instructions shown to the payer. Null when not set.", "examples": ["Pay by transfer to account 123456789, Banco de Chile."], "title": "Payment Instructions"}, "provider": {"anyOf": [{"$ref": "#/components/schemas/CollectionProvider"}, {"type": "null"}], "description": "Who executes the collection. Null when not set.", "examples": [null]}, "provider_connection_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Your integration connection to the external provider. Null for methods that need no provider.", "examples": ["01909e26-9a12-7c3e-8b1a-2f4e6d8a1c3b"], "title": "Provider Connection Id"}, "provider_method_reference": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "The provider's own identifier for this method. Null when not set.", "examples": ["pm_1Nv8Xq2eZvKYlo2C"], "title": "Provider Method Reference"}, "supported_countries": {"description": "ISO 3166-1 alpha-2 codes. Empty means any country.", "examples": [["CL"]], "items": {"$ref": "#/components/schemas/CountryEnum"}, "title": "Supported Countries", "type": "array"}, "supported_currencies": {"description": "ISO 4217 codes. Empty means any currency.", "examples": [["CLP"]], "items": {"$ref": "#/components/schemas/CurrencyCodeEnum"}, "title": "Supported Currencies", "type": "array"}, "updated_at": {"description": "When the resource was last changed (UTC, RFC 3339).", "examples": ["2026-07-01T09:15:00.000Z"], "format": "date-time", "title": "Updated At", "type": "string"}, "version": {"description": "Version of the payment method, incremented on every change. Equals the `ETag` header; send it as `If-Match` when updating.", "examples": [1], "title": "Version", "type": "integer"}}, "required": ["created_at", "updated_at", "id", "name", "kind", "supported_currencies", "supported_countries", "payment_instructions", "instructions_remainder", "provider", "provider_connection_id", "provider_method_reference", "bank_account_id", "is_active", "is_organization_default", "is_new_billing_account_default", "version"], "title": "PaymentMethod", "type": "object"}, "PaymentMethodCreateRequest": {"additionalProperties": false, "description": "Body of ``POST /payment-methods``.", "example": {"bank_account_id": "01909e26-9a11-7c3e-8b1a-2f4e6d8a1c3b", "kind": "bank_transfer", "name": "Transferencia Banco de Chile", "supported_countries": ["CL"], "supported_currencies": ["CLP"]}, "properties": {"bank_account_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Required for a `bank_transfer` collected by Relvo: the transfer details are rendered from this account, which must have a number, holder name and holder id, in a currency the method supports. Otherwise 422 with code `payments.payment_method.bank_account_required`, `..._incomplete` or `..._currency_unsupported`.", "examples": ["01909e26-9a11-7c3e-8b1a-2f4e6d8a1c3b"], "title": "Bank Account Id"}, "instructions_remainder": {"anyOf": [{"maxLength": 4000, "type": "string"}, {"type": "null"}], "description": "Text shown after the linked bank account's details, such as where to send the payment receipt.", "examples": ["Enviar comprobante a pagos@acme.cl"], "title": "Instructions Remainder"}, "kind": {"$ref": "#/components/schemas/PaymentMethodKind", "description": "How the payer pays. `payment_link` and `card` need an external `provider`; `offline` and `other` need `payment_instructions`.", "examples": ["bank_transfer"]}, "name": {"description": "Name of the method, shown to your team and to payers.", "examples": ["Transferencia Banco de Chile"], "maxLength": 200, "minLength": 1, "title": "Name", "type": "string"}, "payment_instructions": {"anyOf": [{"maxLength": 4000, "type": "string"}, {"type": "null"}], "description": "Free-text instructions shown to the payer. Required when there is no bank account or provider to describe how to pay.", "examples": ["Pay by transfer to account 123456789, Banco de Chile."], "title": "Payment Instructions"}, "provider": {"anyOf": [{"$ref": "#/components/schemas/CollectionProvider"}, {"type": "null"}], "description": "Who executes the collection. Cannot be changed later.", "examples": ["relvo"]}, "provider_connection_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Your integration connection to the provider. Required for an external provider.", "examples": ["01909e26-9a12-7c3e-8b1a-2f4e6d8a1c3b"], "title": "Provider Connection Id"}, "provider_method_reference": {"anyOf": [{"maxLength": 256, "type": "string"}, {"type": "null"}], "description": "The provider's own identifier for this method, if it has one.", "examples": ["pm_1Nv8Xq2eZvKYlo2C"], "title": "Provider Method Reference"}, "supported_countries": {"description": "ISO 3166-1 alpha-2 codes, case-insensitive. Empty means any.", "examples": [["CL"]], "items": {"$ref": "#/components/schemas/CountryEnum"}, "title": "Supported Countries", "type": "array"}, "supported_currencies": {"description": "ISO 4217 codes, case-insensitive. Empty means any.", "examples": [["CLP"]], "items": {"$ref": "#/components/schemas/CurrencyCodeEnum"}, "title": "Supported Currencies", "type": "array"}}, "required": ["name", "kind"], "title": "PaymentMethodCreateRequest", "type": "object"}, "PaymentMethodKind": {"description": "How the payer pays.\n\n- `bank_transfer`: the payer sends a bank transfer, to a linked bank account or following\n  written instructions.\n- `payment_link`: the payer pays through a checkout link from an external provider.\n- `card`: the payer is charged on a card through an external provider.\n- `offline`: the payer pays outside any system (for example cash or check), following\n  written instructions.\n- `other`: any other method, described by written instructions.", "enum": ["bank_transfer", "payment_link", "card", "offline", "other"], "title": "PaymentMethodKind", "type": "string"}, "PaymentMethodPage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/PaymentMethod"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[PaymentMethod]", "type": "object"}, "PaymentMethodResolutionKind": {"description": "Where the resolved payment method came from.\n\n- `customer_default`: the billing entity's own default payment method, which is usable.\n- `customer_default_invalid`: the billing entity has a default, but it cannot be used;\n  `reason` says why. No fallback method is chosen.\n- `transfer_route`: a bank-transfer method selected from the payer's country and currency.\n- `organization_default`: the organization's fallback method.\n- `none`: no payment method could be resolved.", "enum": ["customer_default", "customer_default_invalid", "transfer_route", "organization_default", "none"], "title": "PaymentMethodResolutionKind", "type": "string"}, "PaymentMethodUnusableReason": {"description": "Why a candidate payment method could not be used.\n\n- `payment_method_inactive`: the payment method is deactivated.\n- `provider_incompatible`: the method belongs to an external provider other than the one\n  that collects from this billing entity.\n- `bank_account_inactive`: the linked bank account is deactivated.\n- `provider_connection_unusable`: the integration connection to the provider is missing\n  or not working.\n- `currency_unsupported`: the method does not support the billing currency.\n- `country_unsupported`: the method does not support the payer's country.\n- `transfer_route_method_missing`: a transfer route matched, but its payment method is\n  unavailable.", "enum": ["payment_method_inactive", "provider_incompatible", "bank_account_inactive", "provider_connection_unusable", "currency_unsupported", "country_unsupported", "transfer_route_method_missing"], "title": "PaymentMethodUnusableReason", "type": "string"}, "PaymentMethodUpdateRequest": {"additionalProperties": false, "description": "Body of ``PATCH /payment-methods/{payment_method_id}``.\n\nOmitted fields are left unchanged. ``kind`` and ``provider`` cannot change.\nNullable fields (``payment_instructions``, ``instructions_remainder``,\n``bank_account_id``, ``provider_method_reference``) are cleared by ``null``.", "example": {"name": "Transferencia BCI"}, "properties": {"bank_account_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Linked bank account. Omit to keep it; `null` unlinks it.", "examples": ["01909e26-9a11-7c3e-8b1a-2f4e6d8a1c3b"], "title": "Bank Account Id"}, "instructions_remainder": {"anyOf": [{"maxLength": 4000, "type": "string"}, {"type": "null"}], "description": "Text shown after the bank account's details. Omit to keep it; `null` clears it.", "examples": ["Enviar comprobante a pagos@acme.cl"], "title": "Instructions Remainder"}, "name": {"anyOf": [{"maxLength": 200, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "New name. Omit to keep it; it cannot be null.", "examples": ["Transferencia BCI"], "title": "Name"}, "payment_instructions": {"anyOf": [{"maxLength": 4000, "type": "string"}, {"type": "null"}], "description": "Instructions shown to the payer. Omit to keep them; `null` clears them.", "examples": ["Pay by transfer to account 123456789, Banco de Chile."], "title": "Payment Instructions"}, "provider_method_reference": {"anyOf": [{"maxLength": 256, "type": "string"}, {"type": "null"}], "description": "The provider's identifier for this method. Omit to keep it; `null` clears it.", "examples": ["pm_1Nv8Xq2eZvKYlo2C"], "title": "Provider Method Reference"}, "supported_countries": {"anyOf": [{"items": {"$ref": "#/components/schemas/CountryEnum"}, "type": "array"}, {"type": "null"}], "description": "Replaces the supported ISO 3166-1 alpha-2 codes; `[]` means any. Omit to keep them; it cannot be null.", "examples": [["CL"]], "title": "Supported Countries"}, "supported_currencies": {"anyOf": [{"items": {"$ref": "#/components/schemas/CurrencyCodeEnum"}, "type": "array"}, {"type": "null"}], "description": "Replaces the supported ISO 4217 codes; `[]` means any. Omit to keep them; it cannot be null.", "examples": [["CLP", "USD"]], "title": "Supported Currencies"}}, "title": "PaymentMethodUpdateRequest", "type": "object"}, "PaymentOrigin": {"description": "How the payment reached Relvo.\n\n- `manual`: recorded by your team.\n- `bank_transfer`: matched from a bank-statement movement.\n- `point_of_sale`: received through a point-of-sale terminal.\n- `payment_provider`: settled by an integrated payment processor; on a `Payment`,\n  `external_reference` carries the processor's transaction id.", "enum": ["manual", "bank_transfer", "point_of_sale", "payment_provider"], "title": "PaymentOrigin", "type": "string"}, "PaymentPage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/Payment"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PaymentPage", "type": "object"}, "PaymentState": {"description": "Where the payment is in its lifecycle.\n\n- `pending`: recorded but not yet confirmed as received.\n- `succeeded`: the money was received; only succeeded payments settle invoices.\n- `failed`: the payment did not go through.\n- `voided`: the payment was annulled after being recorded; its allocations no longer\n  count.", "enum": ["pending", "succeeded", "failed", "voided"], "title": "PaymentState", "type": "string"}, "PaymentSucceededData": {"additionalProperties": false, "description": "A payment was confirmed as received.\n\nIt may not be applied to any invoice yet: allocations follow as\n`invoice.payment_received` events, one per invoice the payment settles.", "properties": {"amount": {"description": "Amount received, as a decimal string.", "pattern": "^\\d+(\\.\\d+)?$", "title": "Amount", "type": "string"}, "currency": {"description": "ISO 4217 currency code of the amount, uppercase.", "pattern": "^[A-Z]{3}$", "title": "Currency", "type": "string"}, "customer_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "The paying customer, or `null` while the payment is not yet attributed to one.", "title": "Customer Id"}, "origin": {"$ref": "#/components/schemas/PaymentOrigin"}, "payment_id": {"description": "The payment; read it with `GET /public/payments/{payment_id}`.", "format": "uuid", "title": "Payment Id", "type": "string"}}, "required": ["payment_id", "customer_id", "amount", "currency", "origin"], "title": "PaymentSucceededData", "type": "object"}, "PaymentSucceededEvent": {"additionalProperties": false, "description": "`payment.succeeded`: A payment was confirmed as received. It may not be applied to an invoice yet; each application sends `invoice.payment_received`.", "properties": {"created_at": {"description": "When the event entered the event log. The `created_at_from`/`created_at_to` filters and the 30-day retention window apply to it.", "format": "date-time", "title": "Created At", "type": "string"}, "data": {"$ref": "#/components/schemas/PaymentSucceededData", "description": "The event's payload, typed by `type`."}, "id": {"description": "Event id; the same value as the `Relvo-Event-Id` header of every delivery of this event. Use it to deduplicate.", "format": "uuid", "title": "Id", "type": "string"}, "occurred_at": {"description": "When the change happened in Relvo.", "format": "date-time", "title": "Occurred At", "type": "string"}, "organization_id": {"description": "The organization the event belongs to.", "format": "uuid", "title": "Organization Id", "type": "string"}, "schema_version": {"description": "Version of this event type's `data` schema.", "minimum": 1.0, "title": "Schema Version", "type": "integer"}, "type": {"const": "payment.succeeded", "description": "The event type.", "title": "Type", "type": "string"}}, "required": ["id", "schema_version", "occurred_at", "organization_id", "created_at", "type", "data"], "title": "PaymentSucceededEvent", "type": "object"}, "PaymentTermsType": {"description": "`due_on_receipt` is due on issue; `net` is due `payment_terms_days` after issue.", "enum": ["due_on_receipt", "net"], "title": "PaymentTermsType", "type": "string"}, "PercentageDiscount": {"additionalProperties": false, "description": "Percentage reduction of the discounted prices' billed amount.", "properties": {"discount_type": {"const": "percentage", "description": "Always `percentage` for a percentage discount.", "examples": ["percentage"], "title": "Discount Type", "type": "string"}, "name": {"description": "Name of the discount, used as its invoice label unless overridden.", "examples": ["Launch discount"], "maxLength": 255, "minLength": 1, "title": "Name", "type": "string"}, "name_on_invoice": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Overrides the discount's invoice label. Null uses `name`. Invoice line label. May use `{{month}}`, `{{year}}` and `{{service_period}}`. Service periods render as dd/mm/yyyy - dd/mm/yyyy, with disjoint ranges separated by '; '. Referencing service_period requires complete service dates; unresolved or overlong output is rejected. Month/year are substituted from the line's billing period (e.g. `\"saas bulk {{month}} {{year}}\"` prints `\"saas bulk agosto 2026\"`). Any other variable is rejected.", "title": "Name On Invoice"}, "percentage": {"description": "Percentage deducted, where `\"10\"` means 10%.", "examples": ["10"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Percentage", "type": "string"}, "restrict_to_amount_selector": {"anyOf": [{"maxLength": 100, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Key of the amount selector whose selected amount this discount applies to. Set either this or `restrict_to_prices`, not both.", "examples": ["platform_fee_floor"], "title": "Restrict To Amount Selector"}, "restrict_to_prices": {"anyOf": [{"items": {"format": "uuid", "type": "string"}, "maxItems": 50, "minItems": 1, "type": "array"}, {"type": "null"}], "description": "Ids of the phase prices this discount applies to. Set either this or `restrict_to_amount_selector`, not both.", "title": "Restrict To Prices"}, "separate_invoice_line": {"default": false, "description": "True shows the discount as its own negative invoice line; false folds it into the discounted line's amount.", "title": "Separate Invoice Line", "type": "boolean"}}, "required": ["name", "discount_type", "percentage"], "title": "PercentageDiscount", "type": "object"}, "PercentagePricing": {"additionalProperties": false, "description": "A percentage of the metered amount, plus an optional fee per billable event.\n\nTypical use: a fee on transaction volume (for example 1.5% of GMV). When a\nper-transaction minimum or maximum is set, every event is priced on its own and\nclamped to those bounds before the period total is added up.", "properties": {"fixed_amount": {"anyOf": [{"description": "Non-negative decimal amount as a string, e.g. `\"1000\"` or `\"10.50\"`.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "type": "string"}, {"type": "null"}], "description": "Flat fee added per billable event, in the price's currency. Null for none.", "examples": ["100"], "title": "Fixed Amount"}, "free_units_per_events": {"anyOf": [{"exclusiveMinimum": 0.0, "type": "integer"}, {"type": "null"}], "description": "Number of events per period that are not billed at all, counted in order from the start of the period. Null for none.", "examples": [10], "title": "Free Units Per Events"}, "free_units_per_total_aggregation": {"anyOf": [{"description": "Non-negative decimal amount as a string, e.g. `\"1000\"` or `\"10.50\"`.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "type": "string"}, {"type": "null"}], "description": "Portion of the period's metered amount that is exempt from the `rate`, used up by events in order. Null for none.", "examples": ["1000000"], "title": "Free Units Per Total Aggregation"}, "model": {"const": "percentage", "description": "Pricing model discriminator; always `percentage` for this object.", "title": "Model", "type": "string"}, "per_transaction_max_amount": {"anyOf": [{"description": "Non-negative decimal amount as a string, e.g. `\"1000\"` or `\"10.50\"`.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "type": "string"}, {"type": "null"}], "description": "Maximum fee charged for each billable event, in the price's currency; above 0. Null for no maximum.", "examples": ["5000"], "title": "Per Transaction Max Amount"}, "per_transaction_min_amount": {"anyOf": [{"description": "Non-negative decimal amount as a string, e.g. `\"1000\"` or `\"10.50\"`.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "type": "string"}, {"type": "null"}], "description": "Minimum fee charged for each billable event, in the price's currency. Null for no minimum.", "examples": ["200"], "title": "Per Transaction Min Amount"}, "pricing_group_keys": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "description": "Usage prices only. Billable-metric filter keys the metered quantity is grouped by; each distinct combination of values is priced on its own. Null prices the whole quantity together.", "examples": [["region"]], "title": "Pricing Group Keys"}, "rate": {"description": "Percentage; `\"1.5\"` means 1.5%. Above 0, at most 100.", "examples": ["1.5"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Rate", "type": "string"}}, "required": ["model", "rate"], "title": "PercentagePricing", "type": "object"}, "PercentageTier": {"additionalProperties": false, "description": "One tier of a graduated-percentage price: covers `from < quantity <= up_to`.", "properties": {"flat_amount": {"description": "Amount added once when this tier applies. `\"0\"` for none.", "examples": ["0"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Flat Amount", "type": "string"}, "from": {"description": "The tier covers quantities above this value. `0` (or `free_units`) for the first tier; the previous tier's `up_to` otherwise.", "examples": [0], "minimum": 0.0, "title": "From", "type": "integer"}, "rate": {"description": "Percentage applied to the units in this tier; `\"1.5\"` means 1.5%.", "examples": ["1.5"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Rate", "type": "string"}, "up_to": {"anyOf": [{"type": "integer"}, {"type": "null"}], "description": "Last quantity the tier covers, inclusive. `null` marks the final, open-ended tier and is required on it.", "examples": [1000], "title": "Up To"}}, "required": ["from", "up_to", "rate", "flat_amount"], "title": "PercentageTier", "type": "object"}, "PhaseCreditMoney": {"additionalProperties": false, "description": "Exact currency-denominated commercial amount in major units.", "properties": {"amount": {"description": "Exact decimal text, supporting ten fractional digits.", "maxLength": 4096, "minLength": 1, "pattern": "^-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?$", "title": "Amount", "type": "string"}, "currency": {"description": "ISO-4217 currency code.", "title": "Currency", "type": "string"}}, "required": ["amount", "currency"], "title": "PhaseCreditMoney", "type": "object"}, "PhaseCreditSchedule": {"additionalProperties": false, "description": "Phase commercial terms; refreshes materialize shared immutable financial allowances.", "properties": {"billing_entity_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Customer billing entity paying for the credit purchase; required when routing is ambiguous.", "title": "Billing Entity Id"}, "billing_frequency": {"description": "Purchase billing cadence; must cover whole allowance periods.", "enum": ["one_time", "monthly", "quarterly", "half_yearly", "yearly"], "title": "Billing Frequency", "type": "string"}, "face_value": {"description": "Credit entitlement per refresh, in currency or metric units.", "discriminator": {"mapping": {"metric": "#/components/schemas/PhaseMetricCredit", "money": "#/components/schemas/PhaseCurrencyCredit"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/components/schemas/PhaseCurrencyCredit"}, {"$ref": "#/components/schemas/PhaseMetricCredit"}], "title": "Face Value"}, "id": {"description": "Stable credit schedule ID, also the public grant resource ID.", "format": "uuid", "title": "Id", "type": "string"}, "integration_ids": {"description": "External accounting identifiers, unique per service.", "items": {"$ref": "#/components/schemas/IntegrationIdInput"}, "maxItems": 50, "title": "Integration Ids", "type": "array"}, "name": {"description": "Human-readable credit grant name.", "maxLength": 256, "minLength": 1, "title": "Name", "type": "string"}, "placement_keys": {"description": "Exact price placement restrictions; empty means all phase prices.", "items": {"type": "string"}, "maxItems": 50, "title": "Placement Keys", "type": "array"}, "purchase_item_id": {"description": "Catalog item used on the credit purchase invoice.", "format": "uuid", "title": "Purchase Item Id", "type": "string"}, "purchase_price": {"$ref": "#/components/schemas/PhaseCreditMoney", "description": "Commercial purchase cost, independently of credit entitlement."}, "refresh_frequency": {"description": "Allowance refresh cadence.", "enum": ["none", "monthly", "quarterly", "half_yearly", "yearly"], "title": "Refresh Frequency", "type": "string"}, "rollover_mode": {"description": "Unused unreserved capacity rollover policy.", "enum": ["none", "on_grant_refresh", "on_grant_refresh_and_phase"], "title": "Rollover Mode", "type": "string"}, "tax_rate_ids": {"description": "Tax rate applied to the purchase invoice, if any.", "items": {"format": "uuid", "type": "string"}, "maxItems": 1, "title": "Tax Rate Ids", "type": "array"}}, "required": ["id", "name", "face_value", "purchase_price", "refresh_frequency", "billing_frequency", "rollover_mode", "purchase_item_id"], "title": "PhaseCreditSchedule", "type": "object"}, "PhaseCurrencyCredit": {"additionalProperties": false, "description": "Currency-denominated phase entitlement.", "properties": {"kind": {"const": "money", "description": "Currency credit discriminator.", "title": "Kind", "type": "string"}, "money": {"$ref": "#/components/schemas/PhaseCreditMoney", "description": "Currency and exact entitlement."}}, "required": ["kind", "money"], "title": "PhaseCurrencyCredit", "type": "object"}, "PhaseMetricCredit": {"additionalProperties": false, "description": "Units of one billable metric.", "properties": {"kind": {"const": "metric", "description": "Metric credit discriminator.", "title": "Kind", "type": "string"}, "metric_id": {"description": "Billable metric whose usage consumes the entitlement.", "format": "uuid", "title": "Metric Id", "type": "string"}, "quantity": {"description": "Exact decimal quantity of metric units.", "maxLength": 4096, "minLength": 1, "pattern": "^-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?$", "title": "Quantity", "type": "string"}}, "required": ["kind", "metric_id", "quantity"], "title": "PhaseMetricCredit", "type": "object"}, "PhoneCountry": {"description": "Country whose numbering plan a phone number is parsed with, as an\nISO 3166-1 alpha-2 code.\n\nThe number is validated against that country's rules and stored in E.164\ninternational format. Only `CL` is supported today.", "enum": ["CL"], "title": "PhoneCountry", "type": "string"}, "PostalAddress": {"additionalProperties": false, "description": "A postal address, identical on input and output.", "example": {"city": "Santiago", "comuna": "Las Condes", "country": "CL", "district": "Las Condes", "line1": "Av. Apoquindo 4700", "line2": "Oficina 1201", "postal_code": "7550000", "state": "Región Metropolitana"}, "properties": {"city": {"description": "City or locality.", "examples": ["Santiago"], "minLength": 1, "title": "City", "type": "string"}, "comuna": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "deprecated": true, "description": "Deprecated alias of `district`, always emitted with the same value. On input, send `district`; sending both with different values is rejected.", "examples": ["Las Condes"], "title": "Comuna"}, "country": {"$ref": "#/components/schemas/CountryEnum", "description": "ISO 3166-1 alpha-2 country code, e.g. `CL`, `MX`, `US`.", "examples": ["CL"]}, "district": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "description": "District or municipality; in Chile, the *comuna*. Required on a billing profile address whose country is `CL`; null for other countries.", "examples": ["Las Condes"], "title": "District"}, "line1": {"description": "First address line: street name and number.", "examples": ["Av. Apoquindo 4700"], "minLength": 1, "title": "Line1", "type": "string"}, "line2": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Second address line (office, floor, apartment). Null when not needed.", "examples": ["Oficina 1201"], "title": "Line2"}, "postal_code": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "description": "Postal or ZIP code. Null when not provided; must not be empty when sent.", "examples": ["7550000"], "title": "Postal Code"}, "state": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "State, province or region. Null when not provided.", "examples": ["Región Metropolitana"], "title": "State"}}, "required": ["line1", "city", "country"], "title": "PostalAddress", "type": "object"}, "PreviewPriceFormulaRequest": {"additionalProperties": false, "description": "A formula expression and sample inputs to evaluate without creating a price.", "properties": {"currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency the result is rounded to.", "examples": ["USD"]}, "expression": {"description": "Arithmetic expression to evaluate, in the same syntax as a formula price.", "examples": ["max(100, calls * 0.2)"], "maxLength": 4096, "minLength": 1, "title": "Expression", "type": "string"}, "inputs": {"additionalProperties": {"description": "Non-negative decimal amount as a string, e.g. `\"1000\"` or `\"10.50\"`.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "type": "string"}, "description": "Expression variable name -> sample quantity (decimal string).", "examples": [{"calls": "1250"}], "maxProperties": 32, "minProperties": 1, "title": "Inputs", "type": "object"}, "language_version": {"const": 1, "description": "Version of the expression language. Only `1` is supported.", "examples": [1], "title": "Language Version", "type": "integer"}}, "required": ["expression", "language_version", "inputs", "currency"], "title": "PreviewPriceFormulaRequest", "type": "object"}, "PriceFormulaPreview": {"additionalProperties": false, "description": "The period total a formula expression produces for the sample inputs.", "properties": {"amount": {"description": "Period total, rounded to the currency's precision.", "examples": ["250.00"], "title": "Amount", "type": "string"}, "currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency of the amounts.", "examples": ["USD"]}, "unrounded_amount": {"description": "Period total before rounding, as a decimal string.", "examples": ["250.0"], "title": "Unrounded Amount", "type": "string"}}, "required": ["amount", "unrounded_amount", "currency"], "title": "PriceFormulaPreview", "type": "object"}, "PriceInterval": {"description": "How often a price recurs.\n\n* `one_time`: billed once, not recurring.\n* `weekly`, `monthly`, `quarterly`, `semiannual`, `yearly`: billed every week, month,\n  three months, six months or year respectively.", "enum": ["one_time", "weekly", "monthly", "quarterly", "semiannual", "yearly"], "title": "PriceInterval", "type": "string"}, "PriceLifecycleStatus": {"description": "The statuses a caller may set. `archived` is reachable only through `DELETE`.\n\n* `draft`: being prepared; cannot be added to a contract yet.\n* `active`: available to be used on contracts.", "enum": ["draft", "active"], "title": "PriceLifecycleStatus", "type": "string"}, "PricePage": {"additionalProperties": false, "description": "One page of prices, each a fixed, usage, or seat price told apart by `type`.\n\nTo fetch the next page, call the same endpoint with the same filters and pass\n`next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on the last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"discriminator": {"mapping": {"fixed": "#/components/schemas/FixedPrice", "seat": "#/components/schemas/SeatPrice", "usage": "#/components/schemas/UsagePrice"}, "propertyName": "type"}, "oneOf": [{"$ref": "#/components/schemas/FixedPrice"}, {"$ref": "#/components/schemas/UsagePrice"}, {"$ref": "#/components/schemas/SeatPrice"}]}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PricePage", "type": "object"}, "PriceStatus": {"description": "Lifecycle status of a price as read back.\n\n* `draft`: being prepared; cannot be added to a contract yet.\n* `active`: available to be used on contracts.\n* `archived`: retired with `DELETE`; kept for history and no longer usable on new contracts.", "enum": ["draft", "active", "archived"], "title": "PriceStatus", "type": "string"}, "PriceType": {"description": "Kind of price.\n\n* `fixed`: a set amount for a set quantity of an item, billed every interval.\n* `usage`: billed on the quantity a billable metric measures over the period.\n* `seat`: billed per seat, with the seat count taken from seat events.", "enum": ["fixed", "usage", "seat"], "title": "PriceType", "type": "string"}, "QuoteAmendmentSummary": {"additionalProperties": false, "description": "A published proposal to change an existing contract.", "properties": {"contractId": {"description": "Target contract ID.", "title": "Contractid", "type": "string"}, "effectiveFrom": {"description": "Agreed effective date of the proposed change.", "title": "Effectivefrom", "type": "string"}, "executableUntil": {"description": "Offer deadline; execution also requires the retained contract revision to remain valid.", "format": "date-time", "title": "Executableuntil", "type": "string"}}, "required": ["contractId", "effectiveFrom", "executableUntil"], "title": "QuoteAmendmentSummary", "type": "object"}, "QuoteAnalytics": {"additionalProperties": false, "description": "Recorded quote engagement; requesting analytics does not record a view.", "properties": {"totalViews": {"description": "Total recorded views, excluding transport retries.", "title": "Totalviews", "type": "integer"}, "uniqueViewers": {"description": "Distinct recipient links, most recently viewed first.", "items": {"$ref": "#/components/schemas/QuoteViewer"}, "title": "Uniqueviewers", "type": "array"}, "viewsByDay": {"description": "Recorded views by UTC date, oldest first.", "items": {"$ref": "#/components/schemas/QuoteViewDay"}, "title": "Viewsbyday", "type": "array"}}, "required": ["totalViews", "uniqueViewers", "viewsByDay"], "title": "QuoteAnalytics", "type": "object"}, "QuotePagination": {"additionalProperties": false, "description": "Filter-bound quote cursors and total matching result count.", "properties": {"after": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Next-page cursor, or null.", "title": "After"}, "before": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Previous-page cursor, or null.", "title": "Before"}, "totalResultSize": {"description": "Total matching quotes before pagination.", "title": "Totalresultsize", "type": "integer"}}, "required": ["before", "after", "totalResultSize"], "title": "QuotePagination", "type": "object"}, "QuoteSortBy": {"description": "Optional ordering field; omitting this orders by creation time.", "enum": ["acceptedAt"], "title": "QuoteSortBy", "type": "string"}, "QuoteSortOrder": {"description": "Direction of quote ordering; null acceptance dates always sort last.", "enum": ["ASC", "DESC"], "title": "QuoteSortOrder", "type": "string"}, "QuoteStatus": {"description": "A derived view of publication, signing, acceptance and execution facts.", "enum": ["DRAFT", "PUBLISHED", "PREPARING_SIGNATURE_REQUEST", "READY_TO_SIGN", "ACCEPTED", "EXECUTED"], "title": "QuoteStatus", "type": "string"}, "QuoteSummary": {"additionalProperties": false, "description": "A quote worklist summary; published documents remain separate from working edits.", "properties": {"acceptedAt": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Retained acceptance instant, when accepted.", "title": "Acceptedat"}, "amendment": {"anyOf": [{"$ref": "#/components/schemas/QuoteAmendmentSummary"}, {"type": "null"}], "description": "Proposed contract changes when the effective date and offer deadline are known."}, "archivedAt": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Archive instant, or null for an active worklist entry.", "title": "Archivedat"}, "contractId": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Created contract ID after execution, or the target contract ID for an amendment; null when neither exists.", "title": "Contractid"}, "createdAt": {"description": "Creation instant in UTC.", "format": "date-time", "title": "Createdat", "type": "string"}, "createdBy": {"description": "Original creator reference; ownership transfers do not change it.", "title": "Createdby", "type": "string"}, "currency": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "Current quote currency, when selected."}, "customerId": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Customer reference when selected.", "title": "Customerid"}, "dealType": {"$ref": "#/components/schemas/QuoteTemplateDealType", "description": "New business, renewal or amendment."}, "executedAt": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Authoritative contract execution instant, when recorded.", "title": "Executedat"}, "expiresAt": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Latest published offer's deadline.", "title": "Expiresat"}, "id": {"description": "Stable quote reference.", "title": "Id", "type": "string"}, "isExpired": {"description": "Whether the current unaccepted offer has reached its deadline.", "title": "Isexpired", "type": "boolean"}, "preliminaryBillingStartDate": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Proposed effective date when selected.", "title": "Preliminarybillingstartdate"}, "publishedAt": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Latest publication instant, including retained withdrawn offers.", "title": "Publishedat"}, "quoteNumber": {"description": "Immutable display reference assigned at creation; not a fiscal number.", "title": "Quotenumber", "type": "string"}, "status": {"$ref": "#/components/schemas/QuoteStatus", "description": "Derived lifecycle view, independent of archiving and expiry."}, "title": {"description": "Current working title.", "title": "Title", "type": "string"}, "updatedAt": {"description": "Most recent quote change in UTC.", "format": "date-time", "title": "Updatedat", "type": "string"}}, "required": ["id", "quoteNumber", "createdBy", "createdAt", "updatedAt", "archivedAt", "status", "isExpired", "customerId", "title", "currency", "dealType", "acceptedAt", "executedAt", "publishedAt", "expiresAt", "preliminaryBillingStartDate", "contractId", "amendment"], "title": "QuoteSummary", "type": "object"}, "QuoteTemplate": {"additionalProperties": false, "description": "A published template and its current discovery metadata.", "properties": {"archivedAt": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When archived, or null while active.", "title": "Archivedat"}, "createdAt": {"description": "When the template was originally created.", "format": "date-time", "title": "Createdat", "type": "string"}, "createdBy": {"description": "Original creator reference; editing does not change it.", "title": "Createdby", "type": "string"}, "currency": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "Default currency, or null when unspecified."}, "dealType": {"$ref": "#/components/schemas/QuoteTemplateDealType", "description": "Default commercial purpose."}, "id": {"description": "Template reference used when creating a quote.", "title": "Id", "type": "string"}, "title": {"description": "Name of the latest published template.", "title": "Title", "type": "string"}, "updatedAt": {"description": "When the template was last changed.", "format": "date-time", "title": "Updatedat", "type": "string"}}, "required": ["id", "createdAt", "createdBy", "updatedAt", "archivedAt", "title", "currency", "dealType"], "title": "QuoteTemplate", "type": "object"}, "QuoteTemplateDealType": {"description": "The commercial purpose inherited by quotes created from this template.", "enum": ["NEW_BUSINESS", "RENEWAL", "AMENDMENT"], "title": "QuoteTemplateDealType", "type": "string"}, "QuoteTemplatePagination": {"additionalProperties": false, "description": "Navigation cursors and total count for the selected template filters.", "properties": {"after": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Cursor for the next page, or null.", "title": "After"}, "before": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Cursor for the previous page, or null.", "title": "Before"}, "totalResultSize": {"description": "Total matching published templates before pagination.", "title": "Totalresultsize", "type": "integer"}}, "required": ["before", "after", "totalResultSize"], "title": "QuoteTemplatePagination", "type": "object"}, "QuoteTemplates": {"additionalProperties": false, "description": "One page of published templates in descending template-reference order.", "properties": {"items": {"description": "Matching published templates, with original creator metadata.", "items": {"$ref": "#/components/schemas/QuoteTemplate"}, "title": "Items", "type": "array"}, "pagination": {"$ref": "#/components/schemas/QuoteTemplatePagination", "description": "Filter-bound navigation and total count."}}, "required": ["items", "pagination"], "title": "QuoteTemplates", "type": "object"}, "QuoteViewDay": {"additionalProperties": false, "description": "Recorded views on one UTC calendar date.", "properties": {"date": {"description": "UTC calendar date, formatted YYYY-MM-DD.", "title": "Date", "type": "string"}, "totalViews": {"description": "Number of recorded views on this date.", "title": "Totalviews", "type": "integer"}}, "required": ["date", "totalViews"], "title": "QuoteViewDay", "type": "object"}, "QuoteViewer": {"additionalProperties": false, "description": "One pseudonymous recipient link that viewed a quote.", "properties": {"email": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Visitor email, when retained; null for recipient-link analytics.", "title": "Email"}, "lastViewedAt": {"description": "Most recent recorded view, in UTC.", "format": "date-time", "title": "Lastviewedat", "type": "string"}, "loginType": {"description": "Access method; QUOTE_LINK identifies recipient-link access.", "title": "Logintype", "type": "string"}, "visitorIdentifier": {"description": "Stable visitor reference scoped to this quote.", "title": "Visitoridentifier", "type": "string"}}, "required": ["visitorIdentifier", "loginType", "email", "lastViewedAt"], "title": "QuoteViewer", "type": "object"}, "Quotes": {"additionalProperties": false, "description": "One page of quotes in the selected deterministic order.", "properties": {"items": {"description": "Matching quote summaries.", "items": {"$ref": "#/components/schemas/QuoteSummary"}, "title": "Items", "type": "array"}, "pagination": {"$ref": "#/components/schemas/QuotePagination", "description": "Signed navigation and matching total."}}, "required": ["items", "pagination"], "title": "Quotes", "type": "object"}, "ReceivablesAgingBucket": {"additionalProperties": false, "description": "Open balance falling in one aging bucket.", "properties": {"amount": {"$ref": "#/components/schemas/ReportMoney", "description": "Open balance in the bucket."}, "key": {"$ref": "#/components/schemas/ReceivablesAgingBucketKey", "description": "Aging bucket.", "examples": ["days_31_60"]}}, "required": ["key", "amount"], "title": "ReceivablesAgingBucket", "type": "object"}, "ReceivablesAgingBucketKey": {"description": "Aging bucket of an open balance, by days past its due date on the report day.\n\n- `no_due_date`: the invoice has no due date.\n- `not_due`: due on or after the report day.\n- `days_0_30`: 1 to 30 days past due.\n- `days_31_60`: 31 to 60 days past due.\n- `days_61_90`: 61 to 90 days past due.\n- `days_90_plus`: more than 90 days past due.", "enum": ["no_due_date", "not_due", "days_0_30", "days_31_60", "days_61_90", "days_90_plus"], "title": "ReceivablesAgingBucketKey", "type": "string"}, "ReceivablesAgingCustomer": {"additionalProperties": false, "description": "One billed customer's open receivables, split by aging bucket.", "properties": {"buckets": {"description": "Open balance per aging bucket.", "items": {"$ref": "#/components/schemas/ReceivablesAgingBucket"}, "title": "Buckets", "type": "array"}, "customer_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Customer on the row's latest receivable; null when not bound to one.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a13"], "title": "Customer Id"}, "customer_name": {"description": "Receiver legal name as invoiced.", "examples": ["Comercial Andes SpA"], "title": "Customer Name", "type": "string"}, "customer_tax_id": {"anyOf": [{"$ref": "#/components/schemas/TaxIdentifier"}, {"type": "null"}], "description": "Receiver tax id the row's invoices were issued to; null when unknown.", "examples": [{"country": "CL", "type": "rut", "value": "76543210-3"}]}, "group_key": {"description": "Opaque key of the billed receiver (tax id) this row groups. Pass it as `group_key` to the invoices endpoint to list exactly this row's invoices.", "examples": ["rut:765432103"], "title": "Group Key", "type": "string"}, "total": {"$ref": "#/components/schemas/ReportMoney", "description": "Sum of every bucket."}}, "required": ["group_key", "customer_id", "customer_name", "customer_tax_id", "buckets", "total"], "title": "ReceivablesAgingCustomer", "type": "object"}, "ReceivablesAgingCustomerPage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/ReceivablesAgingCustomer"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[ReceivablesAgingCustomer]", "type": "object"}, "ReceivablesAgingInvoice": {"additionalProperties": false, "description": "One open invoice and its aging bucket on the report day.", "properties": {"amount": {"$ref": "#/components/schemas/ReportMoney", "description": "Open balance as of the report day."}, "bucket_key": {"$ref": "#/components/schemas/ReceivablesAgingBucketKey", "description": "Aging bucket.", "examples": ["days_0_30"]}, "due_date": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Due date; null when the invoice has none.", "examples": ["2026-03-02"], "title": "Due Date"}, "fiscal_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Fiscal document number assigned by the tax authority (the Chilean folio): the same value as the invoice's `fiscal.number`. Null until assigned.", "examples": ["1234"], "title": "Fiscal Number"}, "invoice_id": {"description": "Invoice id.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10"], "format": "uuid", "title": "Invoice Id", "type": "string"}, "issue_date": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Issue date; null when not issued yet.", "examples": ["2026-01-31"], "title": "Issue Date"}, "original_amount": {"$ref": "#/components/schemas/ReportMoney", "description": "Invoice total when issued."}}, "required": ["invoice_id", "fiscal_number", "issue_date", "due_date", "bucket_key", "amount", "original_amount"], "title": "ReceivablesAgingInvoice", "type": "object"}, "ReceivablesAgingInvoicePage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/ReceivablesAgingInvoice"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[ReceivablesAgingInvoice]", "type": "object"}, "ReinstateContractRequest": {"additionalProperties": false, "description": "Undo a mistaken cancellation. ``reason`` is the only record of the reversal.", "properties": {"reason": {"description": "Why the cancellation is being undone; must not be blank.", "examples": ["Cancelled by mistake; the customer renewed."], "maxLength": 2000, "minLength": 1, "pattern": "\\S", "title": "Reason", "type": "string"}}, "required": ["reason"], "title": "ReinstateContractRequest", "type": "object"}, "ReplaceWebhookSubscriptionsRequest": {"additionalProperties": false, "description": "Replaces the full set of event types an endpoint receives.", "example": {"subscriptions": [{"event_type": "invoice.issued", "schema_version": 1}]}, "properties": {"subscriptions": {"description": "The complete new subscription set; event types left out are unsubscribed.", "items": {"$ref": "#/components/schemas/WebhookSubscription"}, "title": "Subscriptions", "type": "array"}}, "required": ["subscriptions"], "title": "ReplaceWebhookSubscriptionsRequest", "type": "object"}, "ReportMoney": {"additionalProperties": false, "description": "An amount in one currency.", "properties": {"amount": {"description": "Exact decimal string at the currency's precision: 0 decimals for CLP, 2 for USD, 4 for CLF. Negative only for a net credit.", "examples": ["1250000"], "pattern": "^-?\\d+(\\.\\d+)?$", "title": "Amount", "type": "string"}, "currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency code.", "examples": ["CLP"]}}, "required": ["amount", "currency"], "title": "ReportMoney", "type": "object"}, "ReportPriceType": {"description": "Which kind of price a revenue figure comes from.\n\n- `fixed`: recurring fixed charges.\n- `usage`: usage-based charges.\n- `one_time`: one-time charges.\n- `adjustment`: discounts, credits and other adjustments.\n- `other`: revenue that fits none of the kinds above.\n- `all`: every kind combined.", "enum": ["fixed", "usage", "one_time", "adjustment", "other", "all"], "title": "ReportPriceType", "type": "string"}, "ReportTimeGrain": {"description": "Size of each bucket in a trend: `day`, `week`, `month`, `quarter` or `year`.", "enum": ["day", "week", "month", "quarter", "year"], "title": "ReportTimeGrain", "type": "string"}, "ResolvedPaymentMethod": {"additionalProperties": false, "description": "The payment method that will actually be used to collect from a billing entity.", "properties": {"assignment_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "The customer assignment the method came from. Null when it did not come from an assignment.", "examples": ["01909e26-9a20-7c3e-8b1a-2f4e6d8a1c3b"], "title": "Assignment Id"}, "collection_rail": {"$ref": "#/components/schemas/CollectionRail", "description": "Who collects from the billing entity."}, "payment_method": {"anyOf": [{"$ref": "#/components/schemas/PaymentMethod"}, {"type": "null"}], "description": "The payment method that will be used. Null when none could be resolved."}, "reason": {"anyOf": [{"$ref": "#/components/schemas/PaymentMethodUnusableReason"}, {"type": "null"}], "description": "Why the candidate method could not be used; null when a usable method was resolved or no candidate existed.", "examples": [null]}, "resolution_kind": {"$ref": "#/components/schemas/PaymentMethodResolutionKind", "description": "Where the resolved payment method came from.", "examples": ["customer_default"]}, "transfer_route_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "The country-and-currency transfer route that selected the method. Null unless `resolution_kind` is `transfer_route`.", "examples": [null], "title": "Transfer Route Id"}}, "required": ["resolution_kind", "payment_method", "assignment_id", "reason", "transfer_route_id", "collection_rail"], "title": "ResolvedPaymentMethod", "type": "object"}, "ResumeContractRequest": {"additionalProperties": false, "description": "Resume a paused contract now.", "properties": {"billing_cycle_anchor": {"$ref": "#/components/schemas/ContractResumeBillingCycleAnchor", "default": "unchanged", "description": "`unchanged` keeps the billing cycle; `resume_date` restarts it today.", "examples": ["unchanged"]}}, "title": "ResumeContractRequest", "type": "object"}, "RevenueConcentrationReport": {"additionalProperties": false, "description": "How concentrated revenue is in its largest groups over an inclusive date range.", "properties": {"date_from": {"description": "First day of the range (inclusive).", "examples": ["2026-01-01"], "format": "date", "title": "Date From", "type": "string"}, "date_to": {"description": "Last day of the range (inclusive).", "examples": ["2026-01-31"], "format": "date", "title": "Date To", "type": "string"}, "limit": {"description": "Maximum rows requested.", "examples": [10], "title": "Limit", "type": "integer"}, "rows": {"description": "Largest groups first.", "items": {"$ref": "#/components/schemas/RevenueConcentrationRow"}, "title": "Rows", "type": "array"}, "top_10_share_percentage": {"description": "Percentage of total revenue (0-100) held by the 10 largest groups.", "examples": ["81.75"], "title": "Top 10 Share Percentage", "type": "string"}, "top_5_share_percentage": {"description": "Percentage of total revenue (0-100) held by the 5 largest groups.", "examples": ["63.40"], "title": "Top 5 Share Percentage", "type": "string"}}, "required": ["date_from", "date_to", "limit", "top_5_share_percentage", "top_10_share_percentage", "rows"], "title": "RevenueConcentrationReport", "type": "object"}, "RevenueConcentrationRow": {"additionalProperties": false, "description": "Revenue of one group and its share of total revenue.", "properties": {"billable_metric_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Set when grouping by billable metric.", "examples": ["api_calls"], "title": "Billable Metric Code"}, "cumulative_share_percentage": {"description": "Share of total revenue held by this row and every larger one (0-100).", "examples": ["63.40"], "title": "Cumulative Share Percentage", "type": "string"}, "customer_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Set when grouping by customer.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a13"], "title": "Customer Id"}, "item_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Set when grouping by item.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a40"], "title": "Item Id"}, "revenue": {"$ref": "#/components/schemas/ReportMoney", "description": "Revenue of the group over the range."}, "share_percentage": {"description": "Share of total revenue, as a decimal string percentage (0-100, 2 places).", "examples": ["18.25"], "title": "Share Percentage", "type": "string"}}, "required": ["revenue", "share_percentage", "cumulative_share_percentage"], "title": "RevenueConcentrationRow", "type": "object"}, "RevenueGroupBy": {"description": "How revenue rows are grouped.\n\n- `customer`: one row per customer.\n- `item`: one row per catalog item.\n- `billable_metric`: one row per billable metric (usage revenue).", "enum": ["customer", "item", "billable_metric"], "title": "RevenueGroupBy", "type": "string"}, "RevenueGroupRow": {"additionalProperties": false, "description": "Revenue of one group. Exactly the key field that matches the grouping is set.", "properties": {"billable_metric_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Set when grouping by billable metric.", "examples": ["api_calls"], "title": "Billable Metric Code"}, "customer_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Set when grouping by customer.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a13"], "title": "Customer Id"}, "item_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Set when grouping by item.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a40"], "title": "Item Id"}, "revenue": {"$ref": "#/components/schemas/ReportMoney", "description": "Revenue of the group over the range."}}, "required": ["revenue"], "title": "RevenueGroupRow", "type": "object"}, "RevenueRecognition": {"additionalProperties": false, "description": "How the revenue of a line is recognized.", "properties": {"method": {"$ref": "#/components/schemas/RevenueRecognitionMethod", "description": "How the line's revenue is recognized.", "examples": ["point_in_time"]}, "performance_obligation_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Performance obligation the line's revenue is allocated to; null if none.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a20"], "title": "Performance Obligation Id"}, "recognition_period": {"anyOf": [{"$ref": "#/components/schemas/DatePeriod"}, {"type": "null"}], "description": "Period the revenue is recognized over; null for point-in-time."}}, "required": ["method", "recognition_period", "performance_obligation_id"], "title": "RevenueRecognition", "type": "object"}, "RevenueRecognitionInput": {"additionalProperties": false, "description": "How the revenue of a line should be recognized.", "properties": {"method": {"$ref": "#/components/schemas/RevenueRecognitionMethod", "description": "How the line's revenue is recognized.", "examples": ["straight_line"]}, "performance_obligation_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Performance obligation the line's revenue is allocated to, if any.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a20"], "title": "Performance Obligation Id"}, "recognition_period": {"anyOf": [{"$ref": "#/components/schemas/DatePeriod"}, {"type": "null"}], "description": "Period the revenue is recognized over. Omit for `point_in_time` lines."}}, "required": ["method"], "title": "RevenueRecognitionInput", "type": "object"}, "RevenueRecognitionMethod": {"description": "How a line's revenue is recognized over time.\n\n- `point_in_time`: all at once, when the line is delivered.\n- `straight_line`: evenly across the recognition period.\n- `usage`: as the underlying usage is consumed.\n- `milestone`: when the related milestone is completed.", "enum": ["point_in_time", "straight_line", "usage", "milestone"], "title": "RevenueRecognitionMethod", "type": "string"}, "RevenueTrendPoint": {"additionalProperties": false, "description": "Revenue in one time bucket of a trend.", "properties": {"bucket_start": {"description": "First day of the bucket.", "examples": ["2026-01-01"], "format": "date", "title": "Bucket Start", "type": "string"}, "revenue": {"$ref": "#/components/schemas/ReportMoney", "description": "Revenue invoiced in the bucket."}}, "required": ["bucket_start", "revenue"], "title": "RevenueTrendPoint", "type": "object"}, "RevenueTrendReport": {"additionalProperties": false, "description": "Revenue over an inclusive date range, split into equal time buckets.", "properties": {"date_from": {"description": "First day of the range (inclusive).", "examples": ["2026-01-01"], "format": "date", "title": "Date From", "type": "string"}, "date_to": {"description": "Last day of the range (inclusive).", "examples": ["2026-01-31"], "format": "date", "title": "Date To", "type": "string"}, "grain": {"$ref": "#/components/schemas/ReportTimeGrain", "description": "Bucket size.", "examples": ["month"]}, "points": {"description": "One point per bucket, oldest first.", "items": {"$ref": "#/components/schemas/RevenueTrendPoint"}, "title": "Points", "type": "array"}}, "required": ["date_from", "date_to", "grain", "points"], "title": "RevenueTrendReport", "type": "object"}, "RevokeFinancialCredit": {"additionalProperties": false, "description": "Retire unused credit capacity without deleting history.", "properties": {"reason": {"anyOf": [{"maxLength": 500, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Optional reason retained in immutable credit history.", "title": "Reason"}}, "title": "RevokeFinancialCredit", "type": "object"}, "SandboxIdentity": {"description": "The authenticated key's organization and its current execution context.", "properties": {"organization_id": {"description": "Organization bound to the authenticated API key.", "format": "uuid", "title": "Organization Id", "type": "string"}, "runtime": {"$ref": "#/components/schemas/SandboxRuntime", "description": "Runtime hosting the API. Shared sandboxes run in prod."}, "tenant_mode": {"description": "Current workspace mode; must be sandbox when using the sandbox API.", "title": "Tenant Mode", "type": "string"}}, "required": ["organization_id", "runtime", "tenant_mode"], "title": "SandboxIdentity", "type": "object"}, "SandboxRuntime": {"description": "Execution runtime hosting this API; independent of the workspace mode.", "enum": ["dev", "prod", "sandbox"], "title": "SandboxRuntime", "type": "string"}, "SeatCount": {"additionalProperties": false, "description": "The seat count a contract seat metric resolves to on one calendar day.", "properties": {"as_of": {"description": "Calendar day the count is resolved for, in the contract's billing timezone. Changes with an `effective_date` on or before this day count.", "examples": ["2026-07-31"], "format": "date", "title": "As Of", "type": "string"}, "contract_id": {"description": "Contract the count belongs to.", "examples": ["01909e26-bd7a-7c4b-8f5e-6a8b1c3d4e5f"], "format": "uuid", "title": "Contract Id", "type": "string"}, "count": {"description": "Whole-number string: the seat count on `as_of`, resolved by the same rule billing uses. The latest uncancelled `set` on or before `as_of` is the starting point and the `added`/`removed` changes ordered after it move it; without a `set` it is the sum of `added` minus `removed`. Cancelled changes never count. This is the raw net and can be negative when removals exceed the seats on record; billing treats a negative count as zero, then applies the price's `minimum_quantity`.", "examples": ["12"], "title": "Count", "type": "string"}, "seat_metric_id": {"description": "Seat metric the count belongs to.", "examples": ["01909e26-d1a4-7e6d-8b3c-9f0a1b2c3d4e"], "format": "uuid", "title": "Seat Metric Id", "type": "string"}}, "required": ["contract_id", "seat_metric_id", "as_of", "count"], "title": "SeatCount", "type": "object"}, "SeatEvent": {"additionalProperties": false, "description": "A recorded seat change. Seat changes are never edited; a cancelled one keeps its row.", "properties": {"cancelled_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When the change was cancelled (UTC); `null` while it counts toward billing. A cancelled change no longer counts.", "examples": [null], "title": "Cancelled At"}, "change_type": {"$ref": "#/components/schemas/SeatEventChangeType", "description": "`added` increased the seat count by `count`; `removed` decreased it; `set` made it exactly `count` from `effective_date`.", "examples": ["added"]}, "contract_id": {"description": "Contract whose seat count changed.", "examples": ["01909e26-bd7a-7c4b-8f5e-6a8b1c3d4e5f"], "format": "uuid", "title": "Contract Id", "type": "string"}, "count": {"description": "Whole-number string: seats added or removed (positive), or for `set` the seat count itself (zero or positive).", "examples": ["5"], "title": "Count", "type": "string"}, "created_at": {"description": "When Relvo recorded the change (UTC).", "examples": ["2026-07-15T14:30:03.000Z"], "format": "date-time", "title": "Created At", "type": "string"}, "effective_date": {"description": "Calendar date from which the change applies for billing.", "examples": ["2026-07-15"], "format": "date", "title": "Effective Date", "type": "string"}, "id": {"description": "Seat event id.", "examples": ["01936f2e-8e0f-7a6b-8c4d-5e6f708192a3"], "format": "uuid", "title": "Id", "type": "string"}, "idempotency_key": {"description": "Idempotency key the change was ingested with. A key longer than 101 characters is stored, and returned, as a fixed-length digest.", "examples": ["seat-evt-2026-07-15-001"], "title": "Idempotency Key", "type": "string"}, "seat_metric_id": {"description": "Seat metric the change applies to.", "examples": ["01909e26-d1a4-7e6d-8b3c-9f0a1b2c3d4e"], "format": "uuid", "title": "Seat Metric Id", "type": "string"}, "source": {"$ref": "#/components/schemas/SeatEventSource", "description": "Channel that recorded the change.", "examples": ["api"]}, "timestamp": {"description": "When the change happened (UTC).", "examples": ["2026-07-15T14:30:00.000Z"], "format": "date-time", "title": "Timestamp", "type": "string"}}, "required": ["id", "idempotency_key", "contract_id", "seat_metric_id", "change_type", "count", "effective_date", "source", "timestamp", "created_at"], "title": "SeatEvent", "type": "object"}, "SeatEventChangeType": {"description": "Kind of seat change.\n\n- `added`: seats were added; the seat count increases by `count`.\n- `removed`: seats were removed; the seat count decreases by `count`.\n- `set`: the seat count is `count` from `effective_date` (zero allowed). Changes\n  are ordered by `effective_date`, then `timestamp`; `added`/`removed` changes\n  ordered after a `set` move the count from it, earlier ones are already part\n  of it. Cancelling a `set` returns to the previous `set` plus the changes\n  after that one.", "enum": ["added", "removed", "set"], "title": "SeatEventChangeType", "type": "string"}, "SeatEventIngestResult": {"additionalProperties": false, "description": "Outcome of a seat-event batch.", "properties": {"duplicate_idempotency_keys": {"description": "Keys already ingested with the same body; nothing new was recorded and the stored change was kept.", "examples": [["seat-evt-2026-07-14-003"]], "items": {"type": "string"}, "title": "Duplicate Idempotency Keys", "type": "array"}, "ingested_idempotency_keys": {"description": "Keys of changes ingested by this request.", "examples": [["seat-evt-2026-07-15-001"]], "items": {"type": "string"}, "title": "Ingested Idempotency Keys", "type": "array"}, "validation_failed": {"description": "Changes that were rejected and not ingested.", "items": {"$ref": "#/components/schemas/SeatEventValidationFailure"}, "title": "Validation Failed", "type": "array"}}, "required": ["ingested_idempotency_keys", "duplicate_idempotency_keys", "validation_failed"], "title": "SeatEventIngestResult", "type": "object"}, "SeatEventPage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/SeatEvent"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[SeatEvent]", "type": "object"}, "SeatEventSource": {"description": "Channel that recorded a seat change.\n\n- `api`: ingested through `POST /seat-events`.\n- `manual`: entered by a user in Relvo.\n- `csv`: imported from a file.", "enum": ["api", "manual", "csv"], "title": "SeatEventSource", "type": "string"}, "SeatEventValidationFailure": {"additionalProperties": false, "description": "One seat change of the batch that was not ingested.", "properties": {"errors": {"description": "Why the change was rejected.", "examples": [["Event timestamp is more than 24 hours in the future"]], "items": {"type": "string"}, "title": "Errors", "type": "array"}, "idempotency_key": {"description": "Idempotency key of the rejected change.", "examples": ["seat-evt-2026-07-15-001"], "title": "Idempotency Key", "type": "string"}}, "required": ["idempotency_key", "errors"], "title": "SeatEventValidationFailure", "type": "object"}, "SeatMetric": {"additionalProperties": false, "description": "A seat metric: a named seat count a seat price bills against.", "properties": {"code": {"description": "Code that identifies the seat metric within its contract.", "examples": ["admin_seats"], "title": "Code", "type": "string"}, "contract_id": {"description": "ID of the contract the seat metric belongs to.", "examples": ["01936f2e-3b5c-7a1b-8c9d-0e1f2a3b4c5d"], "format": "uuid", "title": "Contract Id", "type": "string"}, "created_at": {"description": "When the seat metric was created.", "examples": ["2026-01-01T00:00:00.000Z"], "format": "date-time", "title": "Created At", "type": "string"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Internal explanation of what the seats represent.", "examples": ["Users with administrator access to the customer's workspace."], "title": "Description"}, "id": {"description": "Unique ID of the seat metric.", "examples": ["01936f2e-7d9e-7f5a-9b3c-4d5e6f708192"], "format": "uuid", "title": "Id", "type": "string"}, "name": {"description": "Name of the seat metric shown in the dashboard.", "examples": ["Admin seats"], "title": "Name", "type": "string"}, "name_on_invoice": {"description": "Name printed on invoice lines for these seats.", "examples": ["Admin seats"], "title": "Name On Invoice", "type": "string"}, "updated_at": {"description": "When the seat metric was last changed.", "examples": ["2026-01-01T00:00:00.000Z"], "format": "date-time", "title": "Updated At", "type": "string"}, "version": {"description": "Optimistic-concurrency version.", "examples": [1], "title": "Version", "type": "integer"}}, "required": ["id", "contract_id", "code", "name", "name_on_invoice", "created_at", "updated_at", "version"], "title": "SeatMetric", "type": "object"}, "SeatMetricPage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/SeatMetric"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[PublicSeatMetric]", "type": "object"}, "SeatPrice": {"additionalProperties": false, "description": "A seat price, the seat count resolved from a seat metric and priced by `pricing`.", "properties": {"created_at": {"description": "When the price was created (UTC).", "examples": ["2026-01-01T00:00:00.000Z"], "format": "date-time", "title": "Created At", "type": "string"}, "currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency every amount of this price is expressed in.", "examples": ["CLP"]}, "id": {"description": "Unique identifier of the price.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10"], "format": "uuid", "title": "Id", "type": "string"}, "interval": {"$ref": "#/components/schemas/PriceInterval", "description": "Recurrence; `one_time` for a non-recurring price.", "examples": ["monthly"]}, "item_id": {"description": "Catalog item this price bills for.", "examples": ["0191f3c1-8a20-7b3c-9d4e-2a1b3c4d5e6f"], "format": "uuid", "title": "Item Id", "type": "string"}, "minimum_quantity": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Minimum number of seats billed per period, as a decimal string. Null for no minimum.", "examples": ["5"], "title": "Minimum Quantity"}, "name": {"description": "Display name of the price.", "examples": ["Platform subscription"], "title": "Name", "type": "string"}, "name_on_invoice": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Invoice line label template. Null means the price name is used.", "examples": ["Platform subscription {{month}} {{year}}"], "title": "Name On Invoice"}, "pay_in_advance": {"description": "True bills at the start of the period; false in arrears.", "examples": [true], "title": "Pay In Advance", "type": "boolean"}, "pricing": {"description": "Pricing definition, selected by `model`.", "discriminator": {"mapping": {"formula": "#/components/schemas/FormulaPricing", "graduated": "#/components/schemas/GraduatedPricing", "graduated_percentage": "#/components/schemas/GraduatedPercentagePricing", "package": "#/components/schemas/PackagePricing", "percentage": "#/components/schemas/PercentagePricing", "standard": "#/components/schemas/StandardPricing", "volume": "#/components/schemas/VolumePricing"}, "propertyName": "model"}, "oneOf": [{"$ref": "#/components/schemas/StandardPricing"}, {"$ref": "#/components/schemas/GraduatedPricing"}, {"$ref": "#/components/schemas/VolumePricing"}, {"$ref": "#/components/schemas/PackagePricing"}, {"$ref": "#/components/schemas/PercentagePricing"}, {"$ref": "#/components/schemas/GraduatedPercentagePricing"}, {"$ref": "#/components/schemas/FormulaPricing"}], "title": "Pricing"}, "prorated": {"description": "True bills a partial service period (contract start or end inside the period) in proportion to the days covered.", "examples": [true], "title": "Prorated", "type": "boolean"}, "quantity_strategy": {"$ref": "#/components/schemas/SeatQuantityStrategy", "description": "How the period's seat count is derived from seat events.", "examples": ["snapshot_end"]}, "seat_metric_id": {"description": "Seat metric the seat count is resolved from.", "examples": ["0191f3c1-ac42-7d5e-9f60-4c3d5e6f7081"], "format": "uuid", "title": "Seat Metric Id", "type": "string"}, "status": {"$ref": "#/components/schemas/PriceStatus", "description": "Current lifecycle status.", "examples": ["active"]}, "type": {"const": "seat", "description": "Price type discriminator; always `seat` for this object.", "title": "Type", "type": "string"}, "updated_at": {"description": "When the price was last changed (UTC).", "examples": ["2026-01-01T00:00:00.000Z"], "format": "date-time", "title": "Updated At", "type": "string"}, "version": {"description": "Optimistic-concurrency version; send it back as `If-Match`.", "examples": [1], "title": "Version", "type": "integer"}}, "required": ["id", "name", "name_on_invoice", "currency", "interval", "status", "created_at", "updated_at", "version", "pricing", "type", "item_id", "seat_metric_id", "quantity_strategy", "minimum_quantity", "pay_in_advance", "prorated"], "title": "SeatPrice", "type": "object"}, "SeatQuantityStrategy": {"description": "How the seat count of a period is resolved from seat events.\n\n`snapshot_end`: one seat count per period. A charge billed in arrears reads\nthe period's last day; a charge billed in advance reads its first day, so a\nchange during the period is billed from the next period. Changes during the\nperiod are not charged pro rata.\n`time_weighted`: the average of the daily seat count over the period, so each\nseat is charged for the days it was held (additions and removals).\n`prorated_additions`: the average of the period's running maximum, so added\nseats are charged from the day they were added and removals take effect next\nperiod.\n\nThe daily strategies return a decimal quantity with six places, are billed in\narrears, and use the `standard` model.", "enum": ["snapshot_end", "time_weighted", "prorated_additions"], "title": "SeatQuantityStrategy", "type": "string"}, "SortField": {"description": "Timestamp a list is ordered by; ties break on the resource id.\n\n- `created_at`: when the resource was created.\n- `updated_at`: when the resource was last changed.", "enum": ["created_at", "updated_at"], "title": "SortField", "type": "string"}, "SortOrder": {"description": "Sort direction for a sortable list.\n\n- `asc`: ascending, smallest or oldest first.\n- `desc`: descending, largest or newest first.", "enum": ["asc", "desc"], "title": "SortOrder", "type": "string"}, "StandardPricing": {"additionalProperties": false, "description": "Flat price: `amount` per unit (fixed/seat) or per metered unit (usage).", "properties": {"amount": {"description": "Price of one unit, in the price's currency.", "examples": ["150000.00"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Amount", "type": "string"}, "free_units": {"anyOf": [{"minimum": 0.0, "type": "integer"}, {"type": "null"}], "description": "Usage prices only. Units per period that are not billed; only the quantity above this allowance is priced. Null means no free units.", "examples": [100], "title": "Free Units"}, "model": {"const": "standard", "description": "Pricing model discriminator; always `standard` for this object.", "title": "Model", "type": "string"}, "pricing_group_keys": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "description": "Usage prices only. Billable-metric filter keys the metered quantity is grouped by; each distinct combination of values is priced on its own. Null prices the whole quantity together.", "examples": [["region"]], "title": "Pricing Group Keys"}}, "required": ["model", "amount"], "title": "StandardPricing", "type": "object"}, "StartMilestonePhaseRequest": {"additionalProperties": false, "description": "Start a milestone phase.", "properties": {"started_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When the milestone started; defaults to now. Not in the future.", "examples": ["2026-03-01T00:00:00Z"], "title": "Started At"}}, "title": "StartMilestonePhaseRequest", "type": "object"}, "SuppressedLine": {"additionalProperties": false, "description": "A billing-generated line removed from a draft; billing will not produce it again\nuntil the suppression is restored.", "properties": {"id": {"description": "Suppression id; restore it to bring the line back.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a25"], "format": "uuid", "title": "Id", "type": "string"}}, "required": ["id"], "title": "SuppressedLine", "type": "object"}, "SuppressedLineList": {"additionalProperties": false, "description": "Every billing-generated line suppressed on one draft invoice.", "properties": {"items": {"description": "The suppressed lines.", "items": {"$ref": "#/components/schemas/SuppressedLine"}, "title": "Items", "type": "array"}, "next_cursor": {"description": "Always null: this collection is bounded (the generated lines suppressed on this one invoice).", "title": "Next Cursor", "type": "null"}}, "required": ["items", "next_cursor"], "title": "SuppressedLineList", "type": "object"}, "TaxIdType": {"description": "Tax identifier scheme, named after the identifier its tax authority issues.\n\nEach country accepts its own schemes, and `country` decides which rule applies.\n\n- `rut`: Chile (companies and individuals) or Uruguay (companies).\n- `rfc`: Mexico.\n- `nit`: Colombia, Bolivia, Guatemala or El Salvador.\n- `cuit`: Argentina.\n- `ruc`: Peru, Ecuador or Paraguay (companies), or Panama (companies and individuals).\n- `cnpj`: Brazil (companies).\n- `cpf`: Brazil or Costa Rica (individuals).\n- `ein`: United States Employer Identification Number (companies).\n- `tin`: The national taxpayer number of the United States and of many other countries.\n- `vat`: The VAT number of the United Kingdom and of European countries.\n- `utr`: United Kingdom Unique Taxpayer Reference.\n- `ci`: National identity card, such as those of Ecuador, Uruguay, Colombia or Bolivia.\n- `cui`: Peru or Guatemala personal identification code (individuals).\n- `nif`: Spain, Portugal or Algeria tax identification number.\n- `cif`: Spain company tax code.\n- `nie`: Spain foreigner identity number (individuals).\n- `cpj`: Costa Rica legal-entity identity number (companies).\n- `cr`: Costa Rica foreign resident number (individuals).\n- `hp`: Israel company number.\n- `idnr`: Israel personal identity number.", "enum": ["rut", "rfc", "nit", "cuit", "ruc", "cnpj", "cpf", "ein", "tin", "vat", "utr", "ci", "cui", "nif", "cif", "nie", "cpj", "cr", "hp", "idnr"], "title": "TaxIdType", "type": "string"}, "TaxIdentifier": {"additionalProperties": false, "description": "A tax identifier: its printed value, its scheme and the issuing country.", "example": {"country": "CL", "type": "rut", "value": "76.123.456-7"}, "properties": {"country": {"anyOf": [{"$ref": "#/components/schemas/CountryEnum"}, {"type": "null"}], "description": "ISO 3166-1 alpha-2 country of the issuing tax authority. Defaults to the billing address country when omitted.", "examples": ["CL"]}, "type": {"anyOf": [{"$ref": "#/components/schemas/TaxIdType"}, {"type": "null"}], "description": "Lowercase tax identifier scheme (e.g. `rut`, `rfc`, `ein`). Omit it to let Relvo infer the scheme from `country` and the value.", "examples": ["rut"]}, "value": {"description": "The tax identifier as printed; punctuation is accepted and normalized (`76.123.456-7` and `761234567` are the same Chilean RUT).", "examples": ["76.123.456-7"], "minLength": 1, "title": "Value", "type": "string"}}, "required": ["value"], "title": "TaxIdentifier", "type": "object"}, "TaxStatus": {"description": "How the customer is taxed on documents issued to this billing entity.\n\n`taxed` charges the standard VAT; `tax_exempt` charges no VAT and is issued\non an exempt fiscal document; `reverse_charged` means the customer accounts\nfor the VAT itself, so it is likewise issued on an exempt document with no\nVAT charged.", "enum": ["taxed", "tax_exempt", "reverse_charged"], "title": "TaxStatus", "type": "string"}, "TaxTreatment": {"description": "How a tax applies to a line's amount.\n\n- `taxable`: the tax is charged at its rate.\n- `exempt`: the line is exempt from the tax.\n- `non_taxable`: the line is outside the scope of the tax.", "enum": ["taxable", "exempt", "non_taxable"], "title": "TaxTreatment", "type": "string"}, "TaxpayerLookupSource": {"description": "Where a taxpayer lookup was resolved from.\n\n- `gov_registry`: the Chilean tax authority's (SII) taxpayer registry.", "enum": ["gov_registry"], "title": "TaxpayerLookupSource", "type": "string"}, "Tier": {"additionalProperties": false, "description": "One tier of a graduated or volume price: covers `from < quantity <= up_to`.", "properties": {"flat_amount": {"description": "Amount added once when this tier applies. `\"0\"` for none.", "examples": ["0"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Flat Amount", "type": "string"}, "from": {"description": "The tier covers quantities above this value. `0` (or `free_units`) for the first tier; the previous tier's `up_to` otherwise.", "examples": [0], "minimum": 0.0, "title": "From", "type": "integer"}, "unit_amount": {"description": "Price of each unit priced by this tier, in the price's currency.", "examples": ["12.50"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Unit Amount", "type": "string"}, "up_to": {"anyOf": [{"type": "integer"}, {"type": "null"}], "description": "Last quantity the tier covers, inclusive. `null` marks the final, open-ended tier and is required on it.", "examples": [1000], "title": "Up To"}}, "required": ["from", "up_to", "unit_amount", "flat_amount"], "title": "Tier", "type": "object"}, "TopRevenueReport": {"additionalProperties": false, "description": "The groups with the most revenue over an inclusive date range.", "properties": {"date_from": {"description": "First day of the range (inclusive).", "examples": ["2026-01-01"], "format": "date", "title": "Date From", "type": "string"}, "date_to": {"description": "Last day of the range (inclusive).", "examples": ["2026-01-31"], "format": "date", "title": "Date To", "type": "string"}, "limit": {"description": "Maximum rows requested.", "examples": [10], "title": "Limit", "type": "integer"}, "rows": {"description": "Largest groups first.", "items": {"$ref": "#/components/schemas/RevenueGroupRow"}, "title": "Rows", "type": "array"}}, "required": ["date_from", "date_to", "limit", "rows"], "title": "TopRevenueReport", "type": "object"}, "UnmatchedReceipt": {"additionalProperties": false, "description": "Money received in a bank account that is not yet matched to any invoice.", "properties": {"amount": {"description": "Amount received, in `currency`, as an exact decimal string.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Amount", "type": "string"}, "counterparty": {"$ref": "#/components/schemas/UnmatchedReceiptCounterparty", "description": "Who sent the money."}, "currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency of the bank movement.", "examples": ["CLP"]}, "description": {"description": "The bank's description of the movement.", "title": "Description", "type": "string"}, "id": {"description": "The bank movement's id.", "format": "uuid", "title": "Id", "type": "string"}, "posted_on": {"description": "Day the bank posted the movement to the account.", "examples": ["2026-10-31"], "format": "date", "title": "Posted On", "type": "string"}, "recorded_at": {"description": "When Relvo imported the bank movement.", "format": "date-time", "title": "Recorded At", "type": "string"}, "state": {"$ref": "#/components/schemas/UnmatchedReceiptState", "description": "Why the receipt is still unmatched.", "examples": ["unmatched"]}, "transaction_date": {"description": "Day the payer made the transfer; on or before `posted_on`.", "examples": ["2026-10-30"], "format": "date", "title": "Transaction Date", "type": "string"}}, "required": ["id", "amount", "currency", "posted_on", "transaction_date", "description", "counterparty", "state", "recorded_at"], "title": "UnmatchedReceipt", "type": "object"}, "UnmatchedReceiptCounterparty": {"additionalProperties": false, "description": "Who sent the money, as the bank reported it.", "properties": {"name": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "The account holder's name, when the bank gave one.", "title": "Name"}, "tax_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "The payer's tax id as the bank reported it, reduced to letters and digits and upper-cased (RUT `76.123.456-k` is `76123456K`). `null` when the bank gave none.", "title": "Tax Id"}}, "required": ["name", "tax_id"], "title": "UnmatchedReceiptCounterparty", "type": "object"}, "UnmatchedReceiptCounterpartyPage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/UnmatchedReceiptCounterpartySummary"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "UnmatchedReceiptCounterpartyPage", "type": "object"}, "UnmatchedReceiptCounterpartySummary": {"additionalProperties": false, "description": "All unmatched money from one payer tax id, in one currency.", "properties": {"currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency of every receipt counted here.", "examples": ["CLP"]}, "earliest_posted_on": {"description": "`posted_on` of the oldest receipt: how long this money has waited.", "format": "date", "title": "Earliest Posted On", "type": "string"}, "receipt_count": {"description": "Number of unmatched receipts.", "minimum": 1.0, "title": "Receipt Count", "type": "integer"}, "tax_id": {"description": "The payer's tax id as the bank reported it, reduced to letters and digits and upper-cased (RUT `76.123.456-k` is `76123456K`).", "title": "Tax Id", "type": "string"}, "total_amount": {"description": "Sum of the receipts' amounts, in `currency`, as an exact decimal string.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Total Amount", "type": "string"}}, "required": ["tax_id", "currency", "receipt_count", "total_amount", "earliest_posted_on"], "title": "UnmatchedReceiptCounterpartySummary", "type": "object"}, "UnmatchedReceiptCurrencyTotal": {"additionalProperties": false, "description": "All unmatched money in one currency.", "properties": {"currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency of every receipt counted here.", "examples": ["CLP"]}, "receipt_count": {"description": "Number of unmatched receipts.", "minimum": 1.0, "title": "Receipt Count", "type": "integer"}, "total_amount": {"description": "Sum of the receipts' amounts, in `currency`, as an exact decimal string.", "examples": ["1000", "10.50"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Total Amount", "type": "string"}}, "required": ["currency", "receipt_count", "total_amount"], "title": "UnmatchedReceiptCurrencyTotal", "type": "object"}, "UnmatchedReceiptPage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/UnmatchedReceipt"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "UnmatchedReceiptPage", "type": "object"}, "UnmatchedReceiptState": {"description": "Why the receipt is still unmatched.\n\n- `unmatched`: no invoice match has been proposed yet.\n- `proposed`: Relvo proposed at least one invoice match that nobody has confirmed yet.", "enum": ["unmatched", "proposed"], "title": "UnmatchedReceiptState", "type": "string"}, "UnmatchedReceiptTotals": {"additionalProperties": false, "description": "Unmatched money per currency. Amounts in different currencies are never added up.", "properties": {"totals": {"description": "One entry per currency that has unmatched receipts, ordered by currency code. Empty when every receipt is matched.", "items": {"$ref": "#/components/schemas/UnmatchedReceiptCurrencyTotal"}, "title": "Totals", "type": "array"}}, "required": ["totals"], "title": "UnmatchedReceiptTotals", "type": "object"}, "UpdateBillableMetricRequest": {"additionalProperties": false, "description": "Changes to a billable metric. Omitted fields are left unchanged.\n\nThe definition (mode, SQL, structured definition, item) can only change while no price\nuses the metric.", "properties": {"definition_mode": {"anyOf": [{"$ref": "#/components/schemas/BillableMetricDefinitionMode"}, {"type": "null"}], "description": "New definition mode. `guided` requires `metric_definition`; `sql` requires `sql_expression`.", "examples": ["guided"]}, "description": {"anyOf": [{"maxLength": 2000, "minLength": 5, "type": "string"}, {"type": "null"}], "description": "Internal explanation of what the metric measures.", "examples": ["Number of billable API requests made in the period."], "title": "Description"}, "filters": {"anyOf": [{"items": {"$ref": "#/components/schemas/NewBillableMetricFilter"}, "maxItems": 100, "type": "array"}, {"type": "null"}], "description": "Replaces the whole filter set when given.", "title": "Filters"}, "item_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "ID of the catalog item this metric measures.", "examples": ["01936f2e-5a7b-7c3d-9e1f-2a3b4c5d6e7f"], "title": "Item Id"}, "metric_definition": {"anyOf": [{"$ref": "#/components/schemas/MetricDefinition"}, {"type": "null"}], "description": "New structured definition. Only accepted for `guided` metrics."}, "name": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Name of the metric shown in the dashboard.", "examples": ["API requests"], "title": "Name"}, "name_on_invoice": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Name printed on invoice lines for this metric.", "examples": ["API requests"], "title": "Name On Invoice"}, "sql_expression": {"anyOf": [{"maxLength": 4000, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "New aggregate SQL expression. Only accepted for `sql` metrics.", "examples": ["SUM(CASE WHEN event_name = 'api_request' THEN (properties->>'tokens')::numeric END)"], "title": "Sql Expression"}, "usage_entry_schema": {"anyOf": [{"$ref": "#/components/schemas/UsageEntrySchema"}, {"type": "null"}], "description": "New shape of usage entered by hand. Only accepted for `sql` metrics."}}, "title": "UpdateBillableMetricRequest", "type": "object"}, "UpdateCatalogItemRequest": {"additionalProperties": false, "description": "Partial update: an omitted field is left unchanged.", "properties": {"description": {"anyOf": [{"maxLength": 2000, "minLength": 5, "type": "string"}, {"type": "null"}], "description": "New description.", "examples": ["Access to the public REST API, billed by usage."], "title": "Description"}, "name": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "New display name.", "examples": ["API platform"], "title": "Name"}, "status": {"anyOf": [{"$ref": "#/components/schemas/ItemStatus"}, {"type": "null"}], "description": "New status. Deactivating an item still referenced by active metrics is a 409.", "examples": ["inactive"]}}, "title": "UpdateCatalogItemRequest", "type": "object"}, "UpdateContactRequest": {"additionalProperties": false, "description": "Body for updating a contact. Every field is optional; absent means unchanged.\n\n``name: null`` clears the name. A provided ``emails``/``phones``/``roles``\nlist is the complete desired set. Requires ``If-Match``.", "properties": {"emails": {"anyOf": [{"items": {"$ref": "#/components/schemas/ContactEmailInput"}, "type": "array"}, {"type": "null"}], "description": "The complete desired set of email addresses. Entries with `id` update that address's status, entries without `id` add one, and active addresses left out are archived. Omit to leave emails unchanged.", "title": "Emails"}, "first_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Given name. Omit to keep it; `null` clears it.", "examples": ["Jane"], "title": "First Name"}, "last_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Family name. Omit to keep it; `null` clears it.", "examples": ["Rivera"], "title": "Last Name"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Full name; prefer first_name and last_name for new writes. Omit to keep it; `null` clears it.", "examples": ["Jane Rivera"], "title": "Name"}, "phones": {"anyOf": [{"items": {"$ref": "#/components/schemas/ContactPhoneInput"}, "type": "array"}, {"type": "null"}], "description": "The complete desired set of phone numbers, reconciled like `emails`. Omit to leave phones unchanged.", "title": "Phones"}, "roles": {"anyOf": [{"items": {"$ref": "#/components/schemas/ContactRoleInput"}, "type": "array"}, {"type": "null"}], "description": "The complete desired set of roles; roles left out are revoked. Omit to leave roles unchanged.", "title": "Roles"}}, "title": "UpdateContactRequest", "type": "object"}, "UpdateContractCommentsRequest": {"additionalProperties": false, "description": "Replace operational comments, or clear them with null.", "properties": {"comments": {"anyOf": [{"maxLength": 2000, "minLength": 5, "type": "string"}, {"type": "null"}], "description": "New comments of at least 5 characters, or null to clear them.", "examples": ["Renewal negotiated by the account team."], "title": "Comments"}}, "required": ["comments"], "title": "UpdateContractCommentsRequest", "type": "object"}, "UpdateContractRequest": {"additionalProperties": false, "description": "Amend a contract (PATCH). Omitted fields keep their current value.\n\nThe amendment creates a new revision under the same contract id. ``phases``,\nwhen given, replaces the whole phase list.", "properties": {"amendment_effective_from": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "First day the amended terms apply; omit to apply from the contract start.", "examples": ["2026-07-01"], "title": "Amendment Effective From"}, "comments": {"anyOf": [{"maxLength": 2000, "minLength": 5, "type": "string"}, {"type": "null"}], "description": "New operational comments, at least 5 characters.", "examples": ["Price increase agreed for the second half of the year."], "title": "Comments"}, "default_billing_schedule": {"anyOf": [{"$ref": "#/components/schemas/ContractBillingSchedule"}, {"type": "null"}], "description": "New billing cycle anchor."}, "document_uri": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "New link to the signed contract document.", "examples": ["https://example.com/contracts/acme-2026-addendum.pdf"], "title": "Document Uri"}, "external_approval": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "description": "Whether invoices need approval outside Relvo before they are issued.", "examples": [false], "title": "External Approval"}, "external_refs": {"anyOf": [{"items": {"$ref": "#/components/schemas/ContractExternalReference"}, "maxItems": 50, "type": "array"}, {"type": "null"}], "description": "Replaces the links to outside systems when given; at most 50.", "title": "External Refs"}, "issuer_billing_entity_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "New billing entity that issues the invoices.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a20"], "title": "Issuer Billing Entity Id"}, "metadata": {"anyOf": [{"additionalProperties": {"type": "string"}, "type": "object"}, {"type": "null"}], "description": "Keys and values are literal operator-provided strings: preserve their exact spelling and language, never translate them. In key=value notation, the text left of = is the exact key. Merged into the stored metadata: each key sent is set, a key sent with an empty string `\"\"` is removed, other keys are kept. Send `null` to remove every key; omit to keep it. A request that changes only `metadata` updates the contract in place and creates no revision. At most 50 keys; keys are 1-40 characters and may not contain `[` or `]`; values are strings of at most 500 characters. The limits apply to the merged result.", "examples": [{"legacy_id": "", "segment": "mid-market"}], "title": "Metadata"}, "name": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "New contract name.", "examples": ["Acme 2026 subscription"], "title": "Name"}, "phases": {"anyOf": [{"items": {"$ref": "#/components/schemas/ContractPhaseInput"}, "maxItems": 50, "minItems": 1, "type": "array"}, {"type": "null"}], "description": "Replaces the whole list of phases when given.", "title": "Phases"}, "removes_contract_end": {"default": false, "description": "Confirms that the new `phases` remove the contract's end date, so it bills on indefinitely. A last phase without `effective_to` on a contract that has an end is refused unless this is true.", "title": "Removes Contract End", "type": "boolean"}, "start_date": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "New first service day.", "examples": ["2026-01-01"], "title": "Start Date"}}, "title": "UpdateContractRequest", "type": "object"}, "UpdateContractSettingsRequest": {"additionalProperties": false, "description": "Omitted fields are preserved; null clears that field's override.", "properties": {"pre_invoice_pdf": {"$ref": "#/components/schemas/ContractPrefacturaOverrides"}}, "required": ["pre_invoice_pdf"], "title": "UpdateContractSettingsRequest", "type": "object"}, "UpdatePriceRequest": {"additionalProperties": false, "description": "Editable fields only. Pricing is immutable: create a new price to change it.", "properties": {"name": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "New display name. Omit or null to leave unchanged.", "examples": ["Platform subscription"], "title": "Name"}, "name_on_invoice": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Omit to leave unchanged; `null` clears it back to the price name.", "examples": ["Platform subscription {{month}} {{year}}"], "title": "Name On Invoice"}, "status": {"anyOf": [{"$ref": "#/components/schemas/PriceLifecycleStatus"}, {"type": "null"}], "description": "`draft` or `active`. Archive with `DELETE` instead.", "examples": ["active"]}}, "title": "UpdatePriceRequest", "type": "object"}, "UpdateSeatMetricRequest": {"additionalProperties": false, "description": "Change a seat metric's display details. Omitted fields stay unchanged.\n\n`code` and `contract_id` identify the metric and cannot change.", "properties": {"description": {"anyOf": [{"maxLength": 2000, "minLength": 5, "type": "string"}, {"type": "null"}], "description": "New internal explanation. Send `null` to clear it.", "examples": ["Users with administrator access to the customer's workspace."], "title": "Description"}, "name": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "New name shown in the dashboard.", "examples": ["Admin seats"], "title": "Name"}, "name_on_invoice": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "New name printed on invoice lines for these seats.", "examples": ["Admin seats"], "title": "Name On Invoice"}}, "title": "UpdateSeatMetricRequest", "type": "object"}, "UsageAllocation": {"additionalProperties": false, "description": "Splits one usage price across billing entities by a usage event property.\n\nEach mapping bills the usage whose `dimension_key` value is in its `values` to its\nown billing entity, as a separate contract line.", "properties": {"dimension_key": {"description": "Usage event property whose values decide which billing entity is billed.", "examples": ["region"], "maxLength": 255, "minLength": 1, "pattern": "^[a-zA-Z0-9_]+$", "title": "Dimension Key", "type": "string"}, "mappings": {"description": "Value-to-billing-entity mappings. A value may appear in only one mapping.", "items": {"$ref": "#/components/schemas/UsageAllocationMapping"}, "maxItems": 100, "minItems": 1, "title": "Mappings", "type": "array"}}, "required": ["dimension_key", "mappings"], "title": "UsageAllocation", "type": "object"}, "UsageAllocationMapping": {"additionalProperties": false, "description": "One slice of a metric dimension and the billing entity it is billed to.", "properties": {"billing_entity_id": {"description": "Billing entity the usage matching `values` is billed to.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10"], "format": "uuid", "title": "Billing Entity Id", "type": "string"}, "group_label": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Optional label for this group of values, shown to identify the slice.", "examples": ["Europe"], "title": "Group Label"}, "values": {"description": "Values of the allocated property whose usage bills to this entity.", "examples": [["eu", "uk"]], "items": {"type": "string"}, "maxItems": 100, "minItems": 1, "title": "Values", "type": "array"}}, "required": ["values", "billing_entity_id"], "title": "UsageAllocationMapping", "type": "object"}, "UsageAllowanceInput": {"additionalProperties": false, "description": "Free units of a billable metric granted over explicit time windows.\n\nWindows are stated explicitly and are independent of the invoice cadence.", "properties": {"id": {"description": "Identifier of this usage allowance.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10"], "format": "uuid", "title": "Id", "type": "string"}, "metric_id": {"description": "Billable metric whose usage the allowance covers.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a11"], "format": "uuid", "title": "Metric Id", "type": "string"}, "windows": {"description": "Between 1 and 64 ordered, contiguous, non-overlapping windows, each with its own included units.", "items": {"$ref": "#/components/schemas/UsageAllowanceWindowInput"}, "maxItems": 64, "minItems": 1, "title": "Windows", "type": "array"}}, "required": ["id", "metric_id", "windows"], "title": "UsageAllowanceInput", "type": "object"}, "UsageAllowanceWindowInput": {"additionalProperties": false, "description": "One window of a usage allowance and the units included free within it.", "properties": {"end": {"description": "End of the window, exclusive. Must be a timezone-aware instant after `start`; the next window starts here.", "examples": ["2026-02-01T00:00:00Z"], "format": "date-time", "title": "End", "type": "string"}, "included_units": {"description": "Units of the billable metric included at no charge during this window, as a non-negative decimal string. Usage above it is billed by the price.", "examples": ["1000"], "maxLength": 80, "pattern": "^\\d+(\\.\\d+)?$", "title": "Included Units", "type": "string"}, "start": {"description": "Start of the window, inclusive. Must be a timezone-aware instant; windows must be contiguous and in order.", "examples": ["2026-01-01T00:00:00Z"], "format": "date-time", "title": "Start", "type": "string"}}, "required": ["start", "end", "included_units"], "title": "UsageAllowanceWindowInput", "type": "object"}, "UsageDiscount": {"additionalProperties": false, "description": "Free units: reduces the metered quantity before it is priced.\n\nIt never appears as a separate negative invoice line; the invoice simply shows a\nsmaller quantity.", "properties": {"discount_type": {"const": "usage", "description": "Always `usage` for a free-units discount.", "examples": ["usage"], "title": "Discount Type", "type": "string"}, "name": {"description": "Name of the discount, used as its invoice label unless overridden.", "examples": ["Launch discount"], "maxLength": 255, "minLength": 1, "title": "Name", "type": "string"}, "name_on_invoice": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Overrides the discount's invoice label. Null uses `name`. Invoice line label. May use `{{month}}`, `{{year}}` and `{{service_period}}`. Service periods render as dd/mm/yyyy - dd/mm/yyyy, with disjoint ranges separated by '; '. Referencing service_period requires complete service dates; unresolved or overlong output is rejected. Month/year are substituted from the line's billing period (e.g. `\"saas bulk {{month}} {{year}}\"` prints `\"saas bulk agosto 2026\"`). Any other variable is rejected.", "title": "Name On Invoice"}, "restrict_to_prices": {"description": "Ids of the phase prices this discount applies to.", "items": {"format": "uuid", "type": "string"}, "maxItems": 1, "minItems": 1, "title": "Restrict To Prices", "type": "array"}, "usage_quantity": {"description": "Units removed from the metered quantity before it is priced.", "examples": ["1000"], "pattern": "^\\d+(\\.\\d+)?$", "title": "Usage Quantity", "type": "string"}}, "required": ["name", "discount_type", "restrict_to_prices", "usage_quantity"], "title": "UsageDiscount", "type": "object"}, "UsageEntryProperty": {"additionalProperties": false, "description": "One property a person fills in when entering usage for this metric by hand.", "properties": {"allow_breakdown": {"default": false, "description": "Whether usage can be broken down (grouped) by this property's values.", "examples": [false], "title": "Allow Breakdown", "type": "boolean"}, "allow_filtering": {"default": false, "description": "Whether usage can be filtered by this property's values.", "examples": [false], "title": "Allow Filtering", "type": "boolean"}, "key": {"description": "Key of the property inside the usage event's `properties`.", "examples": ["tokens"], "maxLength": 255, "minLength": 1, "pattern": "^[A-Za-z0-9_]+$", "title": "Key", "type": "string"}, "label": {"anyOf": [{"maxLength": 255, "type": "string"}, {"type": "null"}], "description": "Human-readable name shown when entering usage. Null to derive it from `key`.", "examples": ["Tokens"], "title": "Label"}, "required": {"default": true, "description": "Whether every manual entry must include this property.", "examples": [true], "title": "Required", "type": "boolean"}, "type": {"$ref": "#/components/schemas/UsageEntryPropertyType", "description": "Data type the property's value must have.", "examples": ["decimal"]}}, "required": ["key", "type"], "title": "UsageEntryProperty", "type": "object"}, "UsageEntryPropertyType": {"description": "Data type of a usage event property.\n\n- `decimal`: a number, compared and aggregated numerically.\n- `string`: free text.\n- `boolean`: true or false.\n- `json`: any JSON value, such as an object or a list.", "enum": ["decimal", "string", "boolean", "json"], "title": "UsageEntryPropertyType", "type": "string"}, "UsageEntrySchema": {"additionalProperties": false, "description": "Shape of usage entered by hand for this metric: the event name and its properties.", "properties": {"editable_properties": {"description": "Properties a person fills in for each entry.", "items": {"$ref": "#/components/schemas/UsageEntryProperty"}, "title": "Editable Properties", "type": "array"}, "event_name": {"description": "Event name given to usage entered by hand.", "examples": ["api_request"], "maxLength": 255, "minLength": 1, "pattern": "^\\S+$", "title": "Event Name", "type": "string"}, "schema_version": {"const": 1, "default": 1, "description": "Version of this schema format. Always `1`.", "examples": [1], "title": "Schema Version", "type": "integer"}}, "required": ["event_name"], "title": "UsageEntrySchema", "type": "object"}, "UsageEvent": {"additionalProperties": false, "description": "A recorded, immutable usage event.", "properties": {"created_at": {"description": "When Relvo recorded the event (UTC).", "examples": ["2026-07-15T14:30:03.000Z"], "format": "date-time", "title": "Created At", "type": "string"}, "customer_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Relvo customer id, once resolved.", "examples": ["01936f2e-1f3a-7e9b-8a7c-6d5e4f3a2b1c"], "title": "Customer Id"}, "event_name": {"description": "Event name the usage was reported under.", "examples": ["api_request"], "title": "Event Name", "type": "string"}, "external_customer_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Customer code the event was sent with.", "examples": ["cust-4821"], "title": "External Customer Id"}, "id": {"description": "Usage event id.", "examples": ["01936f2e-8e0f-7a6b-8c4d-5e6f708192a3"], "format": "uuid", "title": "Id", "type": "string"}, "idempotency_key": {"description": "Idempotency key the event was ingested with.", "examples": ["usage-evt-2026-07-15-001"], "title": "Idempotency Key", "type": "string"}, "properties": {"additionalProperties": {"anyOf": [{"type": "string"}, {"type": "boolean"}]}, "description": "Event dimensions and quantities; quantities are decimal strings.", "examples": [{"endpoint": "/v1/charges", "requests": "42"}], "title": "Properties", "type": "object"}, "source": {"$ref": "#/components/schemas/UsageEventSource", "description": "Channel that recorded the event.", "examples": ["api"]}, "status": {"$ref": "#/components/schemas/UsageEventStatus", "description": "`active` events count toward billing; `voided` and `superseded` events were corrected and do not.", "examples": ["active"]}, "timestamp": {"description": "When the usage occurred (UTC).", "examples": ["2026-07-15T14:30:00.000Z"], "format": "date-time", "title": "Timestamp", "type": "string"}}, "required": ["id", "idempotency_key", "event_name", "source", "status", "timestamp", "created_at", "properties"], "title": "UsageEvent", "type": "object"}, "UsageEventCorrection": {"additionalProperties": false, "description": "Result of a correction.", "properties": {"adjustment_required": {"description": "Whether an already-issued invoice needs a manual adjustment.", "examples": [false], "title": "Adjustment Required", "type": "boolean"}, "operation": {"$ref": "#/components/schemas/UsageEventCorrectionOperation", "description": "Correction applied.", "examples": ["replace"]}, "original_usage_event_id": {"description": "The corrected event.", "examples": ["01936f2e-8e0f-7a6b-8c4d-5e6f708192a3"], "format": "uuid", "title": "Original Usage Event Id", "type": "string"}, "replacement_usage_event_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "The new event, for `replace`.", "examples": ["01936f2e-a02b-7c8d-9e6f-708192a3b4c5"], "title": "Replacement Usage Event Id"}, "rerating_required": {"description": "Whether billing had to be recomputed.", "examples": [true], "title": "Rerating Required", "type": "boolean"}, "rerating_status": {"$ref": "#/components/schemas/UsageReratingStatus", "description": "State of that recomputation.", "examples": ["requested"]}}, "required": ["operation", "original_usage_event_id", "rerating_required", "rerating_status", "adjustment_required"], "title": "UsageEventCorrection", "type": "object"}, "UsageEventCorrectionOperation": {"description": "How a usage event is corrected.\n\n- `void`: retires the event so it no longer counts.\n- `replace`: supersedes the event with a new, corrected one.", "enum": ["void", "replace"], "title": "UsageEventCorrectionOperation", "type": "string"}, "UsageEventIngestResult": {"additionalProperties": false, "description": "Outcome of an ingest batch.", "properties": {"duplicate_idempotency_keys": {"description": "Idempotency keys that had already been accepted with the same body; they were not queued again.", "examples": [["usage-evt-2026-07-14-007"]], "items": {"type": "string"}, "title": "Duplicate Idempotency Keys", "type": "array"}, "receipts": {"description": "One receipt per event that was queued now or had already been accepted with the same body (a duplicate). Poll `GET /usage-event-receipts/{receipt_id}`.", "items": {"$ref": "#/components/schemas/UsageEventReceipt"}, "title": "Receipts", "type": "array"}, "validation_failed": {"description": "Events that were rejected and not queued.", "items": {"$ref": "#/components/schemas/UsageEventValidationFailure"}, "title": "Validation Failed", "type": "array"}}, "required": ["receipts", "duplicate_idempotency_keys", "validation_failed"], "title": "UsageEventIngestResult", "type": "object"}, "UsageEventPage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/UsageEvent"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[UsageEvent]", "type": "object"}, "UsageEventProperties": {"additionalProperties": {"anyOf": [{"type": "string"}, {"type": "boolean"}]}, "description": "A flat map of event dimensions and quantities. Values are strings or booleans; quantities are decimal strings (for example `\"42\"` or `\"0.75\"`), never JSON numbers. Keys must be non-blank, trimmed and at most 128 characters; at most 100 properties are allowed.", "example": {"ratio": "0.75", "region": "us-east", "requests": "42"}, "maxProperties": 100, "title": "UsageEventProperties", "type": "object"}, "UsageEventReceipt": {"additionalProperties": false, "description": "Processing state of one event accepted by `POST /usage-events`.", "properties": {"id": {"description": "Receipt id. This is not the usage event id.", "examples": ["01936f2e-9f1a-7b7c-8d5e-6f708192a3b4"], "format": "uuid", "title": "Id", "type": "string"}, "idempotency_key": {"description": "Idempotency key the event was sent with.", "examples": ["usage-evt-2026-07-15-001"], "title": "Idempotency Key", "type": "string"}, "processed_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When the event was recorded (UTC), if it has been.", "examples": ["2026-07-15T14:30:03.000Z"], "title": "Processed At"}, "received_at": {"description": "When the event was accepted (UTC).", "examples": ["2026-07-15T14:30:01.000Z"], "format": "date-time", "title": "Received At", "type": "string"}, "status": {"$ref": "#/components/schemas/UsageEventReceiptStatus", "description": "`pending` or `processing` while queued, `processed` once recorded (`usage_event_id` is then set), `failed` while retrying, `dead` when it will not be recorded.", "examples": ["processed"]}, "usage_event_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Id of the recorded usage event, once `status` is `processed`.", "examples": ["01936f2e-8e0f-7a6b-8c4d-5e6f708192a3"], "title": "Usage Event Id"}}, "required": ["id", "idempotency_key", "status", "received_at"], "title": "UsageEventReceipt", "type": "object"}, "UsageEventReceiptPage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/UsageEventReceipt"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[UsageEventReceipt]", "type": "object"}, "UsageEventReceiptStatus": {"description": "Processing state of an ingestion receipt.\n\n- `pending`: accepted and waiting to be processed.\n- `processing`: being recorded now.\n- `processed`: recorded as a usage event.\n- `failed`: the last attempt failed; it will be retried.\n- `dead`: retries are exhausted; the event will not be recorded.", "enum": ["pending", "processing", "processed", "failed", "dead"], "title": "UsageEventReceiptStatus", "type": "string"}, "UsageEventReplacementRequest": {"additionalProperties": false, "description": "Fields that differ from the original event. Omitted fields are copied.", "properties": {"customer_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "New Relvo customer id.", "examples": ["01936f2e-1f3a-7e9b-8a7c-6d5e4f3a2b1c"], "title": "Customer Id"}, "event_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "New event name.", "examples": ["api_request"], "title": "Event Name"}, "external_customer_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "New customer code.", "examples": ["cust-4821"], "title": "External Customer Id"}, "properties": {"anyOf": [{"$ref": "#/components/schemas/UsageEventProperties"}, {"type": "null"}], "description": "Replaces the whole property map when sent."}, "timestamp": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "New usage instant, in UTC.", "examples": ["2026-07-15T14:30:00Z"], "title": "Timestamp"}}, "title": "UsageEventReplacementRequest", "type": "object"}, "UsageEventSource": {"description": "Channel that recorded the usage event.\n\n- `api`: sent through the API.\n- `manual`: entered by hand in the dashboard.\n- `csv`: imported from a CSV file.", "enum": ["api", "manual", "csv"], "title": "UsageEventSource", "type": "string"}, "UsageEventStatus": {"description": "Lifecycle status of a recorded usage event.\n\n- `active`: the event counts toward billing.\n- `voided`: the event was retired by a correction and no longer counts.\n- `superseded`: the event was replaced by a corrected event and no longer counts.", "enum": ["active", "voided", "superseded"], "title": "UsageEventStatus", "type": "string"}, "UsageEventValidationFailure": {"additionalProperties": false, "description": "One event of the batch that was not queued.", "properties": {"errors": {"description": "Why the event was rejected.", "examples": [["Event timestamp is more than 1 hour in the future"]], "items": {"type": "string"}, "title": "Errors", "type": "array"}, "idempotency_key": {"description": "Idempotency key of the rejected event.", "examples": ["usage-evt-2026-07-15-001"], "title": "Idempotency Key", "type": "string"}}, "required": ["idempotency_key", "errors"], "title": "UsageEventValidationFailure", "type": "object"}, "UsageEventVolumeBucket": {"additionalProperties": false, "description": "Number of events recorded in one hour.", "properties": {"bucket_end": {"description": "End of the hour (UTC), exclusive.", "examples": ["2026-07-15T15:00:00.000Z"], "format": "date-time", "title": "Bucket End", "type": "string"}, "bucket_start": {"description": "Start of the hour (UTC), inclusive.", "examples": ["2026-07-15T14:00:00.000Z"], "format": "date-time", "title": "Bucket Start", "type": "string"}, "event_count": {"description": "Events whose timestamp falls in the hour.", "examples": [128], "minimum": 0.0, "title": "Event Count", "type": "integer"}}, "required": ["bucket_start", "bucket_end", "event_count"], "title": "UsageEventVolumeBucket", "type": "object"}, "UsageEventVolumeBucketPage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/UsageEventVolumeBucket"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[UsageEventVolumeBucket]", "type": "object"}, "UsageFilter": {"additionalProperties": false, "description": "Limits a price to usage events whose property `key` has one of `values`.", "properties": {"key": {"description": "Usage event property to filter on (letters, digits and underscores).", "examples": ["region"], "maxLength": 255, "minLength": 1, "pattern": "^[a-zA-Z0-9_]+$", "title": "Key", "type": "string"}, "values": {"description": "Accepted values of `key`. Values must be unique and non-empty.", "examples": [["eu"]], "items": {"type": "string"}, "maxItems": 100, "minItems": 1, "title": "Values", "type": "array"}}, "required": ["key", "values"], "title": "UsageFilter", "type": "object"}, "UsagePrice": {"additionalProperties": false, "description": "A usage price: bills the quantity one or more billable metrics measure in the period.", "properties": {"billable_metric_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Billable metric whose quantity is priced. Null for `formula` prices, whose metrics are listed in `pricing.metric_bindings`.", "examples": ["0191f3c1-9b31-7c4d-8e5f-3b2c4d5e6f70"], "title": "Billable Metric Id"}, "created_at": {"description": "When the price was created (UTC).", "examples": ["2026-01-01T00:00:00.000Z"], "format": "date-time", "title": "Created At", "type": "string"}, "currency": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency every amount of this price is expressed in.", "examples": ["CLP"]}, "id": {"description": "Unique identifier of the price.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10"], "format": "uuid", "title": "Id", "type": "string"}, "interval": {"$ref": "#/components/schemas/PriceInterval", "description": "Recurrence; `one_time` for a non-recurring price.", "examples": ["monthly"]}, "item_id": {"description": "Catalog item this price bills for.", "examples": ["0191f3c1-8a20-7b3c-9d4e-2a1b3c4d5e6f"], "format": "uuid", "title": "Item Id", "type": "string"}, "name": {"description": "Display name of the price.", "examples": ["Platform subscription"], "title": "Name", "type": "string"}, "name_on_invoice": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Invoice line label template. Null means the price name is used.", "examples": ["Platform subscription {{month}} {{year}}"], "title": "Name On Invoice"}, "pricing": {"description": "Pricing definition, selected by `model`.", "discriminator": {"mapping": {"formula": "#/components/schemas/FormulaPricing", "graduated": "#/components/schemas/GraduatedPricing", "graduated_percentage": "#/components/schemas/GraduatedPercentagePricing", "package": "#/components/schemas/PackagePricing", "percentage": "#/components/schemas/PercentagePricing", "standard": "#/components/schemas/StandardPricing", "volume": "#/components/schemas/VolumePricing"}, "propertyName": "model"}, "oneOf": [{"$ref": "#/components/schemas/StandardPricing"}, {"$ref": "#/components/schemas/GraduatedPricing"}, {"$ref": "#/components/schemas/VolumePricing"}, {"$ref": "#/components/schemas/PackagePricing"}, {"$ref": "#/components/schemas/PercentagePricing"}, {"$ref": "#/components/schemas/GraduatedPercentagePricing"}, {"$ref": "#/components/schemas/FormulaPricing"}], "title": "Pricing"}, "status": {"$ref": "#/components/schemas/PriceStatus", "description": "Current lifecycle status.", "examples": ["active"]}, "type": {"const": "usage", "description": "Price type discriminator; always `usage` for this object.", "title": "Type", "type": "string"}, "updated_at": {"description": "When the price was last changed (UTC).", "examples": ["2026-01-01T00:00:00.000Z"], "format": "date-time", "title": "Updated At", "type": "string"}, "version": {"description": "Optimistic-concurrency version; send it back as `If-Match`.", "examples": [1], "title": "Version", "type": "integer"}}, "required": ["id", "name", "name_on_invoice", "currency", "interval", "status", "created_at", "updated_at", "version", "pricing", "type", "item_id", "billable_metric_id"], "title": "UsagePrice", "type": "object"}, "UsageReratingStatus": {"description": "Whether billing had to be recomputed after a correction.\n\n- `not_required`: the correction did not affect any billed amount.\n- `requested`: a recomputation was requested and is pending.\n- `completed`: the recomputation finished.\n- `failed`: the recomputation failed.", "enum": ["not_required", "requested", "completed", "failed"], "title": "UsageReratingStatus", "type": "string"}, "UsageSchema": {"additionalProperties": false, "description": "Event names and property keys recorded for the organization.", "properties": {"event_names": {"description": "Distinct event names seen.", "examples": [["api_request", "storage_gb"]], "items": {"type": "string"}, "title": "Event Names", "type": "array"}, "numeric_property_keys": {"additionalProperties": {"items": {"type": "string"}, "type": "array"}, "description": "Per event name, the property keys a live billable metric reads as a number. Ingestion rejects a non-numeric value for them.", "examples": [{"api_request": ["requests"]}], "title": "Numeric Property Keys", "type": "object"}, "property_keys": {"description": "Distinct property keys seen.", "examples": [["endpoint", "requests", "region"]], "items": {"type": "string"}, "title": "Property Keys", "type": "array"}}, "required": ["event_names", "property_keys", "numeric_property_keys"], "title": "UsageSchema", "type": "object"}, "VolumePricing": {"additionalProperties": false, "description": "Volume: the single tier the period total lands in prices every unit.\n\nFor example, with tiers 0-1000 at 10 and 1000+ at 8, a quantity of 1500 bills\n1500 x 8, plus that tier's `flat_amount`.", "properties": {"free_units": {"anyOf": [{"minimum": 0.0, "type": "integer"}, {"type": "null"}], "description": "Usage prices only. Units per period that are not billed; only the quantity above this allowance is priced. Null means no free units.", "examples": [100], "title": "Free Units"}, "model": {"const": "volume", "description": "Pricing model discriminator; always `volume` for this object.", "title": "Model", "type": "string"}, "pricing_group_keys": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "description": "Usage prices only. Billable-metric filter keys the metered quantity is grouped by; each distinct combination of values is priced on its own. Null prices the whole quantity together.", "examples": [["region"]], "title": "Pricing Group Keys"}, "tiers": {"description": "Contiguous tiers, lowest first. The last tier must be open-ended (`up_to: null`).", "items": {"$ref": "#/components/schemas/Tier"}, "minItems": 1, "title": "Tiers", "type": "array"}}, "required": ["model", "tiers"], "title": "VolumePricing", "type": "object"}, "WebhookDelivery": {"additionalProperties": false, "description": "One attempt run to deliver one event to one webhook endpoint.", "properties": {"attempts": {"description": "Attempts made so far.", "examples": [1], "minimum": 0.0, "title": "Attempts", "type": "integer"}, "created_at": {"description": "When the delivery was created.", "examples": ["2026-01-31T12:00:00Z"], "format": "date-time", "title": "Created At", "type": "string"}, "endpoint_id": {"description": "The webhook endpoint this delivery targets.", "examples": ["01909e26-8c1d-7a2b-9e3f-4a5b6c7d8e9f"], "format": "uuid", "title": "Endpoint Id", "type": "string"}, "event_id": {"description": "The envelope `id` of the event being delivered.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a51"], "format": "uuid", "title": "Event Id", "type": "string"}, "event_type": {"$ref": "#/components/schemas/WebhookEventType", "description": "The envelope `type`.", "examples": ["invoice.issued"]}, "generation": {"description": "Increments when Relvo replaces a delivery (e.g. after secret compromise).", "examples": [1], "minimum": 1.0, "title": "Generation", "type": "integer"}, "id": {"description": "Delivery ID.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a50"], "format": "uuid", "title": "Id", "type": "string"}, "last_error": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Diagnostic from the last failed attempt; null if none failed.", "examples": ["HTTP 503 from endpoint"], "title": "Last Error"}, "max_attempts": {"description": "Attempt budget for the current delivery run.", "examples": [8], "minimum": 0.0, "title": "Max Attempts", "type": "integer"}, "next_attempt_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "When the next attempt is due; null when none is scheduled.", "examples": ["2026-01-31T12:05:00Z"], "title": "Next Attempt At"}, "replaces_delivery_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "The delivery this one replaced; null for an original delivery.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a52"], "title": "Replaces Delivery Id"}, "schema_version": {"description": "The envelope `schema_version`.", "examples": [1], "title": "Schema Version", "type": "integer"}, "status": {"$ref": "#/components/schemas/WebhookDeliveryStatus", "description": "`pending` and `retry_scheduled`: waiting for an attempt. `in_flight`: being sent. `delivered`: a 2xx was received. `dead`: all attempts failed. `cancelled`: the endpoint was disabled or deleted first. Only `delivered`, `dead` and `cancelled` can be redelivered.", "examples": ["delivered"]}, "updated_at": {"description": "When the delivery's status last changed.", "examples": ["2026-01-31T12:00:05Z"], "format": "date-time", "title": "Updated At", "type": "string"}}, "required": ["id", "endpoint_id", "event_id", "event_type", "schema_version", "status", "attempts", "max_attempts", "next_attempt_at", "last_error", "generation", "replaces_delivery_id", "created_at", "updated_at"], "title": "WebhookDelivery", "type": "object"}, "WebhookDeliveryPage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/WebhookDelivery"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[PublicWebhookDelivery]", "type": "object"}, "WebhookDeliveryStatus": {"description": "Status of one webhook delivery.\n\n- `pending`: waiting for its first attempt.\n- `retry_scheduled`: an attempt failed; another is scheduled.\n- `in_flight`: an attempt is being sent.\n- `delivered`: your endpoint answered with a 2xx.\n- `dead`: every attempt failed.\n- `cancelled`: the endpoint was disabled or deleted before delivery.", "enum": ["pending", "retry_scheduled", "in_flight", "delivered", "dead", "cancelled"], "title": "WebhookDeliveryStatus", "type": "string"}, "WebhookEndpoint": {"additionalProperties": false, "description": "A URL registered to receive webhook events, with its subscriptions.", "properties": {"endpoint_url": {"description": "Destination URL.", "examples": ["https://hooks.acmecorp.com/relvo"], "title": "Endpoint Url", "type": "string"}, "id": {"description": "Webhook endpoint ID.", "examples": ["01909e26-8c1d-7a2b-9e3f-4a5b6c7d8e9f"], "format": "uuid", "title": "Id", "type": "string"}, "status": {"$ref": "#/components/schemas/WebhookEndpointStatus", "description": "Endpoint lifecycle status. `pending_verification`: receives no deliveries until `POST /public/webhook-endpoints/{endpoint_id}/verify` succeeds. `active`: receives deliveries for its subscriptions. `disabled`: deliveries are paused until `POST /public/webhook-endpoints/{endpoint_id}/enable`. `deleted`: terminal.", "examples": ["active"]}, "subscriptions": {"description": "Subscribed event types, sorted by `event_type`.", "items": {"$ref": "#/components/schemas/WebhookSubscription"}, "title": "Subscriptions", "type": "array"}, "version": {"description": "Optimistic-concurrency version. Send it back as `If-Match` on every write.", "examples": [1], "minimum": 1.0, "title": "Version", "type": "integer"}}, "required": ["id", "endpoint_url", "status", "subscriptions", "version"], "title": "WebhookEndpoint", "type": "object"}, "WebhookEndpointPage": {"additionalProperties": false, "description": "One page of results from a list endpoint.\n\nLists are cursor-paginated. To fetch the next page, call the same endpoint with the same\nfilters and pass `next_cursor` as the `cursor` query parameter. `next_cursor` is `null` on\nthe last page.", "properties": {"items": {"description": "The resources on this page, in the list's deterministic order.", "items": {"$ref": "#/components/schemas/WebhookEndpoint"}, "title": "Items", "type": "array"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor for the next page; pass it back as `cursor` with the same filters. `null` when this is the last page.", "examples": ["eyJrIjoiMDE5MWYzYzEifQ"], "title": "Next Cursor"}}, "required": ["items"], "title": "PublicPage[PublicWebhookEndpoint]", "type": "object"}, "WebhookEndpointStatus": {"description": "Lifecycle status of a webhook endpoint.\n\n- `pending_verification`: registered but receives no deliveries until it is verified.\n- `active`: receives deliveries for its subscriptions.\n- `disabled`: deliveries are paused until the endpoint is enabled again.\n- `deleted`: removed; terminal.", "enum": ["pending_verification", "active", "disabled", "deleted"], "title": "WebhookEndpointStatus", "type": "string"}, "WebhookEndpointWithSecret": {"additionalProperties": false, "description": "A webhook endpoint together with its newly issued signing secret.", "properties": {"endpoint_url": {"description": "Destination URL.", "examples": ["https://hooks.acmecorp.com/relvo"], "title": "Endpoint Url", "type": "string"}, "id": {"description": "Webhook endpoint ID.", "examples": ["01909e26-8c1d-7a2b-9e3f-4a5b6c7d8e9f"], "format": "uuid", "title": "Id", "type": "string"}, "signing_secret": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "The HMAC signing secret, returned **only** by the call that minted it. `null` when the same `Idempotency-Key` is replayed: the secret is never stored in retrievable form, so store it immediately.", "examples": ["q3Zr8Xw1Lk5vN0bT7yHc2Jm9Fd4Sg6Ae1Pu8Ri3Oz5Wx7Ky0Bn2Ml4Vj6Ch9Qt1Ds"], "title": "Signing Secret"}, "status": {"$ref": "#/components/schemas/WebhookEndpointStatus", "description": "Endpoint lifecycle status. `pending_verification`: receives no deliveries until `POST /public/webhook-endpoints/{endpoint_id}/verify` succeeds. `active`: receives deliveries for its subscriptions. `disabled`: deliveries are paused until `POST /public/webhook-endpoints/{endpoint_id}/enable`. `deleted`: terminal.", "examples": ["active"]}, "subscriptions": {"description": "Subscribed event types, sorted by `event_type`.", "items": {"$ref": "#/components/schemas/WebhookSubscription"}, "title": "Subscriptions", "type": "array"}, "version": {"description": "Optimistic-concurrency version. Send it back as `If-Match` on every write.", "examples": [1], "minimum": 1.0, "title": "Version", "type": "integer"}}, "required": ["id", "endpoint_url", "status", "subscriptions", "version", "signing_secret"], "title": "WebhookEndpointWithSecret", "type": "object"}, "WebhookEventType": {"description": "An event a webhook endpoint can subscribe to.\n\n- `invoice.drafted`: an invoice entered draft (created as a draft or promoted from upcoming).\n- `invoice.issued`: an invoice was accepted by the tax authority.\n- `invoice.fiscal_rejected`: an invoice was rejected by the tax authority.\n- `credit_note.issued`: a credit note was accepted by the tax authority.\n- `credit_note.fiscal_rejected`: a credit note was rejected by the tax authority.\n- `debit_note.issued`: a debit note was accepted by the tax authority.\n- `debit_note.fiscal_rejected`: a debit note was rejected by the tax authority.\n- `invoice.payment_received`: a payment was applied to an invoice.\n- `invoice.paid`: an invoice became fully paid.\n- `invoice.voided`: an issued invoice was voided by an accepted correction document.\n- `payment.succeeded`: a payment was confirmed as received.\n- `contract.activated`: a contract was activated.\n- `contract.amended`: an active contract was amended.\n- `contract.cancelled`: a contract was cancelled.\n- `customer.created`: a customer was created.\n- `customer.updated`: a customer was edited.\n- `customer.deleted`: a customer was deleted.\n- `message.received`: an inbound message, such as a customer email, arrived on a conversation.", "enum": ["contract.activated", "contract.amended", "contract.cancelled", "credit_note.fiscal_rejected", "credit_note.issued", "customer.created", "customer.deleted", "customer.updated", "debit_note.fiscal_rejected", "debit_note.issued", "invoice.drafted", "invoice.fiscal_rejected", "invoice.issued", "invoice.paid", "invoice.payment_received", "invoice.voided", "message.received", "payment.succeeded"], "title": "WebhookEventType", "type": "string"}, "WebhookSubscription": {"additionalProperties": false, "description": "One event type, at one payload schema version, that an endpoint receives.", "properties": {"event_type": {"$ref": "#/components/schemas/WebhookEventType", "description": "Public event type to receive. Any value outside the enum is rejected with 422.", "examples": ["invoice.issued"]}, "schema_version": {"description": "Schema version of the event payload. Every public event is at version 1 today.", "examples": [1], "maximum": 1.0, "minimum": 1.0, "title": "Schema Version", "type": "integer"}}, "required": ["event_type", "schema_version"], "title": "WebhookSubscription", "type": "object"}}, "securitySchemes": {"BearerAuth": {"bearerFormat": "API Token", "description": "Organization-scoped API token, sent as `Authorization: Bearer <token>`. Generate a token from **Settings → API Tokens** in the Relvo dashboard. Each token is scoped to a set of permissions enforced per endpoint, and is rate-limited independently of other tokens on the same organization.\n\nEvery operation lists the scopes that grant access to it; holding any one of them is enough. A `<resource>:write` scope also grants `<resource>:read`, and a `full_access` token passes every scope check. A missing or invalid token returns `401`; a valid token without a listed scope returns `403`.", "scheme": "bearer", "type": "http"}}}, "externalDocs": {"description": "Integration guides: authentication, errors, idempotency, webhooks", "url": "https://app.relvoerp.com/docs/product/guides/introduction/"}, "info": {"contact": {"email": "contacto@relvoerp.com", "name": "Relvo", "url": "https://app.relvoerp.com/docs/product/guides/introduction/"}, "description": "The sandbox API uses the same public resources and schemas. Authenticate with an API key from an active sandbox organization. Live organization keys are refused. Generate sandbox clients from this contract so their requests stay under /api/v1/sandbox.", "termsOfService": "https://app.relvoerp.com/terms", "title": "Relvo API — Sandbox", "version": "1.8.1"}, "openapi": "3.1.0", "paths": {"/api/v1/sandbox": {"get": {"description": "**Required scope:** `full_access`", "operationId": "getSandboxIdentity", "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/SandboxIdentity"}}}, "description": "The sandbox identity.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["full_access"]}], "summary": "Identify the environment and organization before running sandbox examples", "tags": ["Sandbox"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["full_access"]}}, "/api/v1/sandbox/catalog/billable-metrics": {"get": {"description": "List the organization's active billable metrics, each as returned by `getBillableMetric` (filters included; `sql_expression` is `null` without the `billable_metrics:sql` scope). `query` matches the name or the invoice name, case-insensitively; repeat `definition_mode` to match several. Ordered by `sort` then `id`; pass `next_cursor` back as `cursor` with identical filters.\n\n**Required scope:** `catalog:read`", "operationId": "listBillableMetrics", "parameters": [{"description": "Only metrics of these modes.", "in": "query", "name": "definition_mode", "required": false, "schema": {"anyOf": [{"items": {"$ref": "#/components/schemas/BillableMetricDefinitionMode"}, "type": "array"}, {"type": "null"}], "description": "Only metrics of these modes.", "title": "Definition Mode"}}, {"description": "Text match on the names.", "in": "query", "name": "query", "required": false, "schema": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Text match on the names.", "title": "Query"}}, {"description": "Only metrics updated at or after this instant.", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "updated_since", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Only metrics updated at or after this instant.", "title": "Updated Since"}}, {"description": "Field to order by: `created_at` (default) or `updated_at`. Rows with equal values are ordered by `id`, so paging is stable.", "in": "query", "name": "sort", "required": false, "schema": {"$ref": "#/components/schemas/SortField", "default": "created_at", "description": "Field to order by: `created_at` (default) or `updated_at`. Rows with equal values are ordered by `id`, so paging is stable.", "examples": ["updated_at"]}}, {"description": "Direction for `sort`: `desc` (default, newest first) or `asc` (oldest first).", "in": "query", "name": "order", "required": false, "schema": {"$ref": "#/components/schemas/SortOrder", "default": "desc", "description": "Direction for `sort`: `desc` (default, newest first) or `asc` (oldest first).", "examples": ["asc"]}}, {"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillableMetricPage"}}}, "description": "One page of billable metrics.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["catalog:read"]}], "summary": "List billable metrics", "tags": ["Billable Metrics"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["catalog:read"]}, "post": {"description": "Create a billable metric. `definition_mode: guided` takes a structured `metric_definition` (event name + aggregation) and Relvo generates the SQL; `definition_mode: sql` takes a raw `sql_expression` and needs the `billable_metrics:sql` scope. Requires an `Idempotency-Key` header.\n\n**Required scope:** `catalog:write`", "operationId": "createBillableMetric", "parameters": [{"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/CreateGuidedBillableMetricRequest"}, {"$ref": "#/components/schemas/CreateSqlBillableMetricRequest"}], "title": "Payload"}}}, "required": true}, "responses": {"201": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillableMetric"}}}, "description": "The created billable metric.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "Location": {"description": "URL of the created resource.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "403": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The body carries `sql_expression` (or `definition_mode: sql`) and the token lacks `billable_metrics:sql` (`insufficient_scope`, `params.required_scope`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`item_id` is unknown or inactive, the guided `metric_definition` does not compile, the fields do not match `definition_mode` (`sql_expression` with `guided`, `metric_definition` with `sql`), or the SQL is unsafe or does not scope event names (`validation_failed`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["catalog:write"]}], "summary": "Create a billable metric", "tags": ["Billable Metrics"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["catalog:write"]}}, "/api/v1/sandbox/catalog/billable-metrics/{billable_metric_id}/evaluate": {"post": {"description": "Compute the metric's current value for one billing entity over `[start, end)` without persisting anything. Read-only, so no `Idempotency-Key` is needed. `evidence.data_visible_through` is the ingestion-visibility cutoff used; it is not a replay of historical corrections.\n\n**Required scope:** `usage_metric_evaluations:read`", "operationId": "evaluateBillableMetric", "parameters": [{"description": "Id of the billable metric.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "billable_metric_id", "required": true, "schema": {"format": "uuid", "title": "Billable Metric Id", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/EvaluateBillableMetricRequest"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillableMetricEvaluation"}}}, "description": "The billable metric evaluation.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The billable metric or billing entity was not found.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The metric's configuration revision differs from `expected_config_revision` (`revision_changed`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The evaluation cannot be computed (`invalid_evaluation`): `end` is not after `start` or the window exceeds 31 days, a filter is not configured on the metric or not filterable, `breakdown_by` is not a breakdown property, the breakdown exceeds 100 rows, or the evaluation ran out of its time budget. A timeframe instant without a UTC offset returns `invalid_timestamp`. Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["usage_metric_evaluations:read"]}], "summary": "Evaluate a billable metric", "tags": ["Billable Metrics"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["usage_metric_evaluations:read"]}}, "/api/v1/sandbox/catalog/billable-metrics/{metric_id}": {"delete": {"description": "Soft-delete a billable metric; historical usage and invoices keep their references. Rejected with `409` while prices still reference it. Requires `If-Match` (`412` when stale, `428` when missing). Returns `204` with no body.\n\n**Required scope:** `catalog:write`", "operationId": "deleteBillableMetric", "parameters": [{"description": "Id of the billable metric.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "metric_id", "required": true, "schema": {"format": "uuid", "title": "Metric Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"204": {"description": "Deleted; no content.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Billable metric not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Active usage prices or open contracts still reference the metric (`billable_metric_in_use`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["catalog:write"]}], "summary": "Delete a billable metric", "tags": ["Billable Metrics"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["catalog:write"]}, "get": {"description": "Fetch one billable metric with its dimensional filters.\n\n**Required scope:** `catalog:read`", "operationId": "getBillableMetric", "parameters": [{"description": "Id of the billable metric.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "metric_id", "required": true, "schema": {"format": "uuid", "title": "Metric Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillableMetric"}}}, "description": "The billable metric.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Billable metric not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["catalog:read"]}], "summary": "Get a billable metric", "tags": ["Billable Metrics"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["catalog:read"]}, "patch": {"description": "Partially update a billable metric; omitted fields are unchanged. The definition (mode, SQL, aggregation) can change only while no price uses the metric (`409` otherwise). Sending `sql_expression` or `definition_mode: sql` needs the `billable_metrics:sql` scope. Requires `If-Match` (`412` when stale, `428` when missing).\n\n**Required scope:** `catalog:write`", "operationId": "updateBillableMetric", "parameters": [{"description": "Id of the billable metric.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "metric_id", "required": true, "schema": {"format": "uuid", "title": "Metric Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UpdateBillableMetricRequest"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillableMetric"}}}, "description": "The updated billable metric.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "403": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The body carries `sql_expression` (or `definition_mode: sql`) and the token lacks `billable_metrics:sql` (`insufficient_scope`, `params.required_scope`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Billable metric not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The definition (mode, SQL, aggregation or filters) changes while active usage prices or open contracts use the metric (`billable_metric_in_use`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`item_id` is unknown or inactive, or the new definition does not compile, does not match `definition_mode`, or is unsafe SQL (`validation_failed`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["catalog:write"]}], "summary": "Update a billable metric", "tags": ["Billable Metrics"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["catalog:write"]}}, "/api/v1/sandbox/catalog/billable-metrics/{metric_id}/filters": {"get": {"description": "List the active dimensional filters of a billable metric in one page. `next_cursor` is always `null`: this collection is bounded (a metric has at most 100 filters).\n\n**Required scope:** `catalog:read`", "operationId": "listBillableMetricFilters", "parameters": [{"description": "Id of the billable metric.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "metric_id", "required": true, "schema": {"format": "uuid", "title": "Metric Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillableMetricFilterPage"}}}, "description": "One page of billable metric filters.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Billable metric not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["catalog:read"]}], "summary": "List billable metric filters", "tags": ["Billable Metrics"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["catalog:read"]}, "post": {"description": "Add dimensional filters, or values to existing filters, on a billable metric. New keys create filters; values for an existing key are merged. Nothing is removed, so prices that reference existing filters keep working. Requires an `Idempotency-Key` header. Returns the whole metric with its new version as `ETag`.\n\n**Required scope:** `catalog:write`", "operationId": "addBillableMetricFilters", "parameters": [{"description": "Id of the billable metric.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "metric_id", "required": true, "schema": {"format": "uuid", "title": "Metric Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/AddBillableMetricFiltersRequest"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillableMetric"}}}, "description": "The updated billable metric.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Billable metric not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The merge would leave the metric with more than 100 active filters (`validation_failed`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["catalog:write"]}], "summary": "Add billable metric filters", "tags": ["Billable Metrics"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["catalog:write"]}}, "/api/v1/sandbox/catalog/items": {"get": {"description": "List the organization's catalog items. Every status is returned unless `status` is given (repeat it to match several). `query` matches the name or description, case-insensitively. Ordered by `sort` then `id`; pass `next_cursor` back as `cursor` with identical filters to read the next page.\n\n**Required scope:** `catalog:read`", "operationId": "listCatalogItems", "parameters": [{"description": "Only items in these statuses.", "in": "query", "name": "status", "required": false, "schema": {"anyOf": [{"items": {"$ref": "#/components/schemas/ItemStatus"}, "type": "array"}, {"type": "null"}], "description": "Only items in these statuses.", "title": "Status"}}, {"description": "Text match on name or description.", "in": "query", "name": "query", "required": false, "schema": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Text match on name or description.", "title": "Query"}}, {"description": "Only items updated at or after this instant.", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "updated_since", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Only items updated at or after this instant.", "title": "Updated Since"}}, {"description": "Field to order by: `created_at` (default) or `updated_at`. Rows with equal values are ordered by `id`, so paging is stable.", "in": "query", "name": "sort", "required": false, "schema": {"$ref": "#/components/schemas/SortField", "default": "created_at", "description": "Field to order by: `created_at` (default) or `updated_at`. Rows with equal values are ordered by `id`, so paging is stable.", "examples": ["updated_at"]}}, {"description": "Direction for `sort`: `desc` (default, newest first) or `asc` (oldest first).", "in": "query", "name": "order", "required": false, "schema": {"$ref": "#/components/schemas/SortOrder", "default": "desc", "description": "Direction for `sort`: `desc` (default, newest first) or `asc` (oldest first).", "examples": ["asc"]}}, {"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CatalogItemPage"}}}, "description": "One page of catalog items.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["catalog:read"]}], "summary": "List catalog items", "tags": ["Catalog Items"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["catalog:read"]}, "post": {"description": "Create a catalog item. Requires an `Idempotency-Key` header: replaying the same key with the same body returns the original item.\n\n**Required scope:** `catalog:write`", "operationId": "createCatalogItem", "parameters": [{"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateCatalogItemRequest"}}}, "required": true}, "responses": {"201": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CatalogItem"}}}, "description": "The created catalog item.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "Location": {"description": "URL of the created resource.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Another item in the organization, including a deleted one, already uses this `name` (`catalog_item_conflict`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["catalog:write"]}], "summary": "Create a catalog item", "tags": ["Catalog Items"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["catalog:write"]}}, "/api/v1/sandbox/catalog/items/{item_id}": {"delete": {"description": "Soft-delete a catalog item. Rejected with `409` while billable metrics, prices or open contracts still depend on it. Requires `If-Match` (`412` when stale, `428` when missing).\n\n**Required scope:** `catalog:write`", "operationId": "deleteCatalogItem", "parameters": [{"description": "Id of the catalog item.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "item_id", "required": true, "schema": {"format": "uuid", "title": "Item Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"204": {"description": "Deleted; no content.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Item not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The item is still referenced by an active billable metric, a fixed, usage or seat price, or a draft, active or amended contract (`catalog_item_in_use`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["catalog:write"]}], "summary": "Delete a catalog item", "tags": ["Catalog Items"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["catalog:write"]}, "get": {"description": "Fetch one catalog item. The `ETag` carries its version for a later `If-Match`.\n\n**Required scope:** `catalog:read`", "operationId": "getCatalogItem", "parameters": [{"description": "Id of the catalog item.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "item_id", "required": true, "schema": {"format": "uuid", "title": "Item Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CatalogItem"}}}, "description": "The catalog item.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Item not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["catalog:read"]}], "summary": "Get a catalog item", "tags": ["Catalog Items"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["catalog:read"]}, "patch": {"description": "Partially update a catalog item; omitted fields are unchanged. Requires `If-Match` with the version from a prior response (`412` when stale, `428` when missing).\n\n**Required scope:** `catalog:write`", "operationId": "updateCatalogItem", "parameters": [{"description": "Id of the catalog item.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "item_id", "required": true, "schema": {"format": "uuid", "title": "Item Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UpdateCatalogItemRequest"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CatalogItem"}}}, "description": "The updated catalog item.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Item not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The new `name` is already used by another item, or the item is being deactivated while still referenced by an active billable metric, a fixed, usage or seat price, or a draft, active or amended contract (`catalog_item_in_use`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["catalog:write"]}], "summary": "Update a catalog item", "tags": ["Catalog Items"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["catalog:write"]}}, "/api/v1/sandbox/catalog/seat-metrics": {"get": {"description": "List active seat metrics, optionally of one contract. `query` matches name, code or invoice name, case-insensitively. Pass `next_cursor` back as `cursor` with identical filters.\n\n**Required scope:** `catalog:read`", "operationId": "listSeatMetrics", "parameters": [{"description": "Only seat metrics of this contract.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "contract_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Only seat metrics of this contract.", "title": "Contract Id"}}, {"description": "Text match on name, code or invoice name.", "in": "query", "name": "query", "required": false, "schema": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Text match on name, code or invoice name.", "title": "Query"}}, {"description": "Only metrics updated at or after this instant.", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "updated_since", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Only metrics updated at or after this instant.", "title": "Updated Since"}}, {"description": "Field to order by: `created_at` (default) or `updated_at`. Rows with equal values are ordered by `id`, so paging is stable.", "in": "query", "name": "sort", "required": false, "schema": {"$ref": "#/components/schemas/SortField", "default": "created_at", "description": "Field to order by: `created_at` (default) or `updated_at`. Rows with equal values are ordered by `id`, so paging is stable.", "examples": ["updated_at"]}}, {"description": "Direction for `sort`: `desc` (default, newest first) or `asc` (oldest first).", "in": "query", "name": "order", "required": false, "schema": {"$ref": "#/components/schemas/SortOrder", "default": "desc", "description": "Direction for `sort`: `desc` (default, newest first) or `asc` (oldest first).", "examples": ["asc"]}}, {"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/SeatMetricPage"}}}, "description": "One page of seat metrics.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["catalog:read"]}], "summary": "List seat metrics", "tags": ["Seat Metrics"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["catalog:read"]}, "post": {"description": "Create a seat metric on a contract. `code` must be unique within the contract. Requires an `Idempotency-Key` header.\n\n**Required scope:** `catalog:write`", "operationId": "createSeatMetric", "parameters": [{"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateSeatMetricRequest"}}}, "required": true}, "responses": {"201": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/SeatMetric"}}}, "description": "The created seat metric.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "Location": {"description": "URL of the created resource.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Another seat metric on the contract already uses this `code` (`seat_metric_code_taken`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`contract_id` does not exist in the organization (`validation_failed`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["catalog:write"]}], "summary": "Create a seat metric", "tags": ["Seat Metrics"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["catalog:write"]}}, "/api/v1/sandbox/catalog/seat-metrics/{seat_metric_id}": {"delete": {"description": "Archive (soft-delete) a seat metric: it disappears from get and list, while recorded seat events and issued invoices keep their reference. Rejected with `409` (`seat_metric_in_use`) while a seat price, or a seat price of a contract that is not completed or cancelled, still reads its quantity from the metric. Requires `If-Match` (`412` when stale, `428` when missing). Deleting an already-deleted metric returns `204`. Returns `204` with no body.\n\n**Required scope:** `catalog:write`", "operationId": "deleteSeatMetric", "parameters": [{"description": "Id of the seat metric.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "seat_metric_id", "required": true, "schema": {"format": "uuid", "title": "Seat Metric Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"204": {"description": "Deleted; no content.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Seat metric not found or deleted (`seat_metric_not_found`)", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Seat prices or open contracts still use the metric (`seat_metric_in_use`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["catalog:write"]}], "summary": "Delete a seat metric", "tags": ["Seat Metrics"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["catalog:write"]}, "get": {"description": "Retrieve one active seat metric by id. Returns its version as `ETag`.\n\n**Required scope:** `catalog:read`", "operationId": "getSeatMetric", "parameters": [{"description": "Id of the seat metric.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "seat_metric_id", "required": true, "schema": {"format": "uuid", "title": "Seat Metric Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/SeatMetric"}}}, "description": "The seat metric.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Seat metric not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["catalog:read"]}], "summary": "Get a seat metric", "tags": ["Seat Metrics"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["catalog:read"]}, "patch": {"description": "Partially update a seat metric's `name`, `name_on_invoice` or `description`; omitted fields are unchanged and `code` / `contract_id` never change. A body that changes nothing returns the metric without a new version. Requires `If-Match` (`412` when stale, `428` when missing); the response carries the new version as `ETag`.\n\n**Required scope:** `catalog:write`", "operationId": "updateSeatMetric", "parameters": [{"description": "Id of the seat metric.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "seat_metric_id", "required": true, "schema": {"format": "uuid", "title": "Seat Metric Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UpdateSeatMetricRequest"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/SeatMetric"}}}, "description": "The updated seat metric.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Seat metric not found or deleted (`seat_metric_not_found`)", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No field sent, or a field is out of range (`validation_failed` with `params.validation_errors`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["catalog:write"]}], "summary": "Update a seat metric", "tags": ["Seat Metrics"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["catalog:write"]}}, "/api/v1/sandbox/commercial-references/parsed": {"get": {"description": "List purchase-order / commercial-reference proposals that the email parser extracted from inbound messages. They are suggestions for review, never yet attached to an invoice. Results are newest first (`created_at` desc, then id desc); pass `next_cursor` back as `cursor` with the same filters until it is null. Filters combine with AND. By default only the latest successful extraction run per message is returned; set `include_previous_runs` to also see proposals from earlier runs. Use `updated_since` to sync only proposals changed at or after an instant.\n\n**Required scope:** `invoices:read`", "operationId": "listParsedCommercialReferences", "parameters": [{"description": "Filter by inbound message ID.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "message_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Filter by inbound message ID.", "title": "Message Id"}}, {"description": "Filter by a candidate invoice ID from the parser context.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "candidate_invoice_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Filter by a candidate invoice ID from the parser context.", "title": "Candidate Invoice Id"}}, {"description": "Filter by extraction run ID.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "extraction_run_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Filter by extraction run ID.", "title": "Extraction Run Id"}}, {"description": "Filter by buyer Chilean RUT. Dots and case are normalized, so `76.086.428-5` and `76086428-5` match the same proposals; an invalid RUT returns 422.", "in": "query", "name": "tin", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Filter by buyer Chilean RUT. Dots and case are normalized, so `76.086.428-5` and `76086428-5` match the same proposals; an invalid RUT returns 422.", "examples": ["76086428-5"], "title": "Tin"}}, {"description": "Include proposals from superseded extraction runs.", "in": "query", "name": "include_previous_runs", "required": false, "schema": {"default": false, "description": "Include proposals from superseded extraction runs.", "title": "Include Previous Runs", "type": "boolean"}}, {"description": "Only proposals whose `updated_at` is at or after this instant (inclusive). Offset required.", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "updated_since", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Only proposals whose `updated_at` is at or after this instant (inclusive). Offset required.", "title": "Updated Since"}}, {"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ParsedCommercialReferencePage"}}}, "description": "One page of parsed commercial references.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`tin` is not a valid Chilean RUT (`validation_failed` with `params.field` = `tin`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:read"]}], "summary": "List parsed commercial-reference proposals", "tags": ["Commercial References"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:read"]}}, "/api/v1/sandbox/commercial-references/parsed/{commercial_reference_id}": {"get": {"description": "Fetch one parser proposal. The `ETag` carries its `version`.\n\n**Required scope:** `invoices:read`", "operationId": "getParsedCommercialReference", "parameters": [{"description": "Id of the parsed commercial reference.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "commercial_reference_id", "required": true, "schema": {"format": "uuid", "title": "Commercial Reference Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ParsedCommercialReference"}}}, "description": "The parsed commercial reference.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`parsed_commercial_reference_not_found`: no such proposal.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:read"]}], "summary": "Get a parsed commercial-reference proposal", "tags": ["Commercial References"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:read"]}}, "/api/v1/sandbox/commercial-references/parsed/{commercial_reference_id}/accept": {"post": {"description": "Accept a `needs_review` reading as extracted (`parse_status` becomes `accepted`). Requires `If-Match` and `Idempotency-Key`; returns the updated proposal and `ETag`.\n\n**Required scope:** `invoices:write`", "operationId": "acceptParsedCommercialReference", "parameters": [{"description": "Id of the parsed commercial reference.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "commercial_reference_id", "required": true, "schema": {"format": "uuid", "title": "Commercial Reference Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ParsedCommercialReference"}}}, "description": "The updated parsed commercial reference.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`parsed_commercial_reference_not_found`: no such proposal.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The proposal is no longer `needs_review` (`commercial_reference_reading_review_not_under_review`), or the reading restates an already registered reference with different facts and can only be rejected (`commercial_reference_reading_review_correction_not_confirmable`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:write"]}], "summary": "Accept a parsed commercial-reference reading", "tags": ["Commercial References"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:write"]}}, "/api/v1/sandbox/commercial-references/parsed/{commercial_reference_id}/reject": {"post": {"description": "Reject a `needs_review` reading (`parse_status` becomes `extraction_failed`); record the correct reference manually. Requires `If-Match` and `Idempotency-Key`; returns the updated proposal and `ETag`.\n\n**Required scope:** `invoices:write`", "operationId": "rejectParsedCommercialReference", "parameters": [{"description": "Id of the parsed commercial reference.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "commercial_reference_id", "required": true, "schema": {"format": "uuid", "title": "Commercial Reference Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ParsedCommercialReference"}}}, "description": "The updated parsed commercial reference.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`parsed_commercial_reference_not_found`: no such proposal.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The proposal is no longer `needs_review` (`commercial_reference_reading_review_not_under_review`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:write"]}], "summary": "Reject a parsed commercial-reference reading", "tags": ["Commercial References"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:write"]}}, "/api/v1/sandbox/contracts": {"get": {"description": "List the contracts of the token's organization, newest first by default. Pass the previous page's `next_cursor` back as `cursor`; a null `next_cursor` is the last page. The cursor is signed and bound to the filters, `sort` and `order` that produced it: replaying it under others is a 400 `invalid_cursor`. No total count is computed.\n\n**Required scope:** `contracts:read`", "operationId": "listContracts", "parameters": [{"description": "Only contracts in these statuses. Repeat the parameter for several.", "in": "query", "name": "status", "required": false, "schema": {"anyOf": [{"items": {"$ref": "#/components/schemas/ContractStatus"}, "type": "array"}, {"type": "null"}], "description": "Only contracts in these statuses. Repeat the parameter for several.", "title": "Status"}}, {"description": "Only contracts of this customer.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "customer_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Only contracts of this customer.", "title": "Customer Id"}}, {"description": "Free-text match on the contract name.", "in": "query", "name": "query", "required": false, "schema": {"anyOf": [{"maxLength": 200, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Free-text match on the contract name.", "title": "Query"}}, {"description": "Only contracts whose current revision changed at or after this instant (RFC 3339, inclusive). An amendment counts as a change.", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "updated_since", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Only contracts whose current revision changed at or after this instant (RFC 3339, inclusive). An amendment counts as a change.", "title": "Updated Since"}}, {"description": "Only contracts carrying an `external_refs[].id` equal to one of these values. Repeatable.", "in": "query", "name": "external_reference", "required": false, "schema": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "description": "Only contracts carrying an `external_refs[].id` equal to one of these values. Repeatable.", "title": "External Reference"}}, {"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}, {"description": "Sort key (ties broken by id). Omitted: relevance when `query` is set, else newest first. `status` orders by lifecycle, not alphabetically.", "in": "query", "name": "sort", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/ContractListSortField"}, {"type": "null"}], "description": "Sort key (ties broken by id). Omitted: relevance when `query` is set, else newest first. `status` orders by lifecycle, not alphabetically.", "title": "Sort"}}, {"description": "Direction for `sort`.", "in": "query", "name": "order", "required": false, "schema": {"$ref": "#/components/schemas/SortOrder", "default": "desc", "description": "Direction for `sort`."}}, {"description": "Only records whose `metadata` holds this key with exactly this string value, sent as `metadata[<key>]=<value>` (for example `metadata[crm_id]=0017`). Repeat with other keys to require all of them (AND). Matching is exact and case-sensitive; a key whose stored value is not a string never matches. At most 10 keys; keys are 1-40 characters without `[` or `]`, values 1-500 characters. A key may appear once. Invalid input is `422 validation_failed`.", "example": {"crm_id": "0017"}, "explode": true, "in": "query", "name": "metadata", "required": false, "schema": {"additionalProperties": {"maxLength": 500, "minLength": 1, "type": "string"}, "maxProperties": 10, "propertyNames": {"maxLength": 40, "minLength": 1, "pattern": "^[^\\[\\]]+$"}, "type": "object"}, "style": "deepObject"}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContractSummaryPage"}}}, "description": "One page of contract summaries.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "403": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The token may not list contracts", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["contracts:read"]}], "summary": "List contracts", "tags": ["Contracts"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["contracts:read"]}, "post": {"description": "Create a contract from its ordered list of phases. Prices are bound by id and must already exist. Requires an `Idempotency-Key` header: replaying the same key with the same body returns the original result; reusing it with a different body is a 409. The response carries the new contract's `ETag` and a `Location`.\n\n**Required scope:** `contracts:write`", "operationId": "createContract", "parameters": [{"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateContractRequest"}}}, "required": true}, "responses": {"201": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Contract"}}}, "description": "The created contract.", "headers": {"ETag": {"description": "Entity tag of the contract version; send it back as `If-Match`."}, "Location": {"description": "URL of the created resource.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "A referenced customer, billing entity or price does not exist", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The contract cannot be created: a bound price is not active (`contract_price_not_active`); or the contract repeats an external reference (`contracts_contract_external_reference_duplicated`), a phase id (`contracts_contract_phase_duplicate_id`), a phase order (`contracts_contract_phase_duplicate_sort_order`), a scheduled phase start (`contracts_contract_phase_duplicate_scheduled_start`), a usage billing key within a phase (`contracts_phase_duplicate_usage_billing_key`) or a quantity metric within a phase (`contracts_phase_duplicate_quantity_metric`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Contract rules reject the request: the issuer billing entity does not have the issuer role or is archived (`contract_invalid`); the phases cannot be built (`validation_failed` with `params.field` = `phases`); `metadata` breaks a bound (`metadata_invalid`, `params.reason`); or the created contract cannot be read back (`contracts_contract_integrity_violation`, `contract_unreadable`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["contracts:write"]}], "summary": "Create a contract", "tags": ["Contracts"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["contracts:write"]}}, "/api/v1/sandbox/contracts/amendment-reconciliations/{reconciliation_id}": {"get": {"description": "Poll the billing reconciliation started by an amendment (the amendment response's `Link` header with `rel=monitor`). Returns 202 while running and 200 once terminal. A system-driven status record without `version`, so it carries no `ETag`.\n\n**Required scope:** `contracts:read`", "operationId": "getContractAmendmentReconciliation", "parameters": [{"description": "Id of the amendment reconciliation.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "reconciliation_id", "required": true, "schema": {"format": "uuid", "title": "Reconciliation Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContractAmendmentReconciliation"}}}, "description": "The contract amendment reconciliation.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "202": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContractAmendmentReconciliation"}}}, "description": "Not terminal; poll again", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Amendment reconciliation not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["contracts:read"]}], "summary": "Get an amendment's billing reconciliation", "tags": ["Contracts"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["contracts:read"]}}, "/api/v1/sandbox/contracts/{contract_id}": {"get": {"description": "Get the current revision of a contract, with its phases and the prices bound to each. `contract_id` is the stable lineage id.\n\n**Required scope:** `contracts:read`", "operationId": "getContract", "parameters": [{"description": "Id of the contract.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "contract_id", "required": true, "schema": {"format": "uuid", "title": "Contract Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Contract"}}}, "description": "The contract.", "headers": {"ETag": {"description": "Entity tag of the contract version; send it back as `If-Match`."}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "403": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The token may not read this contract", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Contract not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The stored contract violates a contract invariant and cannot be returned (`contracts_contract_integrity_violation`, with `params.violation_code`), or cannot be read (`contract_unreadable`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["contracts:read"]}], "summary": "Get a contract", "tags": ["Contracts"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["contracts:read"]}, "patch": {"description": "Amend a contract. `contract_id` is the lineage id: the amendment creates a new revision under the same id and the response is that new current revision. Omitted fields keep their current value; `phases`, when sent, replaces the whole phase list. `amendment_effective_from` keeps the previous terms before that day so invoiced periods are not rewritten. Always answers 200 with the amended contract and its `ETag`. When already-billed periods need billing reconciliation, a `Link` header with `rel=monitor` points at the reconciliation to poll (`getContractAmendmentReconciliation`). Contracts with usage prices must send `phases` (422 `contracts.amendment.phases_required`). A request that sends only `metadata` edits it in place: no new revision, `phases` not required. Requires `If-Match`; no `Idempotency-Key` is needed. `If-Match` is checked first: two concurrent deliveries of the same body against the same version produce one amendment (the second replays it), while a retry sent after the amendment committed carries a version that is no longer current and gets 412 with `params.current_version`. After a 412 on a retry, re-read the contract: if it already shows your change, the earlier attempt succeeded.\n\n**Required scope:** `contracts:write`", "operationId": "updateContract", "parameters": [{"description": "Id of the contract.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "contract_id", "required": true, "schema": {"format": "uuid", "title": "Contract Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UpdateContractRequest"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Contract"}}}, "description": "The updated contract.", "headers": {"ETag": {"description": "Entity tag of the contract version; send it back as `If-Match`."}, "Link": {"description": "Present only while billing reconciliation is pending: `</api/v1/public/contracts/amendment-reconciliations/{id}>; rel=\"monitor\"`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Contract or a referenced resource not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The amendment targets a stale revision of the lineage (`contracts_contract_amendment_lineage_stale`, with `params.current_contract_id`); it removes or rewrites an invoice-routing source that is still in use (`contract_state_conflict`); or a bound price is not active (`contract_price_not_active`); or the contract repeats an external reference (`contracts_contract_external_reference_duplicated`), a phase id (`contracts_contract_phase_duplicate_id`), a phase order (`contracts_contract_phase_duplicate_sort_order`), a scheduled phase start (`contracts_contract_phase_duplicate_scheduled_start`), a usage billing key within a phase (`contracts_phase_duplicate_usage_billing_key`) or a quantity metric within a phase (`contracts_phase_duplicate_quantity_metric`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`phases` was omitted for a contract with usage prices or a price bound more than once (`contracts_amendment_phases_required`); the issuer billing entity does not have the issuer role or is archived (`contract_invalid`); the phases cannot be built (`validation_failed` with `params.field` = `phases`); `metadata` breaks a bound (`metadata_invalid`, `params.reason`); or the contract cannot be read (`contracts_contract_integrity_violation`, `contract_unreadable`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["contracts:write"]}], "summary": "Amend a contract", "tags": ["Contracts"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["contracts:write"]}}, "/api/v1/sandbox/contracts/{contract_id}/activate": {"post": {"description": "Activate a `draft` contract so it starts billing. Requires `If-Match` and `Idempotency-Key`.\n\n**Required scope:** `contracts:write`", "operationId": "activateContract", "parameters": [{"description": "Id of the contract.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "contract_id", "required": true, "schema": {"format": "uuid", "title": "Contract Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Contract"}}}, "description": "The updated contract.", "headers": {"ETag": {"description": "Entity tag of the contract version; send it back as `If-Match`."}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Contract not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The contract is already activated (`contracts_contract_already_activated`), or its start date has not arrived yet (`contracts_contract_cannot_activate_before_start_date`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The stored contract violates a contract invariant and cannot be returned (`contracts_contract_integrity_violation`, with `params.violation_code`), or cannot be read (`contract_unreadable`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["contracts:write"]}], "summary": "Activate a contract", "tags": ["Contracts"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["contracts:write"]}}, "/api/v1/sandbox/contracts/{contract_id}/cancel": {"post": {"description": "Cancel a contract now (`immediate`) or at a requested cutoff (`requested_date`): exactly one of `cancellation_date` (inclusive last service day, billing timezone) or offset-aware `effective_at`. A future cutoff schedules the cancellation; a past one backdates it. Issued invoices are never changed, so the cutoff can never fall inside service already on an open invoice. Requires `If-Match` and `Idempotency-Key`.\n\n**Required scope:** `contracts:write`", "operationId": "cancelContract", "parameters": [{"description": "Id of the contract.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "contract_id", "required": true, "schema": {"format": "uuid", "title": "Contract Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CancelContractRequest"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Contract"}}}, "description": "The updated contract.", "headers": {"ETag": {"description": "Entity tag of the contract version; send it back as `If-Match`."}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Contract not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The contract is already completed or cancelled (`contracts_contract_already_terminal`), a future cancellation was requested for a contract that is not active (`contracts_contract_cannot_schedule_cancellation_non_active`), or the cutoff falls before the end of service already on an open invoice (`contracts_contract_cancellation_precedes_invoiced_period`; `params.earliest_cancellation_date` is the first allowed `cancellation_date`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The stored contract violates a contract invariant and cannot be returned (`contracts_contract_integrity_violation`, with `params.violation_code`), or cannot be read (`contract_unreadable`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["contracts:write"]}], "summary": "Cancel a contract", "tags": ["Contracts"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["contracts:write"]}}, "/api/v1/sandbox/contracts/{contract_id}/comments": {"get": {"description": "Read the current revision's operational comments.\n\n**Required scope:** `contracts:read`", "operationId": "getContractComments", "parameters": [{"description": "Id of the contract.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "contract_id", "required": true, "schema": {"format": "uuid", "title": "Contract Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContractComments"}}}, "description": "The contract comments.", "headers": {"ETag": {"description": "Entity tag of the contract version; send it back as `If-Match`."}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Contract not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["contracts:read"]}], "summary": "Get a contract's comments", "tags": ["Contracts"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["contracts:read"]}, "put": {"description": "Replace the current revision's operational comments; send null to clear them. Requires `If-Match`; no `Idempotency-Key` is needed.\n\n**Required scope:** `contracts:write`", "operationId": "updateContractComments", "parameters": [{"description": "Id of the contract.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "contract_id", "required": true, "schema": {"format": "uuid", "title": "Contract Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UpdateContractCommentsRequest"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContractComments"}}}, "description": "The updated contract comments.", "headers": {"ETag": {"description": "Entity tag of the contract version; send it back as `If-Match`."}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Contract not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The stored contract violates a contract invariant and cannot be returned (`contracts_contract_integrity_violation`, with `params.violation_code`), or cannot be read (`contract_unreadable`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["contracts:write"]}], "summary": "Replace a contract's comments", "tags": ["Contracts"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["contracts:write"]}}, "/api/v1/sandbox/contracts/{contract_id}/documents": {"get": {"description": "PDFs attached to the contract lineage (`contract_id` is the lineage id), oldest first, including superseded ones; `is_current` marks the live version of each. Cursor-paginated: pass `next_cursor` back as `cursor` until it is null.\n\n**Required scope:** `contracts:read`", "operationId": "listContractDocuments", "parameters": [{"description": "Id of the contract.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "contract_id", "required": true, "schema": {"format": "uuid", "title": "Contract Id", "type": "string"}}, {"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContractDocumentList"}}}, "description": "One page of contract documents.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Contract not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["contracts:read"]}], "summary": "List a contract's documents", "tags": ["Contracts"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["contracts:read"]}, "post": {"description": "Attach immutable PDF evidence to an existing contract lineage. Requires an `Idempotency-Key` header; an identical retry returns the original document. `Location` names the new document. Documents are immutable, so they carry no `ETag`.\n\n**Required scope:** `contracts:write`", "operationId": "attachContractDocument", "parameters": [{"description": "Id of the contract.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "contract_id", "required": true, "schema": {"format": "uuid", "title": "Contract Id", "type": "string"}}, {"description": "Role the document plays in the agreement. Required.", "in": "query", "name": "kind", "required": true, "schema": {"$ref": "#/components/schemas/ContractDocumentKind", "description": "Role the document plays in the agreement. Required.", "examples": ["principal_agreement"]}}, {"description": "Human-readable title of the document; surrounding whitespace is trimmed. Required. Also the source of the stored filename when `filename` is omitted.", "in": "query", "name": "title", "required": true, "schema": {"description": "Human-readable title of the document; surrounding whitespace is trimmed. Required. Also the source of the stored filename when `filename` is omitted.", "examples": ["Master Services Agreement 2026"], "maxLength": 200, "minLength": 1, "title": "Title", "type": "string"}}, {"description": "Contract revision this document backs; must not exceed the contract's latest revision. When omitted, the document backs the contract as a whole rather than one revision.", "in": "query", "name": "revision_number", "required": false, "schema": {"anyOf": [{"minimum": 1, "type": "integer"}, {"type": "null"}], "description": "Contract revision this document backs; must not exceed the contract's latest revision. When omitted, the document backs the contract as a whole rather than one revision.", "examples": [2], "title": "Revision Number"}}, {"description": "Date the document was signed. When omitted, the document is stored without a signing date (`signed_on` is null).", "example": "2026-01-31", "in": "query", "name": "signed_on", "required": false, "schema": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Date the document was signed. When omitted, the document is stored without a signing date (`signed_on` is null).", "examples": ["2026-01-01"], "title": "Signed On"}}, {"description": "Current document of the same contract that this upload replaces; the replaced document stays readable but is no longer current. A document can be replaced only once. When omitted, the new document replaces none.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "supersedes_document_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Current document of the same contract that this upload replaces; the replaced document stays readable but is no longer current. A document can be replaced only once. When omitted, the new document replaces none.", "examples": ["0191f3c1-7c1e-7a51-b1b2-6f0c3f1d9a12"], "title": "Supersedes Document Id"}}, {"description": "Original filename, kept as display metadata only. When omitted or unusable, the filename is derived from `title` as `<title>.pdf`.", "in": "query", "name": "filename", "required": false, "schema": {"anyOf": [{"maxLength": 255, "type": "string"}, {"type": "null"}], "description": "Original filename, kept as display metadata only. When omitted or unusable, the filename is derived from `title` as `<title>.pdf`.", "examples": ["msa-2026-signed.pdf"], "title": "Filename"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/pdf": {"schema": {"format": "binary", "type": "string"}}}, "required": true}, "responses": {"201": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContractDocument"}}}, "description": "The created contract document.", "headers": {"Location": {"description": "URL of the created resource.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Contract or superseded document not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The document named by `supersedes_document_id` has already been replaced (`contracts_contract_document_already_superseded`), or belongs to a different contract (`contracts_contract_document_supersede_across_contracts`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "413": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "PDF exceeds 20 MiB", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "415": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Request body is not application/pdf", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The body is not an intact PDF of at most 20 MiB (`contract_document_pdf_invalid`); the trimmed `title` is empty (`contracts_contract_document_invalid`); or `revision_number` is beyond the contract's latest revision (`contracts_contract_document_revision_unknown`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["contracts:write"]}], "summary": "Attach a PDF document to a contract", "tags": ["Contracts"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["contracts:write"]}}, "/api/v1/sandbox/contracts/{contract_id}/documents/{document_id}": {"get": {"description": "Metadata of one document attached to the contract lineage.\n\n**Required scope:** `contracts:read`", "operationId": "getContractDocument", "parameters": [{"description": "Id of the contract.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "contract_id", "required": true, "schema": {"format": "uuid", "title": "Contract Id", "type": "string"}}, {"description": "Id of the contract document.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "document_id", "required": true, "schema": {"format": "uuid", "title": "Document Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContractDocument"}}}, "description": "The contract document.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Contract or document not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["contracts:read"]}], "summary": "Get a contract document", "tags": ["Contracts"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["contracts:read"]}}, "/api/v1/sandbox/contracts/{contract_id}/pause": {"post": {"description": "Pause an `active` contract and stop future billing. The body is optional. Requires `If-Match` and `Idempotency-Key`.\n\n**Required scope:** `contracts:write`", "operationId": "pauseContract", "parameters": [{"description": "Id of the contract.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "contract_id", "required": true, "schema": {"format": "uuid", "title": "Contract Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/PauseContractRequest"}, {"type": "null"}], "title": "Payload"}}}}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Contract"}}}, "description": "The updated contract.", "headers": {"ETag": {"description": "Entity tag of the contract version; send it back as `If-Match`."}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Contract not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "A pause effective in the future was requested; pauses take effect now (`contract_state_conflict`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The stored contract violates a contract invariant and cannot be returned (`contracts_contract_integrity_violation`, with `params.violation_code`), or cannot be read (`contract_unreadable`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["contracts:write"]}], "summary": "Pause a contract", "tags": ["Contracts"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["contracts:write"]}}, "/api/v1/sandbox/contracts/{contract_id}/phases/{phase_id}/complete": {"post": {"description": "Complete a started `milestone` phase at `completed_at` (not in the future); the phase's billing runs at once. Requires `If-Match` and `Idempotency-Key`.\n\n**Required scope:** `contracts:write`", "operationId": "completeContractMilestonePhase", "parameters": [{"description": "Id of the contract.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "contract_id", "required": true, "schema": {"format": "uuid", "title": "Contract Id", "type": "string"}}, {"description": "Id of the contract phase.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "phase_id", "required": true, "schema": {"format": "uuid", "title": "Phase Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompleteMilestonePhaseRequest"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Contract"}}}, "description": "The updated contract.", "headers": {"ETag": {"description": "Entity tag of the contract version; send it back as `If-Match`."}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Contract not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The contract is not active (`contract_not_active`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`completed_at` is in the future (`validation_failed` with `params.field` = `completed_at`). The stored contract violates a contract invariant and cannot be returned (`contracts_contract_integrity_violation`, with `params.violation_code`), or cannot be read (`contract_unreadable`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["contracts:write"]}], "summary": "Complete a milestone phase", "tags": ["Contracts"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["contracts:write"]}}, "/api/v1/sandbox/contracts/{contract_id}/phases/{phase_id}/start": {"post": {"description": "Start a `milestone` phase of an active contract. `started_at` defaults to now and must not be in the future. The body is optional. Requires `If-Match` and `Idempotency-Key`.\n\n**Required scope:** `contracts:write`", "operationId": "startContractMilestonePhase", "parameters": [{"description": "Id of the contract.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "contract_id", "required": true, "schema": {"format": "uuid", "title": "Contract Id", "type": "string"}}, {"description": "Id of the contract phase.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "phase_id", "required": true, "schema": {"format": "uuid", "title": "Phase Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/StartMilestonePhaseRequest"}, {"type": "null"}], "title": "Payload"}}}}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Contract"}}}, "description": "The updated contract.", "headers": {"ETag": {"description": "Entity tag of the contract version; send it back as `If-Match`."}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Contract not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The contract is not active (`contract_not_active`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`started_at` is in the future (`validation_failed` with `params.field` = `started_at`). The stored contract violates a contract invariant and cannot be returned (`contracts_contract_integrity_violation`, with `params.violation_code`), or cannot be read (`contract_unreadable`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["contracts:write"]}], "summary": "Start a milestone phase", "tags": ["Contracts"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["contracts:write"]}}, "/api/v1/sandbox/contracts/{contract_id}/reinstate": {"post": {"description": "Return a `cancelled` contract to `active` when the cancellation itself was a mistake. Refused with 409 when the cancellation left billing documents that need a correction flow first. Requires `If-Match` and `Idempotency-Key`.\n\n**Required scope:** `contracts:write`", "operationId": "reinstateContract", "parameters": [{"description": "Id of the contract.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "contract_id", "required": true, "schema": {"format": "uuid", "title": "Contract Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReinstateContractRequest"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Contract"}}}, "description": "The updated contract.", "headers": {"ETag": {"description": "Entity tag of the contract version; send it back as `If-Match`."}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Contract not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The cancelled contract has billing activity since its cancellation that reinstatement would contradict (`contracts_contract_reinstatement_conflict_billing_footprint`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The stored contract violates a contract invariant and cannot be returned (`contracts_contract_integrity_violation`, with `params.violation_code`), or cannot be read (`contract_unreadable`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["contracts:write"]}], "summary": "Reinstate a mistakenly cancelled contract", "tags": ["Contracts"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["contracts:write"]}}, "/api/v1/sandbox/contracts/{contract_id}/resume": {"post": {"description": "Resume a `paused` contract now. `billing_cycle_anchor` keeps the billing cycle (`unchanged`) or restarts it on the resume day. The body is optional. Requires `If-Match` and `Idempotency-Key`.\n\n**Required scope:** `contracts:write`", "operationId": "resumeContract", "parameters": [{"description": "Id of the contract.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "contract_id", "required": true, "schema": {"format": "uuid", "title": "Contract Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/ResumeContractRequest"}, {"type": "null"}], "title": "Payload"}}}}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Contract"}}}, "description": "The updated contract.", "headers": {"ETag": {"description": "Entity tag of the contract version; send it back as `If-Match`."}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Contract not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The stored contract violates a contract invariant and cannot be returned (`contracts_contract_integrity_violation`, with `params.violation_code`), or cannot be read (`contract_unreadable`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["contracts:write"]}], "summary": "Resume a paused contract", "tags": ["Contracts"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["contracts:write"]}}, "/api/v1/sandbox/contracts/{contract_id}/settings": {"get": {"description": "Settings follow the stable contract lineage across amendments. Null overrides inherit current organization defaults. ETag versions the overrides; inherited values can change independently.\n\n**Required scope:** `contracts:read`", "operationId": "getContractSettingsPublic", "parameters": [{"description": "Id of the contract.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "contract_id", "required": true, "schema": {"format": "uuid", "title": "Contract Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContractSettingsResponse"}}}, "description": "The contract settings response.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["contracts:read"]}], "summary": "Get contract settings and effective values", "tags": ["Contracts"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["contracts:read"]}, "patch": {"description": "Requires Idempotency-Key and If-Match from GET settings. Omitted fields are preserved; null restores inheritance. Presentation changes apply to subsequent PDF requests, including older billing periods. Activating invoicing-currency presentation also saves missing official FX on existing drafts, without replacing saved rates; an API token needs full_access for that field.\n\n**Required scope:** `contracts:write`", "operationId": "updateContractSettingsPublic", "parameters": [{"description": "Id of the contract.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "contract_id", "required": true, "schema": {"format": "uuid", "title": "Contract Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UpdateContractSettingsRequest"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContractSettingsResponse"}}}, "description": "The updated contract settings response.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Contract not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Idempotency key reused with different input\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["contracts:write"]}], "summary": "Update contract setting overrides", "tags": ["Contracts"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["contracts:write"]}}, "/api/v1/sandbox/credit-grants": {"get": {"description": "List stable customer and phase grant resources with current availability. Use either after or before to navigate the selected creation order. Reads never issue, refresh or consume credits. Requires credits:read.\n\n**Required scope:** `credits:read`", "operationId": "listCustomerCreditGrants", "parameters": [{"description": "Filter grants for this customer, including scheduled phase grants.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "customerId", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Filter grants for this customer, including scheduled phase grants.", "title": "Customerid"}}, {"description": "Filter phase grants by amendment-stable contract lineage ID; excludes customer-wide grants.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "contractId", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Filter phase grants by amendment-stable contract lineage ID; excludes customer-wide grants.", "title": "Contractid"}}, {"description": "Page size, 1–100; defaults to 20.", "in": "query", "name": "limit", "required": false, "schema": {"default": 20, "description": "Page size, 1–100; defaults to 20.", "maximum": 100, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Creation order with stable ID ties; defaults to DESC.", "in": "query", "name": "sortOrder", "required": false, "schema": {"default": "DESC", "description": "Creation order with stable ID ties; defaults to DESC.", "enum": ["ASC", "DESC"], "title": "Sortorder", "type": "string"}}, {"description": "Opaque cursor after the preceding page; cannot be combined with before.", "in": "query", "name": "after", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor after the preceding page; cannot be combined with before.", "title": "After"}}, {"description": "Opaque cursor before the following page; cannot be combined with after.", "in": "query", "name": "before", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Opaque cursor before the following page; cannot be combined with after.", "title": "Before"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/GrantPage"}}}, "description": "A keyset page of grants and navigation cursors.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["credits:read"]}], "summary": "List credit grants", "tags": ["Credit Grants"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["credits:read"]}, "post": {"description": "Create one customer-owned currency grant using the customer's single active billing profile; ambiguous or missing profiles are rejected. For an explicit billing_entity_id, metric credits or a purchase invoice draft, use POST /credits/grants instead. The full response is PENDING with no usable balance; a durable worker issues it after commit. Repeating the same account-scoped Idempotency-Key replays the original response permanently. Amounts are exact JSON numbers with up to fifteen integer and ten fractional digits. Requires credits:write.\n\n**Required scope:** `credits:write`", "operationId": "createCustomerCreditGrant", "parameters": [{"description": "Permanent account-scoped request marker; 1–255 printable ASCII characters. Reusing it with different terms fails.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"description": "Permanent account-scoped request marker; 1–255 printable ASCII characters. Reusing it with different terms fails.", "maxLength": 255, "minLength": 1, "title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/FlatCreateGrant"}}}, "required": true}, "responses": {"201": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditGrant"}}}, "description": "The created grant, normally pending asynchronous issuance.", "headers": {"Location": {"description": "URL of the created resource.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["credits:write"]}], "summary": "Create a customer credit grant", "tags": ["Credit Grants"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["credits:write"]}}, "/api/v1/sandbox/credit-grants/{grant_id}": {"get": {"description": "Retrieve a stable credit grant, including before its first issuance. Recurring refreshes preserve this ID while immutable financial allowance IDs remain private. Requires credits:read.\n\n**Required scope:** `credits:read`", "operationId": "getCustomerCreditGrant", "parameters": [{"description": "Stable customer grant ID or authored phase credit schedule ID.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "grant_id", "required": true, "schema": {"description": "Stable customer grant ID or authored phase credit schedule ID.", "format": "uuid", "title": "Grant Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditGrant"}}}, "description": "The configured grant and its currently available balance.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["credits:read"]}], "summary": "Get a credit grant", "tags": ["Credit Grants"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["credits:read"]}}, "/api/v1/sandbox/credit-notes": {"get": {"description": "List the organization's credit notes. Ordered newest first by `created_at` (ties broken by id) and paged with an opaque keyset cursor: pass `next_cursor` back as `cursor` with the same filters; `next_cursor` is null on the last page. Filters combine with AND; a repeated `customer_id` matches any of the values.\n\n**Required scope:** `invoices:read`", "operationId": "listCreditNotes", "parameters": [{"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}, {"description": "Only notes for these customers (at most 100).", "in": "query", "name": "customer_id", "required": false, "schema": {"default": [], "description": "Only notes for these customers (at most 100).", "items": {"format": "uuid", "type": "string"}, "maxItems": 100, "title": "Customer Id", "type": "array"}}, {"description": "Only notes crediting this invoice.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "invoice_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Only notes crediting this invoice.", "title": "Invoice Id"}}, {"description": "Only notes in any of these statuses (repeatable).", "in": "query", "name": "status", "required": false, "schema": {"default": [], "description": "Only notes in any of these statuses (repeatable).", "items": {"$ref": "#/components/schemas/CorrectionNoteStatus"}, "title": "Status", "type": "array"}}, {"description": "Only notes in any of these tax-authority statuses (repeatable).", "in": "query", "name": "fiscal_status", "required": false, "schema": {"default": [], "description": "Only notes in any of these tax-authority statuses (repeatable).", "items": {"$ref": "#/components/schemas/FiscalStatus"}, "title": "Fiscal Status", "type": "array"}}, {"description": "Issue date on or after.", "example": "2026-01-31", "in": "query", "name": "issue_date_from", "required": false, "schema": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Issue date on or after.", "title": "Issue Date From"}}, {"description": "Issue date on or before.", "example": "2026-01-31", "in": "query", "name": "issue_date_to", "required": false, "schema": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Issue date on or before.", "title": "Issue Date To"}}, {"description": "Only notes changed at or after this instant (RFC 3339).", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "updated_since", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Only notes changed at or after this instant (RFC 3339).", "title": "Updated Since"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditNoteList"}}}, "description": "One page of credit notes.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:read"]}], "summary": "List credit notes", "tags": ["Credit Notes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:read"]}, "post": {"description": "Create a `draft` credit note against an issued invoice. Omit `lines` to credit everything that remains on the invoice; send lines for a partial credit. A draft has no fiscal effect until it is issued. Requires an `Idempotency-Key` header: retrying with the same key and body replays the original result; reusing it with a different body is a 409. `If-Match` must carry the **source invoice's** current `version` (its ETag), so the note is computed against the invoice state you saw; missing is 428, stale is 412. The response `ETag` is the new note's `version`.\n\n**Required scope:** `invoices:write`", "operationId": "createCreditNote", "parameters": [{"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditNoteCreate"}}}, "required": true}, "responses": {"201": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditNote"}}}, "description": "The new draft note. `ETag` carries its version; `Location` its URL.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "Location": {"description": "URL of the created resource.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The source invoice does not exist in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The source invoice cannot take this correction: it is not `open` and fiscally accepted, lacks frozen fiscal evidence, has no outstanding amount, or the requested lines exceed what remains to correct; `params.detail` names the reason (`invoicing_next_correction_note_source_invoice_invalid`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:write"]}], "summary": "Create a draft credit note", "tags": ["Credit Notes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:write"]}}, "/api/v1/sandbox/credit-notes/{credit_note_id}": {"delete": {"description": "Discard a `draft` note that was never issued. The note moves to `cancelled` and keeps no fiscal effect; it still appears in lists filtered by `status=cancelled`. `If-Match` must carry the note's current `version` (missing 428, stale 412). No `Idempotency-Key` is needed: a retry with the same `If-Match` is safe.\n\n**Required scope:** `invoices:write`", "operationId": "deleteCreditNote", "parameters": [{"description": "Credit note id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "credit_note_id", "required": true, "schema": {"description": "Credit note id.", "format": "uuid", "title": "Credit Note Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"204": {"description": "The draft was discarded; it never had a fiscal effect.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such note in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Only a `draft` note can be discarded; void an issued one instead (`invoicing_next_credit_note_lifecycle_status_invalid`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:write"]}], "summary": "Discard a draft credit note", "tags": ["Credit Notes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:write"]}, "get": {"description": "Fetch one credit note. The `ETag` is its `version`, to send as `If-Match`.\n\n**Required scope:** `invoices:read`", "operationId": "getCreditNote", "parameters": [{"description": "Credit note id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "credit_note_id", "required": true, "schema": {"description": "Credit note id.", "format": "uuid", "title": "Credit Note Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditNote"}}}, "description": "The credit note.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such note in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:read"]}], "summary": "Get a credit note", "tags": ["Credit Notes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:read"]}}, "/api/v1/sandbox/credit-notes/{credit_note_id}/issue": {"post": {"description": "Issue a `draft` note (it becomes `open`) with the given issue date and queue its fiscal document; `fiscal.status` then moves asynchronously. Requires an `Idempotency-Key` header: retrying with the same key and body replays the original result; reusing it with a different body is a 409. `If-Match` must carry the note's current `version`; missing is 428, stale is 412. The response `ETag` is the note's new `version`.\n\n**Required scope:** `invoices:write`", "operationId": "issueCreditNote", "parameters": [{"description": "Credit note id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "credit_note_id", "required": true, "schema": {"description": "Credit note id.", "format": "uuid", "title": "Credit Note Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditNoteIssue"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditNote"}}}, "description": "The note after the action. `ETag` carries its new version.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such note in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The note is not a `draft` (`invoicing_next_credit_note_lifecycle_status_invalid`); the source invoice changed since the draft was computed, so recreate it (`invoicing_next_credit_note_source_stale`); or the source invoice cannot take this correction: it is not `open` and fiscally accepted, lacks frozen fiscal evidence, has no outstanding amount, or the requested lines exceed what remains to correct; `params.detail` names the reason (`invoicing_next_correction_note_source_invoice_invalid`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:write"]}], "summary": "Issue a draft credit note", "tags": ["Credit Notes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:write"]}}, "/api/v1/sandbox/credit-notes/{credit_note_id}/pdf": {"get": {"description": "The authority-rendered PDF of an issued credit note. 404 until the fiscal authority has produced it; 503 when artifact storage is temporarily unavailable (retry). The `ETag` is the file's SHA-256.\n\n**Required scope:** `invoices:read`", "operationId": "getCreditNotePdf", "parameters": [{"description": "Credit note id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "credit_note_id", "required": true, "schema": {"description": "Credit note id.", "format": "uuid", "title": "Credit Note Id", "type": "string"}}], "responses": {"200": {"content": {"application/pdf": {"schema": {"format": "binary", "type": "string"}}}, "description": "The authority-rendered fiscal PDF", "headers": {"ETag": {"description": "SHA-256 checksum of the document bytes.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The document does not exist for this organization, or has no stored artifact", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "503": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Artifact storage is temporarily unavailable; the request may be retried", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:read"]}], "summary": "Download the fiscal PDF", "tags": ["Credit Notes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:read"]}}, "/api/v1/sandbox/credit-notes/{credit_note_id}/void": {"post": {"description": "Void an issued note. Takes no body; the lifecycle decides whether the note can still be voided (409 otherwise). A draft is discarded with `DELETE` instead. Requires an `Idempotency-Key` header: retrying with the same key and body replays the original result; reusing it with a different body is a 409. `If-Match` must carry the note's current `version`; missing is 428, stale is 412. The response `ETag` is the note's new `version`.\n\n**Required scope:** `invoices:write`", "operationId": "voidCreditNote", "parameters": [{"description": "Credit note id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "credit_note_id", "required": true, "schema": {"description": "Credit note id.", "format": "uuid", "title": "Credit Note Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditNote"}}}, "description": "The note after the action. `ETag` carries its new version.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such note in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The note is not `open` (`invoicing_next_credit_note_lifecycle_status_invalid`), or its fiscal submission is pending or accepted, so it can only be corrected by another document (`invoicing_next_credit_note_fiscal_status_invalid`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:write"]}], "summary": "Void a credit note", "tags": ["Credit Notes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:write"]}}, "/api/v1/sandbox/credit-notes/{credit_note_id}/xml": {"get": {"description": "The authority-stamped XML of an issued credit note. 404 until the fiscal authority has produced it; 503 when artifact storage is temporarily unavailable (retry). The `ETag` is the file's SHA-256.\n\n**Required scope:** `invoices:read`", "operationId": "getCreditNoteXml", "parameters": [{"description": "Credit note id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "credit_note_id", "required": true, "schema": {"description": "Credit note id.", "format": "uuid", "title": "Credit Note Id", "type": "string"}}], "responses": {"200": {"content": {"application/xml": {"schema": {"format": "binary", "type": "string"}}, "text/xml": {"schema": {"format": "binary", "type": "string"}}}, "description": "The authority-rendered fiscal XML", "headers": {"ETag": {"description": "SHA-256 checksum of the document bytes.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The document does not exist for this organization, or has no stored artifact", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "503": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Artifact storage is temporarily unavailable; the request may be retried", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:read"]}], "summary": "Download the fiscal XML", "tags": ["Credit Notes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:read"]}}, "/api/v1/sandbox/credits/balances": {"get": {"description": "Return all balances for one customer, separately by billing entity and exact currency or metric. Spendability accounts for reservations and the effective window. This complete customer result has no further page. Requires credits:read.\n\n**Required scope:** `credits:read`", "operationId": "listFinancialCreditBalances", "parameters": [{"description": "Customer whose complete scoped balances are requested.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "customer_id", "required": true, "schema": {"description": "Customer whose complete scoped balances are requested.", "format": "uuid", "title": "Customer Id", "type": "string"}}, {"description": "Filter by customer billing entity.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "billing_entity_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Filter by customer billing entity.", "title": "Billing Entity Id"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditBalancePage"}}}, "description": "One page of credit balances.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`credits_not_found`: billing entity unavailable in the requested customer scope.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["credits:read"]}], "summary": "Read customer credit balances", "tags": ["Credit Balances & History"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["credits:read"]}}, "/api/v1/sandbox/credits/customers": {"get": {"description": "Page customers before aggregating their complete financial credit balances. Assets and billing entities remain separate; no browser permissions or display-only state is returned. Requires credits:read.\n\n**Required scope:** `credits:read`", "operationId": "listFinancialCreditCustomers", "parameters": [{"description": "Filter by customer.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "customer_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Filter by customer.", "title": "Customer Id"}}, {"description": "Filter by customer billing entity.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "billing_entity_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Filter by customer billing entity.", "title": "Billing Entity Id"}}, {"description": "Literal customer-name search.", "in": "query", "name": "search", "required": false, "schema": {"default": "", "description": "Literal customer-name search.", "maxLength": 200, "title": "Search", "type": "string"}}, {"description": "Maximum number of results, between 1 and 100.", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of results, between 1 and 100.", "maximum": 100, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditCustomerSummaryPage"}}}, "description": "One page of credit customer summaries.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`credits_not_found`: a scoped billing entity is unavailable.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["credits:read"]}], "summary": "List customers with credits", "tags": ["Credit Balances & History"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["credits:read"]}}, "/api/v1/sandbox/credits/grants": {"get": {"description": "List financial allowances with immutable terms and exact capacity counters. Includes customer and contract allowances; use grant_scope=customer for customer-wide credits. IDs here identify individual allowances; recurring configuration IDs are returned by /credit-grants. Currency, metric and billing-entity scopes remain separate. Cursors are signed and bound to the organization and filters. Requires credits:read.\n\n**Required scope:** `credits:read`", "operationId": "listFinancialCreditGrants", "parameters": [{"description": "Filter by customer.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "customer_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Filter by customer.", "title": "Customer Id"}}, {"description": "Filter by customer billing entity.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "billing_entity_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Filter by customer billing entity.", "title": "Billing Entity Id"}}, {"description": "Filter by purchased or promotional origin.", "in": "query", "name": "origin", "required": false, "schema": {"anyOf": [{"enum": ["purchased", "promotional"], "type": "string"}, {"type": "null"}], "description": "Filter by purchased or promotional origin.", "title": "Origin"}}, {"description": "Filter by the effective availability window.", "in": "query", "name": "validity", "required": false, "schema": {"anyOf": [{"enum": ["scheduled", "current", "expired"], "type": "string"}, {"type": "null"}], "description": "Filter by the effective availability window.", "title": "Validity"}}, {"description": "Filter by explicit revocation.", "in": "query", "name": "revoked", "required": false, "schema": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "description": "Filter by explicit revocation.", "title": "Revoked"}}, {"description": "Filter by zero remaining capacity.", "in": "query", "name": "depleted", "required": false, "schema": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "description": "Filter by zero remaining capacity.", "title": "Depleted"}}, {"description": "Filter by amendment-stable contract lineage.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "billing_schedule_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Filter by amendment-stable contract lineage.", "title": "Billing Schedule Id"}}, {"description": "Filter customer-wide or schedule-scoped allowances.", "in": "query", "name": "grant_scope", "required": false, "schema": {"anyOf": [{"enum": ["customer", "schedule"], "type": "string"}, {"type": "null"}], "description": "Filter customer-wide or schedule-scoped allowances.", "title": "Grant Scope"}}, {"description": "Filter the independent issuance state.", "in": "query", "name": "issuance", "required": false, "schema": {"anyOf": [{"enum": ["pending", "issued"], "type": "string"}, {"type": "null"}], "description": "Filter the independent issuance state.", "title": "Issuance"}}, {"description": "Asset discriminator; supply asset_id together.", "in": "query", "name": "asset_kind", "required": false, "schema": {"anyOf": [{"enum": ["money", "metric"], "type": "string"}, {"type": "null"}], "description": "Asset discriminator; supply asset_id together.", "title": "Asset Kind"}}, {"description": "Currency code or metric UUID; supply asset_kind together.", "in": "query", "name": "asset_id", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Currency code or metric UUID; supply asset_kind together.", "title": "Asset Id"}}, {"description": "Maximum number of results, between 1 and 100.", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of results, between 1 and 100.", "maximum": 100, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/FinancialCreditPage"}}}, "description": "One page of financial credits.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`credits_not_found`: a scoped billing entity is unavailable.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["credits:read"]}], "summary": "List credit allowances", "tags": ["One-off Credits"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["credits:read"]}, "post": {"description": "Create a one-off customer grant with currency or metric capacity. Select billing_entity_id from the customer billing-entities API; it must belong to customer_id. Capacity is issued immediately and becomes spendable within its effective window, independently of payment. With create_invoice, create a purchase invoice draft atomically; this does not submit a fiscal document. Idempotency-Key is required and retries replay the original result. Requires credits:write.\n\n**Required scope:** `credits:write`", "operationId": "createFinancialCreditGrant", "parameters": [{"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateFinancialCredit"}}}, "required": true}, "responses": {"201": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditMutation"}}}, "description": "The created credit mutation.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "Location": {"description": "URL of the created resource.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`credits_not_found` or `credits_scope_mismatch`: a required resource is unavailable in this organization or customer scope.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`idempotency_key_reused`, `credits_transition_invalid` or `credits_concurrent_write`: changed request intent, outstanding reservations, or concurrent financial changes.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`validation_failed`, `credits_invalid` or `credits_asset_mismatch`: invalid structure, amount, availability window or invoice terms.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["credits:write"]}], "summary": "Create one-off credits", "tags": ["One-off Credits"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["credits:write"]}}, "/api/v1/sandbox/credits/grants/{grant_id}": {"get": {"description": "Read current immutable terms, capacity and version. The ETag is required as If-Match for revocation. Reading never expires, issues or consumes credits. Requires credits:read.\n\n**Required scope:** `credits:read`", "operationId": "getFinancialCreditGrant", "parameters": [{"description": "Financial grant ID returned by this API, rather than a recurring schedule configuration ID.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "grant_id", "required": true, "schema": {"description": "Financial grant ID returned by this API, rather than a recurring schedule configuration ID.", "format": "uuid", "title": "Grant Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/FinancialCredit"}}}, "description": "The financial credit.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`credits_not_found`: grant unavailable in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["credits:read"]}], "summary": "Get a credit allowance", "tags": ["One-off Credits"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["credits:read"]}}, "/api/v1/sandbox/credits/grants/{grant_id}/revoke": {"post": {"description": "Retire the grant's unused capacity, preserving consumption and immutable history. Outstanding invoice reservations block revocation. Requires credits:write, Idempotency-Key, and If-Match from a prior detail read; stale versions return 412.\n\n**Required scope:** `credits:write`", "operationId": "revokeFinancialCreditGrant", "parameters": [{"description": "Financial grant ID returned by this API, rather than a recurring schedule configuration ID.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "grant_id", "required": true, "schema": {"description": "Financial grant ID returned by this API, rather than a recurring schedule configuration ID.", "format": "uuid", "title": "Grant Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/RevokeFinancialCredit"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditMutation"}}}, "description": "The credit mutation.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`credits_not_found` or `credits_scope_mismatch`: a required resource is unavailable in this organization or customer scope.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`idempotency_key_reused`, `credits_transition_invalid` or `credits_concurrent_write`: changed request intent, outstanding reservations, or concurrent financial changes.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`validation_failed`, `credits_invalid` or `credits_asset_mismatch`: invalid structure, amount, availability window or invoice terms.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["credits:write"]}], "summary": "Revoke unused credit capacity", "tags": ["One-off Credits"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["credits:write"]}}, "/api/v1/sandbox/credits/ledger": {"get": {"description": "Paginate immutable grant, reservation, consumption, correction and retirement movements. occurred_from is inclusive and occurred_before exclusive. Cursors are signed and filter-bound. Requires credits:read.\n\n**Required scope:** `credits:read`", "operationId": "listFinancialCreditJournal", "parameters": [{"description": "Filter by customer.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "customer_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Filter by customer.", "title": "Customer Id"}}, {"description": "Filter by customer billing entity.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "billing_entity_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Filter by customer billing entity.", "title": "Billing Entity Id"}}, {"description": "Filter by financial grant.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "grant_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Filter by financial grant.", "title": "Grant Id"}}, {"description": "Filter by related invoice.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "invoice_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Filter by related invoice.", "title": "Invoice Id"}}, {"description": "Filter by immutable movement type.", "in": "query", "name": "kind", "required": false, "schema": {"anyOf": [{"enum": ["grant", "rollover_in", "rollover_out", "reserve", "release", "consume", "expire", "revoke", "reverse_consumption"], "type": "string"}, {"type": "null"}], "description": "Filter by immutable movement type.", "title": "Kind"}}, {"description": "Inclusive operation instant lower bound; preserves microseconds.", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "occurred_from", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Inclusive operation instant lower bound; preserves microseconds.", "title": "Occurred From"}}, {"description": "Exclusive operation instant upper bound; preserves microseconds.", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "occurred_before", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Exclusive operation instant upper bound; preserves microseconds.", "title": "Occurred Before"}}, {"description": "Maximum number of results, between 1 and 100.", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of results, between 1 and 100.", "maximum": 100, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditJournalEntryPage"}}}, "description": "One page of credit journal entries.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`credits_not_found`: a scoped billing entity is unavailable.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["credits:read"]}], "summary": "List credit journal movements", "tags": ["Credit Balances & History"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["credits:read"]}}, "/api/v1/sandbox/customers": {"get": {"description": "List the token's organization's customers. Filters combine with AND; `code`, `external_reference` and `tax_id` are repeatable and match any of the given values. Cursor-paginated: pass `next_cursor` back as `cursor`; it is null on the last page and only valid for the filters, sort and order that issued it. To sync, poll with `updated_since` and `include_deleted=true`: deleted customers then come back as tombstones with `deleted_at` set.\n\n**Required scope:** `customers:read`", "operationId": "listCustomers", "parameters": [{"description": "true: only active customers; false: only inactive ones; omit: both.", "in": "query", "name": "is_active", "required": false, "schema": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "description": "true: only active customers; false: only inactive ones; omit: both.", "title": "Is Active"}}, {"description": "Free-text search over code and display name. Must be non-empty when sent.", "in": "query", "name": "query", "required": false, "schema": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "description": "Free-text search over code and display name. Must be non-empty when sent.", "title": "Query"}}, {"description": "Exact customer code. Repeatable.", "in": "query", "name": "code", "required": false, "schema": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "description": "Exact customer code. Repeatable.", "title": "Code"}}, {"description": "Exact `external_references[].id`. Repeatable.", "in": "query", "name": "external_reference", "required": false, "schema": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "description": "Exact `external_references[].id`. Repeatable.", "title": "External Reference"}}, {"description": "Tax id on any of the customer's billing entities. Repeatable. A Chilean RUT matches in any spelling (`76.123.456-7`, `76123456-7`, `CL-761234567`).", "in": "query", "name": "tax_id", "required": false, "schema": {"anyOf": [{"items": {"type": "string"}, "maxItems": 100, "type": "array"}, {"type": "null"}], "description": "Tax id on any of the customer's billing entities. Repeatable. A Chilean RUT matches in any spelling (`76.123.456-7`, `76123456-7`, `CL-761234567`).", "title": "Tax Id"}}, {"description": "Only customers updated at or after this instant (RFC 3339).", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "updated_since", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Only customers updated at or after this instant (RFC 3339).", "title": "Updated Since"}}, {"description": "true: also return deleted customers as tombstones (`deleted_at` set, `is_active` false). Combine with `updated_since` to observe deletions; `is_active=true` still excludes them.", "in": "query", "name": "include_deleted", "required": false, "schema": {"default": false, "description": "true: also return deleted customers as tombstones (`deleted_at` set, `is_active` false). Combine with `updated_since` to observe deletions; `is_active=true` still excludes them.", "title": "Include Deleted", "type": "boolean"}}, {"description": "`created_at`, `display_name` (case-insensitive) or `status` (active first when ascending). Omit for search relevance when `query` is set, then newest first. Ties break on the customer id.", "in": "query", "name": "sort", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/CustomerListSortField"}, {"type": "null"}], "description": "`created_at`, `display_name` (case-insensitive) or `status` (active first when ascending). Omit for search relevance when `query` is set, then newest first. Ties break on the customer id.", "title": "Sort"}}, {"description": "`asc` or `desc`.", "in": "query", "name": "order", "required": false, "schema": {"$ref": "#/components/schemas/SortOrder", "default": "desc", "description": "`asc` or `desc`."}}, {"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}, {"description": "Only records whose `metadata` holds this key with exactly this string value, sent as `metadata[<key>]=<value>` (for example `metadata[crm_id]=0017`). Repeat with other keys to require all of them (AND). Matching is exact and case-sensitive; a key whose stored value is not a string never matches. At most 10 keys; keys are 1-40 characters without `[` or `]`, values 1-500 characters. A key may appear once. Invalid input is `422 validation_failed`.", "example": {"crm_id": "0017"}, "explode": true, "in": "query", "name": "metadata", "required": false, "schema": {"additionalProperties": {"maxLength": 500, "minLength": 1, "type": "string"}, "maxProperties": 10, "propertyNames": {"maxLength": 40, "minLength": 1, "pattern": "^[^\\[\\]]+$"}, "type": "object"}, "style": "deepObject"}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CustomerPage"}}}, "description": "One page of customers.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["customers:read"]}], "summary": "List customers", "tags": ["Customers"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["customers:read"]}, "post": {"description": "Create a customer. It has no billing entity yet; create one with `POST /customers/{customer_id}/billing-entities` before invoicing it. Send an `Idempotency-Key`: the same key and body replays the original response; the same key with a different body returns 409.\n\n**Required scope:** `customers:write`", "operationId": "createCustomer", "parameters": [{"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CustomerCreateRequest"}}}, "required": true}, "responses": {"201": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Customer"}}}, "description": "The created customer.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "Location": {"description": "URL of the created resource.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "An `assigned_member_ids` entry does not exist.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `code` is already used by another customer (`party_party_code_not_unique`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "An external reference `(type, id)` is listed twice (`party_party_external_reference_duplicated`), or the `code` or `display_name` is not valid (`customer_rejected`). `metadata` outside its bounds returns `metadata_invalid` (`params.reason`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["customers:write"]}], "summary": "Create a customer", "tags": ["Customers"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["customers:write"]}}, "/api/v1/sandbox/customers/{customer_id}": {"delete": {"description": "Delete a customer and all of its billing entities. A customer with contracts cannot be deleted (409). Requires `If-Match`; no `Idempotency-Key` is needed. A retry of a delete that already committed returns 204.\n\n**Required scope:** `customers:write`", "operationId": "deleteCustomer", "parameters": [{"description": "Id of the customer.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "customer_id", "required": true, "schema": {"format": "uuid", "title": "Customer Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"204": {"description": "Deleted; no content.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No customer with this id in the token's organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The customer has contracts (`customer_has_contracts`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["customers:write"]}], "summary": "Delete a customer", "tags": ["Customers"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["customers:write"]}, "get": {"description": "Get one customer. The `ETag` header carries its version for `If-Match`.\n\n**Required scope:** `customers:read`", "operationId": "getCustomer", "parameters": [{"description": "Id of the customer.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "customer_id", "required": true, "schema": {"format": "uuid", "title": "Customer Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Customer"}}}, "description": "The customer.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No customer with this id in the token's organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["customers:read"]}], "summary": "Get a customer", "tags": ["Customers"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["customers:read"]}, "patch": {"description": "Partially update a customer: omitted fields are unchanged; list fields replace the whole list. Send `default_billing_entity_id: null` to clear the default. Requires `If-Match` with the `ETag` from a prior read; no `Idempotency-Key` is needed.\n\n**Required scope:** `customers:write`", "operationId": "updateCustomer", "parameters": [{"description": "Id of the customer.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "customer_id", "required": true, "schema": {"format": "uuid", "title": "Customer Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CustomerUpdateRequest"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Customer"}}}, "description": "The updated customer.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such customer, or `default_billing_entity_id` does not exist.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `code` is already used by another customer (`customer_code_not_unique`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "An external reference `(type, id)` is listed twice (`party_party_external_reference_duplicated`). An invalid `code` or `display_name` returns `validation_failed`. `metadata` outside its bounds (checked on the merged result) returns `metadata_invalid` (`params.reason`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["customers:write"]}], "summary": "Update a customer", "tags": ["Customers"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["customers:write"]}}, "/api/v1/sandbox/customers/{customer_id}/billing-entities": {"get": {"description": "List a customer's billing entities, newest first. Filters combine with AND; `status` is repeatable and matches any of the given values. Without `status`, every billing entity is listed, archived ones included. Cursor-paginated: pass `next_cursor` back as `cursor`; it is null on the last page and only valid for the filters that issued it.\n\n**Required scope:** `customers:read`", "operationId": "listBillingEntities", "parameters": [{"description": "Id of the customer.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "customer_id", "required": true, "schema": {"format": "uuid", "title": "Customer Id", "type": "string"}}, {"description": "Only billing entities in this status (`active`, `suspended`, `archived`). Repeatable. Omit to list all of them, archived included.", "in": "query", "name": "status", "required": false, "schema": {"anyOf": [{"items": {"$ref": "#/components/schemas/BillingEntityStatus"}, "type": "array"}, {"type": "null"}], "description": "Only billing entities in this status (`active`, `suspended`, `archived`). Repeatable. Omit to list all of them, archived included.", "title": "Status"}}, {"description": "Only billing entities updated at or after this instant (RFC 3339).", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "updated_since", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Only billing entities updated at or after this instant (RFC 3339).", "title": "Updated Since"}}, {"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}, {"description": "Only records whose `metadata` holds this key with exactly this string value, sent as `metadata[<key>]=<value>` (for example `metadata[crm_id]=0017`). Repeat with other keys to require all of them (AND). Matching is exact and case-sensitive; a key whose stored value is not a string never matches. At most 10 keys; keys are 1-40 characters without `[` or `]`, values 1-500 characters. A key may appear once. Invalid input is `422 validation_failed`.", "example": {"crm_id": "0017"}, "explode": true, "in": "query", "name": "metadata", "required": false, "schema": {"additionalProperties": {"maxLength": 500, "minLength": 1, "type": "string"}, "maxProperties": 10, "propertyNames": {"maxLength": 40, "minLength": 1, "pattern": "^[^\\[\\]]+$"}, "type": "object"}, "style": "deepObject"}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillingEntityPage"}}}, "description": "One page of billing entities.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["customers:read"]}], "summary": "List billing entities", "tags": ["Billing Entities"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["customers:read"]}, "post": {"description": "Create a billing entity (the legal/tax identity invoices are issued to) for a customer. The customer's first billing entity becomes its default; send `set_as_default: true` to make a later one the default. `tax_id.type` is lower case (e.g. `rut`) and `tax_id.country` is ISO 3166-1 alpha-2. Send an `Idempotency-Key`: the same key and body replays the original response; a different body returns 409.\n\n**Required scope:** `customers:write`", "operationId": "createBillingEntity", "parameters": [{"description": "Id of the customer.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "customer_id", "required": true, "schema": {"format": "uuid", "title": "Customer Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillingEntityCreateRequest"}}}, "required": true}, "responses": {"201": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillingEntity"}}}, "description": "The created billing entity.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "Location": {"description": "URL of the created resource.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No customer with this id.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The tax id is not valid for its country and type (`billing_entity_rejected`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["customers:write"]}], "summary": "Create a billing entity", "tags": ["Billing Entities"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["customers:write"]}}, "/api/v1/sandbox/customers/{customer_id}/billing-entities/{billing_entity_id}": {"delete": {"description": "Delete a billing entity and its billing profile. Refused with 409 while contracts reference it or its billing profile is shared. Requires `If-Match`; no `Idempotency-Key` is needed.\n\n**Required scope:** `customers:write`", "operationId": "deleteBillingEntity", "parameters": [{"description": "Id of the customer.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "customer_id", "required": true, "schema": {"format": "uuid", "title": "Customer Id", "type": "string"}}, {"description": "Id of the billing entity.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "billing_entity_id", "required": true, "schema": {"format": "uuid", "title": "Billing Entity Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"204": {"description": "Deleted; no content.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such customer, or no such billing entity for it.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Active or draft contracts reference the billing entity (`billing_entity_has_contracts`), its billing profile is shared with other billing entities (`billing_profile_shared`), or it is the organization's own issuing billing entity (`billing_entity_is_issuer`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["customers:write"]}], "summary": "Delete a billing entity", "tags": ["Billing Entities"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["customers:write"]}, "get": {"description": "Get one billing entity. The `ETag` header carries its version for `If-Match`.\n\n**Required scope:** `customers:read`", "operationId": "getBillingEntity", "parameters": [{"description": "Id of the customer.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "customer_id", "required": true, "schema": {"format": "uuid", "title": "Customer Id", "type": "string"}}, {"description": "Id of the billing entity.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "billing_entity_id", "required": true, "schema": {"format": "uuid", "title": "Billing Entity Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillingEntity"}}}, "description": "The billing entity.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such customer, or no such billing entity for it.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["customers:read"]}], "summary": "Get a billing entity", "tags": ["Billing Entities"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["customers:read"]}, "patch": {"description": "Update how this customer is billed: payment terms, tax status, default document family, description, metadata, external references and whether it is the customer's default. To change the legal name, tax id or addresses printed on invoices, use `PATCH .../billing-profile` instead.\n\nOmitted fields are unchanged. `set_as_default: true` makes it the customer's default in the same transaction, so the customer always has exactly one default. Requires `If-Match` with this billing entity's `ETag`; no `Idempotency-Key` is needed.\n\n**Required scope:** `customers:write`", "operationId": "updateBillingEntity", "parameters": [{"description": "Id of the customer.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "customer_id", "required": true, "schema": {"format": "uuid", "title": "Customer Id", "type": "string"}}, {"description": "Id of the billing entity.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "billing_entity_id", "required": true, "schema": {"format": "uuid", "title": "Billing Entity Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillingEntityUpdateRequest"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillingEntity"}}}, "description": "The updated billing entity.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such customer, or no such billing entity for it.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The billing entity is archived (`billing_entity_archived`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "An external reference `(type, id)` is listed twice (`party_billing_link_external_reference_duplicated`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["customers:write"]}], "summary": "Update a billing entity's billing settings", "tags": ["Billing Entities"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["customers:write"]}}, "/api/v1/sandbox/customers/{customer_id}/billing-entities/{billing_entity_id}/billing-profile": {"get": {"description": "Get the billing profile: the legal name, tax id and addresses printed on this billing entity's invoices. The `ETag` is the *profile* version, which `PATCH .../billing-profile` takes as `If-Match`; it is not the billing entity's `ETag`.\n\n**Required scope:** `customers:read`", "operationId": "getBillingEntityBillingProfile", "parameters": [{"description": "Id of the customer.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "customer_id", "required": true, "schema": {"format": "uuid", "title": "Customer Id", "type": "string"}}, {"description": "Id of the billing entity.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "billing_entity_id", "required": true, "schema": {"format": "uuid", "title": "Billing Entity Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillingEntityBillingProfile"}}}, "description": "The billing entity billing profile.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such customer, or no such billing entity for it.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["customers:read"]}], "summary": "Get a billing entity's legal identity", "tags": ["Billing Entities"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["customers:read"]}, "patch": {"description": "Update the billing profile: the legal name, tax id and addresses printed on invoices, plus its default currency and timezone. **If the profile is shared by several billing entities, the change applies to all of them.** To change payment terms, tax status or the default billing entity, use `PATCH .../billing-entities/{id}` instead.\n\nOmitted fields are unchanged; `shipping_address` and `business_activity` may be sent as null to clear them. Requires `If-Match` with the *profile* `ETag` (from `GET .../billing-profile`, not the billing entity's); no `Idempotency-Key` is needed.\n\n**Required scope:** `customers:write`", "operationId": "updateBillingEntityBillingProfile", "parameters": [{"description": "Id of the customer.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "customer_id", "required": true, "schema": {"format": "uuid", "title": "Customer Id", "type": "string"}}, {"description": "Id of the billing entity.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "billing_entity_id", "required": true, "schema": {"format": "uuid", "title": "Billing Entity Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillingEntityBillingProfileUpdateRequest"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillingEntityBillingProfile"}}}, "description": "The updated billing entity billing profile.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such customer, or no such billing entity for it.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The billing profile is archived (`billing_profile_archived`), or another billing profile already uses this tax id (`billing_profile_tax_id_conflict`) or legal name (`billing_profile_legal_name_conflict`). Uniqueness is enforced only for the organization's own issuing profile.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The billing country changed without a matching `tax_id` (`validation_failed` with `params.field` = `tax_id`); or the tax id is not valid for its country, or the billing country changed while contracts are linked (`billing_profile_rejected`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["customers:write"]}], "summary": "Update a billing entity's legal identity", "tags": ["Billing Entities"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["customers:write"]}}, "/api/v1/sandbox/customers/{customer_id}/billing-entities/{billing_entity_id}/contacts": {"get": {"description": "List a billing entity's contacts, oldest first, each with its emails, phones and roles. Cursor-paginated: pass `next_cursor` back as `cursor`; it is null on the last page and only valid for the filters that issued it.\n\n**Required scope:** `customers:read`", "operationId": "listContacts", "parameters": [{"description": "Id of the customer.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "customer_id", "required": true, "schema": {"format": "uuid", "title": "Customer Id", "type": "string"}}, {"description": "Id of the billing entity.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "billing_entity_id", "required": true, "schema": {"format": "uuid", "title": "Billing Entity Id", "type": "string"}}, {"description": "Only contacts updated at or after this instant (RFC 3339).", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "updated_since", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Only contacts updated at or after this instant (RFC 3339).", "title": "Updated Since"}}, {"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillingEntityContactPage"}}}, "description": "One page of billing entity contacts.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such billing entity for this customer.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["customers:read"]}], "summary": "List contacts", "tags": ["Contacts"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["customers:read"]}, "post": {"description": "Create a contact under a billing entity, with its name, emails, phones and roles in one call. Email and phone ids are server-generated and every channel starts `active`. The `ETag` carries the new contact's version for the next `If-Match`. Send an `Idempotency-Key`.\n\n**Required scope:** `customers:write`", "operationId": "createContact", "parameters": [{"description": "Id of the customer.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "customer_id", "required": true, "schema": {"format": "uuid", "title": "Customer Id", "type": "string"}}, {"description": "Id of the billing entity.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "billing_entity_id", "required": true, "schema": {"format": "uuid", "title": "Billing Entity Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateContactRequest"}}}, "required": true}, "responses": {"201": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillingEntityContact"}}}, "description": "The created billing entity contact.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "Location": {"description": "URL of the created resource.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such billing entity for this customer.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "An email or phone is already active on another contact of this billing entity, a default role is already held by another contact, or the contact losing that default was changed concurrently (`contact_conflict`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The contact breaks a contact rule: more than one active email (`party_contact_multiple_active_emails`), the same email or phone listed twice (`party_contact_duplicate_active_email`, `party_contact_duplicate_active_phone`), or the same role listed twice (`party_contact_roles_invalid`). A malformed name, email or phone returns `validation_failed` with `params.field`. Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["customers:write"]}], "summary": "Create a contact", "tags": ["Contacts"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["customers:write"]}}, "/api/v1/sandbox/customers/{customer_id}/billing-entities/{billing_entity_id}/contacts/{contact_id}": {"delete": {"description": "Retire a contact. The contact stops appearing in reads and stops receiving correspondence: its active emails and phones are archived and its roles are revoked in the same transaction. The record itself is retained, so the audit trail of who was once reachable survives. Deleting the only default recipient for a role is allowed — the link is simply left without a default for it, which the emitted `party.contact.deleted` event reports. Repeating the request on an already-deleted contact succeeds. Requires `If-Match`; no `Idempotency-Key` is needed.\n\n**Required scope:** `customers:write`", "operationId": "deleteContact", "parameters": [{"description": "Id of the customer.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "customer_id", "required": true, "schema": {"format": "uuid", "title": "Customer Id", "type": "string"}}, {"description": "Id of the billing entity.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "billing_entity_id", "required": true, "schema": {"format": "uuid", "title": "Billing Entity Id", "type": "string"}}, {"description": "Id of the contact.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "contact_id", "required": true, "schema": {"format": "uuid", "title": "Contact Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"204": {"description": "The contact is retired.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such contact in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The contact was changed concurrently while being retired (`contact_conflict`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["customers:write"]}], "summary": "Delete a contact", "tags": ["Contacts"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["customers:write"]}, "get": {"description": "Fetch a contact's full current state: name, emails, phones, and roles.\n\n**Required scope:** `customers:read`", "operationId": "getContact", "parameters": [{"description": "Id of the customer.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "customer_id", "required": true, "schema": {"format": "uuid", "title": "Customer Id", "type": "string"}}, {"description": "Id of the billing entity.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "billing_entity_id", "required": true, "schema": {"format": "uuid", "title": "Billing Entity Id", "type": "string"}}, {"description": "Id of the contact.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "contact_id", "required": true, "schema": {"format": "uuid", "title": "Contact Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillingEntityContact"}}}, "description": "The contact's current state. `ETag` carries the version to send back as `If-Match`.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such contact in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["customers:read"]}], "summary": "Get a contact", "tags": ["Contacts"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["customers:read"]}, "patch": {"description": "Reconcile the full state of a contact in one call: name (if the 'name' key is present in the payload at all — an absent key means 'leave unchanged', never 'clear the name'), plus the complete desired sets of emails, phones, and roles. An email/phone/role present by id has its status reconciled; one currently active but omitted from the payload is archived/revoked. Requires `If-Match`; no `Idempotency-Key` is needed.\n\n**Required scope:** `customers:write`", "operationId": "updateContact", "parameters": [{"description": "Id of the customer.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "customer_id", "required": true, "schema": {"format": "uuid", "title": "Customer Id", "type": "string"}}, {"description": "Id of the billing entity.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "billing_entity_id", "required": true, "schema": {"format": "uuid", "title": "Billing Entity Id", "type": "string"}}, {"description": "Id of the contact.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "contact_id", "required": true, "schema": {"format": "uuid", "title": "Contact Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UpdateContactRequest"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillingEntityContact"}}}, "description": "The reconciled contact. `ETag` carries the new version.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such contact in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "An email or phone is already active on another contact of this billing entity, a default role is already held by another contact, or the contact losing that default was changed concurrently (`contact_conflict`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The payload is not a valid reconciliation of this contact: an email or phone id is not on it (`party_contact_email_not_found`, `party_contact_phone_not_found`), it would have more than one active email (`party_contact_multiple_active_emails`), an address or number is listed twice (`party_contact_duplicate_active_email`, `party_contact_duplicate_active_phone`), a role is listed twice (`party_contact_roles_invalid`), or an archived channel is set back to `active` (`validation_failed`). A malformed name, email or phone returns `validation_failed` with `params.field`. Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["customers:write"]}], "summary": "Update a contact", "tags": ["Contacts"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["customers:write"]}}, "/api/v1/sandbox/customers/{customer_id}/billing-entities/{billing_entity_id}/resolved-payment-method": {"get": {"description": "Return the payment method that will actually collect from this billing entity. `resolution_kind` is `customer_default` (an active, usable default assignment), `customer_default_invalid` (a default exists but is unusable; `reason` says why, no fallback), `transfer_route` (routed by country and currency), `organization_default`, or `none`. `payment_method` is null unless a usable method was resolved.\n\n**Required scope:** `payment_methods:read`", "operationId": "getResolvedPaymentMethod", "parameters": [{"description": "Id of the billing entity.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "billing_entity_id", "required": true, "schema": {"format": "uuid", "title": "Billing Entity Id", "type": "string"}}, {"description": "The customer's id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "customer_id", "required": true, "schema": {"description": "The customer's id.", "format": "uuid", "title": "Customer Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ResolvedPaymentMethod"}}}, "description": "The resolved payment method.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The customer does not exist or is inactive (`customer_not_found`), or the billing entity does not belong to the customer (`billing_entity_not_found`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["payment_methods:read"]}], "summary": "Resolve a billing entity's payment method", "tags": ["Payment Methods"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["payment_methods:read"]}}, "/api/v1/sandbox/customers/{customer_id}/payment-methods": {"get": {"description": "List the payment methods assigned to the customer's billing entities, oldest first, each with the embedded payment method.\n\n**Required scope:** `payment_methods:read`", "operationId": "listCustomerPaymentMethods", "parameters": [{"description": "The customer's id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "customer_id", "required": true, "schema": {"description": "The customer's id.", "format": "uuid", "title": "Customer Id", "type": "string"}}, {"description": "Only this billing entity.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "billing_entity_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Only this billing entity.", "title": "Billing Entity Id"}}, {"description": "Only active (`true`) or deactivated (`false`) assignments. Omit to return both.", "in": "query", "name": "is_active", "required": false, "schema": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "description": "Only active (`true`) or deactivated (`false`) assignments. Omit to return both.", "examples": [true], "title": "Is Active"}}, {"description": "Only the assignments that are (`true`) or are not (`false`) their billing entity's default. Omit to return both.", "in": "query", "name": "is_default", "required": false, "schema": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "description": "Only the assignments that are (`true`) or are not (`false`) their billing entity's default. Omit to return both.", "examples": [true], "title": "Is Default"}}, {"description": "Only records with `updated_at` at or after this instant (inclusive). Use it to sync changes incrementally.", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "updated_since", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Only records with `updated_at` at or after this instant (inclusive). Use it to sync changes incrementally.", "title": "Updated Since"}}, {"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CustomerPaymentMethodPage"}}}, "description": "One page of customer payment methods.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The customer does not exist in the token's organization or is inactive (`customer_not_found`); the billing entity does not belong to the customer (`billing_entity_not_found`); or the assignment does not belong to the customer (`payment_method_assignment_not_found`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["payment_methods:read"]}], "summary": "List a customer's payment methods", "tags": ["Payment Methods"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["payment_methods:read"]}, "post": {"description": "Assign an active organization payment method to one of the customer's billing entities. With `is_default=true` it becomes that billing entity's collection method and the previous default is demoted atomically. Send an `Idempotency-Key`: the same key and body replays the original result; the same key with a different body returns 409 `idempotency_key_reused`.\n\n**Required scope:** `payment_methods:write`", "operationId": "createCustomerPaymentMethod", "parameters": [{"description": "The customer's id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "customer_id", "required": true, "schema": {"description": "The customer's id.", "format": "uuid", "title": "Customer Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CustomerPaymentMethodCreateRequest"}}}, "required": true}, "responses": {"201": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CustomerPaymentMethod"}}}, "description": "The created customer payment method.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "Location": {"description": "URL of the created resource.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The customer does not exist or is inactive (`customer_not_found`), the billing entity does not belong to the customer (`billing_entity_not_found`), or the payment method does not exist (`payment_method_not_found`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The billing entity is not an active customer relationship (`billing_entity_inactive`). The method is provider-backed and the billing entity collects on another provider (`payment_method_provider_mismatch`). The payment method is inactive, or it is already actively assigned to this billing entity (`payment_method_conflict`). A concurrent write to the same payment method won the race; read it again and retry (`payment_method_conflict`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["payment_methods:write"]}], "summary": "Assign a payment method to a customer", "tags": ["Payment Methods"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["payment_methods:write"]}}, "/api/v1/sandbox/customers/{customer_id}/payment-methods/{assignment_id}": {"get": {"description": "Return one payment method assigned to one of the customer's billing entities, with the embedded organization payment method. The `ETag` header carries the assignment's `version`; send it as `If-Match` on the next write.\n\n**Required scope:** `payment_methods:read`", "operationId": "getCustomerPaymentMethod", "parameters": [{"description": "Id of the payment-method assignment on this customer.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "assignment_id", "required": true, "schema": {"format": "uuid", "title": "Assignment Id", "type": "string"}}, {"description": "The customer's id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "customer_id", "required": true, "schema": {"description": "The customer's id.", "format": "uuid", "title": "Customer Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CustomerPaymentMethod"}}}, "description": "The customer payment method.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The customer does not exist in the token's organization or is inactive (`customer_not_found`); the billing entity does not belong to the customer (`billing_entity_not_found`); or the assignment does not belong to the customer (`payment_method_assignment_not_found`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["payment_methods:read"]}], "summary": "Get a customer's payment method", "tags": ["Payment Methods"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["payment_methods:read"]}, "patch": {"description": "Make the assignment its billing entity's default (`is_default=true`, demoting the previous default atomically) or clear the default flag. A billing entity never ends up with two defaults. Send `If-Match` with the `ETag` (the resource's `version`) from your last read. Missing returns 428; stale returns 412 — re-read and retry. Send an `Idempotency-Key`: the same key and body replays the original result; the same key with a different body returns 409 `idempotency_key_reused`.\n\n**Required scope:** `payment_methods:write`", "operationId": "updateCustomerPaymentMethod", "parameters": [{"description": "Id of the payment-method assignment on this customer.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "assignment_id", "required": true, "schema": {"format": "uuid", "title": "Assignment Id", "type": "string"}}, {"description": "The customer's id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "customer_id", "required": true, "schema": {"description": "The customer's id.", "format": "uuid", "title": "Customer Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CustomerPaymentMethodUpdateRequest"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CustomerPaymentMethod"}}}, "description": "The updated customer payment method.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The customer does not exist in the token's organization or is inactive (`customer_not_found`); the billing entity does not belong to the customer (`billing_entity_not_found`); or the assignment does not belong to the customer (`payment_method_assignment_not_found`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The assignment is inactive, and inactive assignments are terminal (`payment_method_assignment_inactive`). `is_default=true` was sent but the billing entity is not an active customer relationship or the payment method is inactive (`payment_method_conflict`). A concurrent write to the same payment method won the race; read it again and retry (`payment_method_conflict`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The method's fields break a payment-method rule — for example an `offline` method with a provider, a provider without a connection, or a `bank_account_id` on a kind other than `bank_transfer` (`payment_method_invalid`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["payment_methods:write"]}], "summary": "Update a customer's payment method", "tags": ["Payment Methods"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["payment_methods:write"]}}, "/api/v1/sandbox/customers/{customer_id}/payment-methods/{assignment_id}/deactivate": {"post": {"description": "Stop using this payment method for the customer. If it was the default, collection falls back to the organization's routing. Send `If-Match` with the `ETag` (the resource's `version`) from your last read. Missing returns 428; stale returns 412 — re-read and retry. Send an `Idempotency-Key`: the same key and body replays the original result; the same key with a different body returns 409 `idempotency_key_reused`.\n\n**Required scope:** `payment_methods:write`", "operationId": "deactivateCustomerPaymentMethod", "parameters": [{"description": "Id of the payment-method assignment on this customer.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "assignment_id", "required": true, "schema": {"format": "uuid", "title": "Assignment Id", "type": "string"}}, {"description": "The customer's id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "customer_id", "required": true, "schema": {"description": "The customer's id.", "format": "uuid", "title": "Customer Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CustomerPaymentMethod"}}}, "description": "The updated customer payment method.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The customer does not exist in the token's organization or is inactive (`customer_not_found`); the billing entity does not belong to the customer (`billing_entity_not_found`); or the assignment does not belong to the customer (`payment_method_assignment_not_found`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The assignment is inactive, and inactive assignments are terminal (`payment_method_assignment_inactive`). A concurrent write to the same payment method won the race; read it again and retry (`payment_method_conflict`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The method's fields break a payment-method rule — for example an `offline` method with a provider, a provider without a connection, or a `bank_account_id` on a kind other than `bank_transfer` (`payment_method_invalid`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["payment_methods:write"]}], "summary": "Deactivate a customer's payment method", "tags": ["Payment Methods"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["payment_methods:write"]}}, "/api/v1/sandbox/debit-notes": {"get": {"description": "List the organization's debit notes. Ordered newest first by `created_at` (ties broken by id) and paged with an opaque keyset cursor: pass `next_cursor` back as `cursor` with the same filters; `next_cursor` is null on the last page. Filters combine with AND; a repeated `customer_id` matches any of the values.\n\n**Required scope:** `invoices:read`", "operationId": "listDebitNotes", "parameters": [{"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}, {"description": "Only notes for these customers (at most 100).", "in": "query", "name": "customer_id", "required": false, "schema": {"default": [], "description": "Only notes for these customers (at most 100).", "items": {"format": "uuid", "type": "string"}, "maxItems": 100, "title": "Customer Id", "type": "array"}}, {"description": "Only notes debiting this invoice.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "invoice_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Only notes debiting this invoice.", "title": "Invoice Id"}}, {"description": "Only notes in any of these statuses (repeatable).", "in": "query", "name": "status", "required": false, "schema": {"default": [], "description": "Only notes in any of these statuses (repeatable).", "items": {"$ref": "#/components/schemas/CorrectionNoteStatus"}, "title": "Status", "type": "array"}}, {"description": "Only notes in any of these tax-authority statuses (repeatable).", "in": "query", "name": "fiscal_status", "required": false, "schema": {"default": [], "description": "Only notes in any of these tax-authority statuses (repeatable).", "items": {"$ref": "#/components/schemas/FiscalStatus"}, "title": "Fiscal Status", "type": "array"}}, {"description": "Issue date on or after.", "example": "2026-01-31", "in": "query", "name": "issue_date_from", "required": false, "schema": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Issue date on or after.", "title": "Issue Date From"}}, {"description": "Issue date on or before.", "example": "2026-01-31", "in": "query", "name": "issue_date_to", "required": false, "schema": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Issue date on or before.", "title": "Issue Date To"}}, {"description": "Only notes changed at or after this instant (RFC 3339).", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "updated_since", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Only notes changed at or after this instant (RFC 3339).", "title": "Updated Since"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/DebitNoteList"}}}, "description": "One page of debit notes.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:read"]}], "summary": "List debit notes", "tags": ["Debit Notes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:read"]}, "post": {"description": "Create a `draft` debit note against an issued invoice. Debit notes always carry explicit `lines`: an adjustment to a source line or an additional charge. A draft has no fiscal effect until it is issued. Requires an `Idempotency-Key` header: retrying with the same key and body replays the original result; reusing it with a different body is a 409. `If-Match` must carry the **source invoice's** current `version` (its ETag), so the note is computed against the invoice state you saw; missing is 428, stale is 412. The response `ETag` is the new note's `version`.\n\n**Required scope:** `invoices:write`", "operationId": "createDebitNote", "parameters": [{"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/DebitNoteCreate"}}}, "required": true}, "responses": {"201": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/DebitNote"}}}, "description": "The new draft note. `ETag` carries its version; `Location` its URL.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "Location": {"description": "URL of the created resource.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The source invoice does not exist in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The source invoice cannot take this correction: it is not `open` and fiscally accepted, lacks frozen fiscal evidence, has no outstanding amount, or the requested lines exceed what remains to correct; `params.detail` names the reason (`invoicing_next_correction_note_source_invoice_invalid`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "A line's `tax_rate` is neither `\"0\"` nor `\"0.19\"`; `params.supported_tax_rates` lists the accepted rates (`invoicing_next_debit_note_tax_rate_unsupported`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:write"]}], "summary": "Create a draft debit note", "tags": ["Debit Notes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:write"]}}, "/api/v1/sandbox/debit-notes/{debit_note_id}": {"delete": {"description": "Discard a `draft` note that was never issued. The note moves to `cancelled` and keeps no fiscal effect; it still appears in lists filtered by `status=cancelled`. `If-Match` must carry the note's current `version` (missing 428, stale 412). No `Idempotency-Key` is needed: a retry with the same `If-Match` is safe.\n\n**Required scope:** `invoices:write`", "operationId": "deleteDebitNote", "parameters": [{"description": "Debit note id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "debit_note_id", "required": true, "schema": {"description": "Debit note id.", "format": "uuid", "title": "Debit Note Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"204": {"description": "The draft was discarded; it never had a fiscal effect.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such note in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Only a `draft` note can be discarded; void an issued one instead (`invoicing_next_debit_note_lifecycle_status_invalid`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:write"]}], "summary": "Discard a draft debit note", "tags": ["Debit Notes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:write"]}, "get": {"description": "Fetch one debit note. The `ETag` is its `version`, to send as `If-Match`.\n\n**Required scope:** `invoices:read`", "operationId": "getDebitNote", "parameters": [{"description": "Debit note id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "debit_note_id", "required": true, "schema": {"description": "Debit note id.", "format": "uuid", "title": "Debit Note Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/DebitNote"}}}, "description": "The debit note.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such note in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:read"]}], "summary": "Get a debit note", "tags": ["Debit Notes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:read"]}}, "/api/v1/sandbox/debit-notes/{debit_note_id}/issue": {"post": {"description": "Issue a `draft` note (it becomes `open`) with the given issue date and queue its fiscal document; `fiscal.status` then moves asynchronously. Requires an `Idempotency-Key` header: retrying with the same key and body replays the original result; reusing it with a different body is a 409. `If-Match` must carry the note's current `version`; missing is 428, stale is 412. The response `ETag` is the note's new `version`.\n\n**Required scope:** `invoices:write`", "operationId": "issueDebitNote", "parameters": [{"description": "Debit note id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "debit_note_id", "required": true, "schema": {"description": "Debit note id.", "format": "uuid", "title": "Debit Note Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/DebitNoteIssue"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/DebitNote"}}}, "description": "The note after the action. `ETag` carries its new version.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such note in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The note is not a `draft` (`invoicing_next_debit_note_lifecycle_status_invalid`); or the source invoice cannot take this correction: it is not `open` and fiscally accepted, lacks frozen fiscal evidence, has no outstanding amount, or the requested lines exceed what remains to correct; `params.detail` names the reason (`invoicing_next_correction_note_source_invoice_invalid`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:write"]}], "summary": "Issue a draft debit note", "tags": ["Debit Notes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:write"]}}, "/api/v1/sandbox/debit-notes/{debit_note_id}/pdf": {"get": {"description": "The authority-rendered PDF of an issued debit note. 404 until the fiscal authority has produced it; 503 when artifact storage is temporarily unavailable (retry). The `ETag` is the file's SHA-256.\n\n**Required scope:** `invoices:read`", "operationId": "getDebitNotePdf", "parameters": [{"description": "Debit note id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "debit_note_id", "required": true, "schema": {"description": "Debit note id.", "format": "uuid", "title": "Debit Note Id", "type": "string"}}], "responses": {"200": {"content": {"application/pdf": {"schema": {"format": "binary", "type": "string"}}}, "description": "The authority-rendered fiscal PDF", "headers": {"ETag": {"description": "SHA-256 checksum of the document bytes.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The document does not exist for this organization, or has no stored artifact", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "503": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Artifact storage is temporarily unavailable; the request may be retried", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:read"]}], "summary": "Download the fiscal PDF", "tags": ["Debit Notes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:read"]}}, "/api/v1/sandbox/debit-notes/{debit_note_id}/void": {"post": {"description": "Void an issued note. Takes no body; the lifecycle decides whether the note can still be voided (409 otherwise). A draft is discarded with `DELETE` instead. Requires an `Idempotency-Key` header: retrying with the same key and body replays the original result; reusing it with a different body is a 409. `If-Match` must carry the note's current `version`; missing is 428, stale is 412. The response `ETag` is the note's new `version`.\n\n**Required scope:** `invoices:write`", "operationId": "voidDebitNote", "parameters": [{"description": "Debit note id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "debit_note_id", "required": true, "schema": {"description": "Debit note id.", "format": "uuid", "title": "Debit Note Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/DebitNote"}}}, "description": "The note after the action. `ETag` carries its new version.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such note in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The note is not `open` (`invoicing_next_debit_note_lifecycle_status_invalid`), or its fiscal submission is pending or accepted, so it can only be corrected by another document (`invoicing_next_debit_note_fiscal_status_invalid`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:write"]}], "summary": "Void a debit note", "tags": ["Debit Notes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:write"]}}, "/api/v1/sandbox/debit-notes/{debit_note_id}/xml": {"get": {"description": "The authority-stamped XML of an issued debit note. 404 until the fiscal authority has produced it; 503 when artifact storage is temporarily unavailable (retry). The `ETag` is the file's SHA-256.\n\n**Required scope:** `invoices:read`", "operationId": "getDebitNoteXml", "parameters": [{"description": "Debit note id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "debit_note_id", "required": true, "schema": {"description": "Debit note id.", "format": "uuid", "title": "Debit Note Id", "type": "string"}}], "responses": {"200": {"content": {"application/xml": {"schema": {"format": "binary", "type": "string"}}, "text/xml": {"schema": {"format": "binary", "type": "string"}}}, "description": "The authority-rendered fiscal XML", "headers": {"ETag": {"description": "SHA-256 checksum of the document bytes.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The document does not exist for this organization, or has no stored artifact", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "503": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Artifact storage is temporarily unavailable; the request may be retried", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:read"]}], "summary": "Download the fiscal XML", "tags": ["Debit Notes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:read"]}}, "/api/v1/sandbox/events": {"get": {"description": "List the organization's public events, newest first by `created_at`. Every public event is logged whether or not a webhook endpoint subscribed to it, so the log can backfill a receiver after downtime. Filters combine with AND; a repeated `type` matches any of its values; `created_at_from`/`created_at_to` are inclusive. Events are kept for 30 days after `created_at`; older events are not returned. Requires `events:read`.\n\n**Required scope:** `events:read`", "operationId": "listEvents", "parameters": [{"description": "Event type; repeat to match several.", "in": "query", "name": "type", "required": false, "schema": {"anyOf": [{"items": {"$ref": "#/components/schemas/WebhookEventType"}, "type": "array"}, {"type": "null"}], "description": "Event type; repeat to match several.", "title": "Type"}}, {"description": "Logged at or after this instant (RFC 3339).", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "created_at_from", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Logged at or after this instant (RFC 3339).", "title": "Created At From"}}, {"description": "Logged at or before this instant (RFC 3339).", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "created_at_to", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Logged at or before this instant (RFC 3339).", "title": "Created At To"}}, {"description": "`true`: only events whose every webhook delivery succeeded. `false`: only events with at least one delivery that has not succeeded (pending, retrying, failed or cancelled). Events no endpoint subscribed to match neither value.", "in": "query", "name": "delivery_success", "required": false, "schema": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "description": "`true`: only events whose every webhook delivery succeeded. `false`: only events with at least one delivery that has not succeeded (pending, retrying, failed or cancelled). Events no endpoint subscribed to match neither value.", "title": "Delivery Success"}}, {"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/EventPage"}}}, "description": "One page of events.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["events:read"]}], "summary": "List events", "tags": ["Events"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["events:read"]}}, "/api/v1/sandbox/events/{event_id}": {"get": {"description": "Fetch one event by id — the `Relvo-Event-Id` header of its webhook deliveries. Events are kept for 30 days after `created_at`; older events are not returned. Requires `events:read`.\n\n**Required scope:** `events:read`", "operationId": "getEvent", "parameters": [{"description": "Id of the event.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "event_id", "required": true, "schema": {"format": "uuid", "title": "Event Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Event"}}}, "description": "The event.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such public event in the token's organization, or it is older than the retention window (`event_not_found`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["events:read"]}], "summary": "Get an event", "tags": ["Events"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["events:read"]}}, "/api/v1/sandbox/fx/currency-conversions": {"get": {"description": "Return the official conversion rate between two currencies in effect at `as_of`: the latest rate published on or before the UTC date of `as_of` (default: now). `rate_date` says which day's rate was used. Rates are exact decimal strings.\n\n**Required scope:** `fx:read`", "operationId": "getCurrencyConversion", "parameters": [{"description": "ISO 4217 currency converted from.", "in": "query", "name": "base_currency", "required": true, "schema": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency converted from."}}, {"description": "ISO 4217 currency converted to.", "in": "query", "name": "quote_currency", "required": true, "schema": {"$ref": "#/components/schemas/CurrencyCodeEnum", "description": "ISO 4217 currency converted to."}}, {"description": "RFC 3339 instant with offset. Omit for the current time.", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "as_of", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "RFC 3339 instant with offset. Omit for the current time.", "title": "As Of"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CurrencyConversion"}}}, "description": "The currency conversion.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No official rate is available for the pair on or before `as_of`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`base_currency` equals `quote_currency` (`currency_pair_invalid`), or `as_of` is not an RFC 3339 instant with an offset (`invalid_timestamp`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["fx:read"]}], "summary": "Get a currency conversion rate", "tags": ["Currency"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["fx:read"]}}, "/api/v1/sandbox/imports/contracts": {"post": {"description": "Upload a signed contract PDF (multipart field `file`). The contract agent drafts the customer, billing entity and contract from it asynchronously; the draft is reviewed in Relvo before anything is created. Answers 202 with the import job. Requires `Idempotency-Key`; an identical retry returns the original job. The `Location` header points at the job's status resource.\n\n**Required scope:** `contracts:write`", "operationId": "createContractImport", "parameters": [{"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"multipart/form-data": {"schema": {"$ref": "#/components/schemas/CreateContractImportRequest"}}}, "required": true}, "responses": {"202": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContractImport"}}}, "description": "Accepted for asynchronous processing. The body is the contract import.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "403": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`contract_import_requester_not_authorized`: no administrator stands behind the request", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "413": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "PDF too large", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The contract agent cannot read the PDF; resend the original (`contract_import_pdf_invalid`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["contracts:write"]}], "summary": "Upload a contract PDF for import", "tags": ["Imports"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["contracts:write"]}}, "/api/v1/sandbox/imports/contracts/{import_id}": {"get": {"description": "Poll the status of a contract import accepted by `createContractImport`. `contract_id` is set once the import is `applied`.\n\n**Required scope:** `contracts:read`", "operationId": "getContractImport", "parameters": [{"description": "Id of the import.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "import_id", "required": true, "schema": {"format": "uuid", "title": "Import Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContractImportDetail"}}}, "description": "The contract import detail.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`contract_import_not_found`: no such import", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["contracts:read"]}], "summary": "Get a contract import", "tags": ["Imports"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["contracts:read"]}}, "/api/v1/sandbox/integrations/chile/taxpayers/lookup": {"get": {"description": "Retrieve the public SII taxpayer data for a Chilean RUT. Does not require a configured fiscal connection.\n\n**Required scope:** `customers:read`", "operationId": "lookupChileanTaxpayer", "parameters": [{"description": "Chilean RUT with check digit, with or without dots (e.g. `76086428-5` or `76.086.428-5`).", "in": "query", "name": "rut", "required": true, "schema": {"description": "Chilean RUT with check digit, with or without dots (e.g. `76086428-5` or `76.086.428-5`).", "examples": ["76086428-5"], "maxLength": 16, "minLength": 8, "title": "Rut", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ChileanTaxpayer"}}}, "description": "The Chilean taxpayer.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`taxpayer_not_found`: no taxpayer is registered under this RUT.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`validation_failed`: `rut` is missing or is not a valid Chilean RUT.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "502": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`taxpayer_lookup_failed`: the upstream registry failed; safe to retry.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "503": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`taxpayer_lookup_unavailable`: lookup is temporarily unavailable; retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["customers:read"]}], "summary": "Look up a Chilean taxpayer by RUT", "tags": ["Taxpayers"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["customers:read"]}}, "/api/v1/sandbox/invoices": {"get": {"description": "List the organization's invoices, newest first by `sort` (ties broken by id), paged with an opaque keyset cursor: pass `next_cursor` back as `cursor` with the same filters and sort; `next_cursor` is null on the last page. Filters combine with AND; a repeated parameter (`status`, `customer_id`, ...) matches any of its values. An unknown enum value is a 422.\n\n**Required scope:** `invoices:read`", "operationId": "listInvoices", "parameters": [{"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}, {"description": "Only these lifecycle statuses.", "in": "query", "name": "status", "required": false, "schema": {"default": [], "description": "Only these lifecycle statuses.", "items": {"$ref": "#/components/schemas/InvoiceStatus"}, "title": "Status", "type": "array"}}, {"description": "Only these fiscal statuses.", "in": "query", "name": "fiscal_status", "required": false, "schema": {"default": [], "description": "Only these fiscal statuses.", "items": {"$ref": "#/components/schemas/FiscalStatus"}, "title": "Fiscal Status", "type": "array"}}, {"description": "Only these payment statuses.", "in": "query", "name": "payment_status", "required": false, "schema": {"default": [], "description": "Only these payment statuses.", "items": {"$ref": "#/components/schemas/InvoicePaymentStatus"}, "title": "Payment Status", "type": "array"}}, {"description": "Only these delivery statuses.", "in": "query", "name": "delivery_status", "required": false, "schema": {"default": [], "description": "Only these delivery statuses.", "items": {"$ref": "#/components/schemas/InvoiceDeliveryStatus"}, "title": "Delivery Status", "type": "array"}}, {"description": "Only invoices for these customers.", "in": "query", "name": "customer_id", "required": false, "schema": {"default": [], "description": "Only invoices for these customers.", "items": {"format": "uuid", "type": "string"}, "maxItems": 100, "title": "Customer Id", "type": "array"}}, {"description": "Only invoices to these customer billing entities.", "in": "query", "name": "billing_entity_id", "required": false, "schema": {"default": [], "description": "Only invoices to these customer billing entities.", "items": {"format": "uuid", "type": "string"}, "maxItems": 100, "title": "Billing Entity Id", "type": "array"}}, {"description": "Only invoices issued from these legal entities.", "in": "query", "name": "issuer_billing_entity_id", "required": false, "schema": {"default": [], "description": "Only invoices issued from these legal entities.", "items": {"format": "uuid", "type": "string"}, "maxItems": 100, "title": "Issuer Billing Entity Id", "type": "array"}}, {"description": "Only invoices of these contracts.", "in": "query", "name": "contract_id", "required": false, "schema": {"default": [], "description": "Only invoices of these contracts.", "items": {"format": "uuid", "type": "string"}, "maxItems": 100, "title": "Contract Id", "type": "array"}}, {"description": "Issue date on or after.", "example": "2026-01-31", "in": "query", "name": "issue_date_from", "required": false, "schema": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Issue date on or after.", "title": "Issue Date From"}}, {"description": "Issue date on or before.", "example": "2026-01-31", "in": "query", "name": "issue_date_to", "required": false, "schema": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Issue date on or before.", "title": "Issue Date To"}}, {"description": "Due date on or after.", "example": "2026-01-31", "in": "query", "name": "due_date_from", "required": false, "schema": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Due date on or after.", "title": "Due Date From"}}, {"description": "Due date on or before.", "example": "2026-01-31", "in": "query", "name": "due_date_to", "required": false, "schema": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Due date on or before.", "title": "Due Date To"}}, {"description": "Only invoices that changed (any committed version) at or after this instant.", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "updated_since", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Only invoices that changed (any committed version) at or after this instant.", "title": "Updated Since"}}, {"description": "Free-text search over customer name, tax id and fiscal number.", "in": "query", "name": "query", "required": false, "schema": {"anyOf": [{"maxLength": 128, "minLength": 2, "type": "string"}, {"type": "null"}], "description": "Free-text search over customer name, tax id and fiscal number.", "title": "Query"}}, {"description": "Sort field.", "in": "query", "name": "sort", "required": false, "schema": {"$ref": "#/components/schemas/InvoiceSortField", "default": "created_at", "description": "Sort field."}}, {"description": "Sort order (descending only).", "in": "query", "name": "order", "required": false, "schema": {"$ref": "#/components/schemas/InvoiceSortOrder", "default": "desc", "description": "Sort order (descending only)."}}, {"description": "Only records whose `metadata` holds this key with exactly this string value, sent as `metadata[<key>]=<value>` (for example `metadata[crm_id]=0017`). Repeat with other keys to require all of them (AND). Matching is exact and case-sensitive; a key whose stored value is not a string never matches. At most 10 keys; keys are 1-40 characters without `[` or `]`, values 1-500 characters. A key may appear once. Invalid input is `422 validation_failed`.", "example": {"crm_id": "0017"}, "explode": true, "in": "query", "name": "metadata", "required": false, "schema": {"additionalProperties": {"maxLength": 500, "minLength": 1, "type": "string"}, "maxProperties": 10, "propertyNames": {"maxLength": 40, "minLength": 1, "pattern": "^[^\\[\\]]+$"}, "type": "object"}, "style": "deepObject"}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/InvoiceList"}}}, "description": "One page of invoices.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:read"]}], "summary": "List invoices", "tags": ["Invoices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:read"]}, "post": {"description": "Create a `draft` invoice for a customer billing entity, optionally with its lines. A draft has no fiscal effect until it is issued. Requires an `Idempotency-Key` header; no `If-Match`. The draft and its lines are created together: if any line is invalid, nothing is created. The response `ETag` is the draft's `version`.\n\n**Required scope:** `invoices:write`", "operationId": "createInvoice", "parameters": [{"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/InvoiceCreate"}}}, "required": true}, "responses": {"201": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Invoice"}}}, "description": "The created invoice.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "Location": {"description": "URL of the created resource.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "A line in `lines` is invalid: the line's financial facts cannot form a valid line, e.g. `item_id` without `price_id` or a `group_id` that is not on this invoice (`invoicing_invoice_line_input_invalid`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:write"]}], "summary": "Create a draft invoice", "tags": ["Invoices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:write"]}}, "/api/v1/sandbox/invoices/{invoice_id}": {"get": {"description": "Fetch one invoice. The `ETag` is its `version`, to send as `If-Match`.\n\n**Required scope:** `invoices:read`", "operationId": "getInvoice", "parameters": [{"description": "Invoice id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "invoice_id", "required": true, "schema": {"description": "Invoice id.", "format": "uuid", "title": "Invoice Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Invoice"}}}, "description": "The invoice.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such invoice in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:read"]}], "summary": "Get an invoice", "tags": ["Invoices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:read"]}, "patch": {"description": "Change header fields of a `draft`; only the fields you send change. `billing_entity_id` and `issuer_billing_entity_id` are sent together. Requires an `Idempotency-Key` header (same key and body replays the original result; a different body is a 409) and `If-Match` with the invoice's current `version` (missing 428, stale 412). Answers the full invoice; its `ETag` is the new `version`.\n\n**Required scope:** `invoices:write`", "operationId": "updateInvoice", "parameters": [{"description": "Invoice id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "invoice_id", "required": true, "schema": {"description": "Invoice id.", "format": "uuid", "title": "Invoice Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/InvoiceUpdate"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Invoice"}}}, "description": "The updated invoice.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such invoice (or sub-resource) in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The invoice is no longer a `draft`, so it cannot be edited (`invoicing_invoice_draft_edit_lifecycle_conflict`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The body changes no field (`invoice_update_empty`), sends only one of `billing_entity_id`/`issuer_billing_entity_id` (`invoice_billing_entities_not_paired`), or nulls `payment_terms_days`/`currency` (`invoice_field_not_clearable`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:write"]}], "summary": "Update a draft invoice", "tags": ["Invoices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:write"]}}, "/api/v1/sandbox/invoices/{invoice_id}/cancel": {"post": {"description": "Abandon a `draft` (or `upcoming`) invoice that was never issued. It moves to `cancelled`, keeps its audit trail and never had a fiscal effect. An issued invoice is corrected with a credit note instead. Requires an `Idempotency-Key` header (same key and body replays the original result; a different body is a 409) and `If-Match` with the invoice's current `version` (missing 428, stale 412). Answers the full invoice; its `ETag` is the new `version`.\n\n**Required scope:** `invoices:write`", "operationId": "cancelInvoice", "parameters": [{"description": "Invoice id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "invoice_id", "required": true, "schema": {"description": "Invoice id.", "format": "uuid", "title": "Invoice Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Invoice"}}}, "description": "The updated invoice.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such invoice (or sub-resource) in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Only a `draft` can be cancelled (`invoicing_invoice_cancellation_lifecycle_conflict`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:write"]}], "summary": "Cancel a draft invoice", "tags": ["Invoices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:write"]}}, "/api/v1/sandbox/invoices/{invoice_id}/commercial-references": {"get": {"description": "Purchase orders, receptions and other commercial references printed on the document; at most one per `kind`. The `ETag` is the invoice `version`.\n\n**Required scope:** `invoices:read`", "operationId": "listInvoiceCommercialReferences", "parameters": [{"description": "Invoice id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "invoice_id", "required": true, "schema": {"description": "Invoice id.", "format": "uuid", "title": "Invoice Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CommercialReferenceList"}}}, "description": "One page of commercial references.", "headers": {"ETag": {"description": "Current invoice version for If-Match on invoice changes.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such invoice in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:read"]}], "summary": "List an invoice's commercial references", "tags": ["Invoices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:read"]}, "post": {"description": "Create or replace the draft's single commercial reference of this `kind`. Requires an `Idempotency-Key` header (same key and body replays the original result; a different body is a 409) and `If-Match` with the invoice's current `version` (missing 428, stale 412). Answers the full invoice; its `ETag` is the new `version`.\n\n**Required scope:** `invoices:write`", "operationId": "setInvoiceCommercialReference", "parameters": [{"description": "Invoice id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "invoice_id", "required": true, "schema": {"description": "Invoice id.", "format": "uuid", "title": "Invoice Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CommercialReferenceInput"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Invoice"}}}, "description": "The updated invoice.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such invoice (or sub-resource) in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The invoice is no longer a `draft`, so it cannot be edited (`invoicing_invoice_draft_edit_lifecycle_conflict`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:write"]}], "summary": "Set a commercial reference on a draft invoice", "tags": ["Invoices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:write"]}}, "/api/v1/sandbox/invoices/{invoice_id}/commercial-references/{kind}": {"delete": {"description": "Remove the draft's commercial reference of this `kind`. `If-Match` must carry the invoice's current `version` (missing 428, stale 412). No `Idempotency-Key` is needed: a retry with the same `If-Match` is safe. Answers 204; the `ETag` header carries the invoice's new `version`.\n\n**Required scope:** `invoices:write`", "operationId": "deleteInvoiceCommercialReference", "parameters": [{"description": "Invoice id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "invoice_id", "required": true, "schema": {"description": "Invoice id.", "format": "uuid", "title": "Invoice Id", "type": "string"}}, {"description": "Reference kind to remove.", "in": "path", "name": "kind", "required": true, "schema": {"$ref": "#/components/schemas/CommercialReferenceKind", "description": "Reference kind to remove."}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"204": {"description": "Deleted; no content.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such invoice (or sub-resource) in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The invoice is no longer a `draft`, so it cannot be edited (`invoicing_invoice_draft_edit_lifecycle_conflict`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:write"]}], "summary": "Remove a commercial reference from a draft invoice", "tags": ["Invoices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:write"]}}, "/api/v1/sandbox/invoices/{invoice_id}/duplicate": {"post": {"description": "Copy an invoice's header and manual lines into a new `draft`, optionally for a different billing entity or issuer. The source invoice is never modified; `If-Match` carries the **source's** `version`. The response is the new draft. Requires an `Idempotency-Key` header (same key and body replays the original result; a different body is a 409) and `If-Match` with the invoice's current `version` (missing 428, stale 412). Answers the full invoice; its `ETag` is the new `version`.\n\n**Required scope:** `invoices:write`", "operationId": "duplicateInvoice", "parameters": [{"description": "Invoice id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "invoice_id", "required": true, "schema": {"description": "Invoice id.", "format": "uuid", "title": "Invoice Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/InvoiceDuplicate"}, {"type": "null"}], "title": "Body"}}}}, "responses": {"201": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Invoice"}}}, "description": "The created invoice.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "Location": {"description": "URL of the created resource.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such invoice (or sub-resource) in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The source has a cross-currency line without its frozen FX evidence and must be repaired before it can be duplicated (`invoicing_invoice_line_fiscal_basis_missing`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:write"]}], "summary": "Duplicate an invoice as a new draft", "tags": ["Invoices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:write"]}}, "/api/v1/sandbox/invoices/{invoice_id}/issue": {"post": {"description": "Freeze a `draft` into an `open` receivable and submit it to the tax authority where the issuer's jurisdiction requires it. The fiscal outcome is reported asynchronously on `fiscal_status`. Requires an `Idempotency-Key` header (same key and body replays the original result; a different body is a 409) and `If-Match` with the invoice's current `version` (missing 428, stale 412). Answers the full invoice; its `ETag` is the new `version`.\n\n**Required scope:** `invoices:write`", "operationId": "issueInvoice", "parameters": [{"description": "Invoice id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "invoice_id", "required": true, "schema": {"description": "Invoice id.", "format": "uuid", "title": "Invoice Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Invoice"}}}, "description": "The updated invoice.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such invoice (or sub-resource) in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The invoice is not a `draft`, or its issuance readiness has blocking findings (`invoicing_invoice_opening_blocked`). Read `params.blocking_codes` for the reasons, including `issuer_fiscal_registration_missing` and `issuer_fiscal_connection_unresolved` for issuer setup.\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:write"]}], "summary": "Issue a draft invoice", "tags": ["Invoices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:write"]}}, "/api/v1/sandbox/invoices/{invoice_id}/line-groups": {"get": {"description": "Presentation groups of the invoice's lines, with per-currency totals of their members. The `ETag` is the invoice `version`.\n\n**Required scope:** `invoices:read`", "operationId": "listInvoiceLineGroups", "parameters": [{"description": "Invoice id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "invoice_id", "required": true, "schema": {"description": "Invoice id.", "format": "uuid", "title": "Invoice Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/InvoiceLineGroupList"}}}, "description": "One page of invoice line groups.", "headers": {"ETag": {"description": "Current invoice version for If-Match on invoice changes.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such invoice in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:read"]}], "summary": "List an invoice's line groups", "tags": ["Invoices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:read"]}, "post": {"description": "Add a presentation group; assign lines to it with their `group_id`. Requires an `Idempotency-Key` header (same key and body replays the original result; a different body is a 409) and `If-Match` with the invoice's current `version` (missing 428, stale 412). Answers the full invoice; its `ETag` is the new `version`.\n\n**Required scope:** `invoices:write`", "operationId": "createInvoiceLineGroup", "parameters": [{"description": "Invoice id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "invoice_id", "required": true, "schema": {"description": "Invoice id.", "format": "uuid", "title": "Invoice Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/InvoiceLineGroupInput"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Invoice"}}}, "description": "The updated invoice.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such invoice (or sub-resource) in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The invoice is no longer a `draft`, so it cannot be edited (`invoicing_invoice_draft_edit_lifecycle_conflict`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:write"]}], "summary": "Create a line group on a draft invoice", "tags": ["Invoices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:write"]}}, "/api/v1/sandbox/invoices/{invoice_id}/line-groups/{group_id}": {"delete": {"description": "Remove a presentation group from a `draft`. `If-Match` must carry the invoice's current `version` (missing 428, stale 412). No `Idempotency-Key` is needed: a retry with the same `If-Match` is safe. Answers 204; the `ETag` header carries the invoice's new `version`.\n\n**Required scope:** `invoices:write`", "operationId": "deleteInvoiceLineGroup", "parameters": [{"description": "Invoice id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "invoice_id", "required": true, "schema": {"description": "Invoice id.", "format": "uuid", "title": "Invoice Id", "type": "string"}}, {"description": "Line group id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "group_id", "required": true, "schema": {"description": "Line group id.", "format": "uuid", "title": "Group Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"204": {"description": "Deleted; no content.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such invoice (or sub-resource) in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The invoice is no longer a `draft` (`invoicing_invoice_draft_edit_lifecycle_conflict`), or lines are still assigned to the group; reassign or ungroup them first (`invoicing_invoice_draft_resource_removal_conflict`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:write"]}], "summary": "Remove a draft invoice line group", "tags": ["Invoices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:write"]}, "patch": {"description": "Change a group's `title` or `description`; only the fields you send change (`description: null` clears it). Requires an `Idempotency-Key` header (same key and body replays the original result; a different body is a 409) and `If-Match` with the invoice's current `version` (missing 428, stale 412). Answers the full invoice; its `ETag` is the new `version`.\n\n**Required scope:** `invoices:write`", "operationId": "updateInvoiceLineGroup", "parameters": [{"description": "Invoice id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "invoice_id", "required": true, "schema": {"description": "Invoice id.", "format": "uuid", "title": "Invoice Id", "type": "string"}}, {"description": "Line group id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "group_id", "required": true, "schema": {"description": "Line group id.", "format": "uuid", "title": "Group Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/InvoiceLineGroupUpdate"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Invoice"}}}, "description": "The updated invoice.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such invoice (or sub-resource) in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The invoice is no longer a `draft`, so it cannot be edited (`invoicing_invoice_draft_edit_lifecycle_conflict`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The body changes no field (`invoice_line_group_update_empty`), or nulls `title` (`invoice_line_group_field_not_clearable`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:write"]}], "summary": "Update a draft invoice line group", "tags": ["Invoices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:write"]}}, "/api/v1/sandbox/invoices/{invoice_id}/lines": {"get": {"description": "The invoice's lines in document order. The `ETag` is the invoice `version`.\n\n**Required scope:** `invoices:read`", "operationId": "listInvoiceLines", "parameters": [{"description": "Invoice id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "invoice_id", "required": true, "schema": {"description": "Invoice id.", "format": "uuid", "title": "Invoice Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/InvoiceLineList"}}}, "description": "One page of invoice lines.", "headers": {"ETag": {"description": "Current invoice version for If-Match on invoice changes.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such invoice in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:read"]}], "summary": "List an invoice's lines", "tags": ["Invoices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:read"]}, "post": {"description": "Append one manually authored line to a `draft`. An action on the invoice: answers 200 with the full invoice. Requires an `Idempotency-Key` header (same key and body replays the original result; a different body is a 409) and `If-Match` with the invoice's current `version` (missing 428, stale 412). Answers the full invoice; its `ETag` is the new `version`.\n\n**Required scope:** `invoices:write`", "operationId": "addInvoiceLine", "parameters": [{"description": "Invoice id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "invoice_id", "required": true, "schema": {"description": "Invoice id.", "format": "uuid", "title": "Invoice Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/InvoiceLineInput"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Invoice"}}}, "description": "The updated invoice.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such invoice (or sub-resource) in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The invoice is no longer a `draft`, so it cannot be edited (`invoicing_invoice_draft_edit_lifecycle_conflict`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The line's financial facts cannot form a valid line, e.g. `item_id` without `price_id` or a `group_id` that is not on this invoice (`invoicing_invoice_line_input_invalid`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:write"]}], "summary": "Add a line to a draft invoice", "tags": ["Invoices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:write"]}}, "/api/v1/sandbox/invoices/{invoice_id}/lines/{line_id}": {"delete": {"description": "Remove one line from a `draft`. Removing a billing-generated line suppresses it, so billing does not regenerate it; see `listInvoiceSuppressedLines`. `If-Match` must carry the invoice's current `version` (missing 428, stale 412). No `Idempotency-Key` is needed: a retry with the same `If-Match` is safe. Answers 204; the `ETag` header carries the invoice's new `version`.\n\n**Required scope:** `invoices:write`", "operationId": "deleteInvoiceLine", "parameters": [{"description": "Invoice id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "invoice_id", "required": true, "schema": {"description": "Invoice id.", "format": "uuid", "title": "Invoice Id", "type": "string"}}, {"description": "Line id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "line_id", "required": true, "schema": {"description": "Line id.", "format": "uuid", "title": "Line Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"204": {"description": "Deleted; no content.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such invoice (or sub-resource) in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The invoice is no longer a `draft`, so it cannot be edited (`invoicing_invoice_draft_edit_lifecycle_conflict`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:write"]}], "summary": "Remove a draft invoice line", "tags": ["Invoices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:write"]}, "patch": {"description": "Change fields of one `draft` line; only the fields you send change. On a billing-generated line the amount you set is kept as an override. With an active total discount, remove it before changing `net_amount` or `currency` (409 `invoice_line_total_discount_review_required`); other edits preserve the reviewed discount base. Requires an `Idempotency-Key` header (same key and body replays the original result; a different body is a 409) and `If-Match` with the invoice's current `version` (missing 428, stale 412). Answers the full invoice; its `ETag` is the new `version`.\n\n**Required scope:** `invoices:write`", "operationId": "updateInvoiceLine", "parameters": [{"description": "Invoice id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "invoice_id", "required": true, "schema": {"description": "Invoice id.", "format": "uuid", "title": "Invoice Id", "type": "string"}}, {"description": "Line id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "line_id", "required": true, "schema": {"description": "Line id.", "format": "uuid", "title": "Line Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/InvoiceLineUpdate"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Invoice"}}}, "description": "The updated invoice.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such invoice (or sub-resource) in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The invoice is no longer a `draft`, so it cannot be edited (`invoicing_invoice_draft_edit_lifecycle_conflict`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The body changes no field (`invoice_line_update_empty`), or the line's financial facts cannot form a valid line, e.g. `item_id` without `price_id` or a `group_id` that is not on this invoice (`invoicing_invoice_line_input_invalid`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:write"]}], "summary": "Update a draft invoice line", "tags": ["Invoices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:write"]}}, "/api/v1/sandbox/invoices/{invoice_id}/pdf": {"get": {"description": "The authority-rendered PDF of an issued invoice. 404 until the fiscal authority has produced it; 503 when artifact storage is temporarily unavailable (retry).\n\n**Required scope:** `invoices:read`", "operationId": "getInvoicePdf", "parameters": [{"description": "Invoice id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "invoice_id", "required": true, "schema": {"description": "Invoice id.", "format": "uuid", "title": "Invoice Id", "type": "string"}}], "responses": {"200": {"content": {"application/pdf": {"schema": {"format": "binary", "type": "string"}}}, "description": "The authority-rendered fiscal PDF", "headers": {"ETag": {"description": "SHA-256 checksum of the document bytes.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The document does not exist for this organization, or has no stored artifact", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "503": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Artifact storage is temporarily unavailable; the request may be retried", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:read"]}], "summary": "Download the fiscal PDF", "tags": ["Invoices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:read"]}}, "/api/v1/sandbox/invoices/{invoice_id}/suppressed-lines": {"get": {"description": "Billing-generated lines removed from this draft. Billing will not regenerate them until restored. The `ETag` is the invoice `version`.\n\n**Required scope:** `invoices:read`", "operationId": "listInvoiceSuppressedLines", "parameters": [{"description": "Invoice id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "invoice_id", "required": true, "schema": {"description": "Invoice id.", "format": "uuid", "title": "Invoice Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuppressedLineList"}}}, "description": "One page of suppressed lines.", "headers": {"ETag": {"description": "Current invoice version for If-Match on invoice changes.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such invoice in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:read"]}], "summary": "List suppressed generated lines", "tags": ["Invoices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:read"]}}, "/api/v1/sandbox/invoices/{invoice_id}/suppressed-lines/{suppression_id}/restore": {"post": {"description": "Lift one suppression so billing may produce the line again; it comes back computed fresh on the next billing pass, not resurrected from a stale copy. Requires an `Idempotency-Key` header (same key and body replays the original result; a different body is a 409) and `If-Match` with the invoice's current `version` (missing 428, stale 412). Answers the full invoice; its `ETag` is the new `version`.\n\n**Required scope:** `invoices:write`", "operationId": "restoreInvoiceSuppressedLine", "parameters": [{"description": "Invoice id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "invoice_id", "required": true, "schema": {"description": "Invoice id.", "format": "uuid", "title": "Invoice Id", "type": "string"}}, {"description": "Suppression id from `listInvoiceSuppressedLines`.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "suppression_id", "required": true, "schema": {"description": "Suppression id from `listInvoiceSuppressedLines`.", "format": "uuid", "title": "Suppression Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Invoice"}}}, "description": "The updated invoice.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such invoice (or sub-resource) in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The invoice is no longer a `draft`, so it cannot be edited (`invoicing_invoice_draft_edit_lifecycle_conflict`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:write"]}], "summary": "Restore a suppressed generated line", "tags": ["Invoices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:write"]}}, "/api/v1/sandbox/invoices/{invoice_id}/versions/{version}": {"get": {"description": "Fetch the invoice exactly as it stood at one committed `version`, for audit and for reconciling what you saw against what changed.\n\n**Required scope:** `invoices:read`", "operationId": "getInvoiceVersion", "parameters": [{"description": "Invoice id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "invoice_id", "required": true, "schema": {"description": "Invoice id.", "format": "uuid", "title": "Invoice Id", "type": "string"}}, {"description": "Invoice version.", "in": "path", "name": "version", "required": true, "schema": {"description": "Invoice version.", "minimum": 1, "title": "Version", "type": "integer"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Invoice"}}}, "description": "The invoice.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such invoice or version in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:read"]}], "summary": "Get an invoice as of one version", "tags": ["Invoices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:read"]}}, "/api/v1/sandbox/invoices/{invoice_id}/xml": {"get": {"description": "The authority-stamped XML of an issued invoice. 404 until it exists; 503 when artifact storage is temporarily unavailable (retry).\n\n**Required scope:** `invoices:read`", "operationId": "getInvoiceXml", "parameters": [{"description": "Invoice id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "invoice_id", "required": true, "schema": {"description": "Invoice id.", "format": "uuid", "title": "Invoice Id", "type": "string"}}], "responses": {"200": {"content": {"application/xml": {"schema": {"format": "binary", "type": "string"}}, "text/xml": {"schema": {"format": "binary", "type": "string"}}}, "description": "The authority-rendered fiscal XML", "headers": {"ETag": {"description": "SHA-256 checksum of the document bytes.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The document does not exist for this organization, or has no stored artifact", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "503": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Artifact storage is temporarily unavailable; the request may be retried", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["invoices:read"]}], "summary": "Download the fiscal XML", "tags": ["Invoices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["invoices:read"]}}, "/api/v1/sandbox/messages": {"get": {"description": "List inbound and outbound email, newest first (`occurred_at` desc, then id desc). Pass `next_cursor` back as `cursor` with the same filters until it is null.\n\n**Required scope:** `messages:read`", "operationId": "listMessages", "parameters": [{"description": "Only this direction.", "in": "query", "name": "direction", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/MessageDirection"}, {"type": "null"}], "description": "Only this direction.", "title": "Direction"}}, {"description": "Only messages about this invoice.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "invoice_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Only messages about this invoice.", "title": "Invoice Id"}}, {"description": "Literal phrase in available stored subject/body/attachment names; not attachment bytes.", "in": "query", "name": "q", "required": false, "schema": {"anyOf": [{"maxLength": 200, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Literal phrase in available stored subject/body/attachment names; not attachment bytes.", "title": "Q"}}, {"description": "Exact sender mailbox, case insensitive.", "in": "query", "name": "sender", "required": false, "schema": {"anyOf": [{"maxLength": 320, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Exact sender mailbox, case insensitive.", "title": "Sender"}}, {"description": "Exact recipient mailbox, case insensitive.", "in": "query", "name": "recipient", "required": false, "schema": {"anyOf": [{"maxLength": 320, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Exact recipient mailbox, case insensitive.", "title": "Recipient"}}, {"description": "Inclusive received/created instant with timezone.", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "since", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Inclusive received/created instant with timezone.", "title": "Since"}}, {"description": "Exclusive received/created instant with timezone.", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "until", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Exclusive received/created instant with timezone.", "title": "Until"}}, {"description": "Filter attachment metadata presence, not successful scanning.", "in": "query", "name": "has_attachments", "required": false, "schema": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "description": "Filter attachment metadata presence, not successful scanning.", "title": "Has Attachments"}}, {"description": "OC/purchase-order text or filename mentions, advisory AI commercial-reference candidates and recorded purchase orders. Not confirmation of document contents.", "in": "query", "name": "purchase_order_candidates", "required": false, "schema": {"default": false, "description": "OC/purchase-order text or filename mentions, advisory AI commercial-reference candidates and recorded purchase orders. Not confirmation of document contents.", "title": "Purchase Order Candidates", "type": "boolean"}}, {"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/MessagePage"}}}, "description": "One page of messages.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["messages:read"]}], "summary": "List messages", "tags": ["Messages"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["messages:read"]}}, "/api/v1/sandbox/messages/{message_id}": {"get": {"description": "Fetch one message, inbound or outbound, with its body, participants and attachments. The classification block is an AI suggestion for review. `ETag` carries the message version, which advances as an outbound message moves through its delivery lifecycle.\n\n**Required scope:** `messages:read`", "operationId": "getMessage", "parameters": [{"description": "Id of the message.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "message_id", "required": true, "schema": {"format": "uuid", "title": "Message Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Message"}}}, "description": "The message.", "headers": {"ETag": {"description": "Current message version.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`message_not_found`: no such message.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["messages:read"]}], "summary": "Get a message", "tags": ["Messages"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["messages:read"]}}, "/api/v1/sandbox/payment-methods": {"get": {"description": "List the organization's payment methods, oldest first. Filters combine with AND. A method with empty `supported_currencies` / `supported_countries` supports any value, so it matches every `currency` / `country` filter.\n\n**Required scope:** `payment_methods:read`", "operationId": "listPaymentMethods", "parameters": [{"description": "Only active (`true`) or inactive (`false`).", "in": "query", "name": "is_active", "required": false, "schema": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "description": "Only active (`true`) or inactive (`false`).", "title": "Is Active"}}, {"description": "Only methods of this kind (how the payer pays). Omit to return methods of every kind.", "in": "query", "name": "kind", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/PaymentMethodKind"}, {"type": "null"}], "description": "Only methods of this kind (how the payer pays). Omit to return methods of every kind.", "examples": ["bank_transfer"], "title": "Kind"}}, {"description": "Only methods collected by this provider. Methods without a `provider` never match. Omit to return methods of every provider, and those without one.", "in": "query", "name": "provider", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/CollectionProvider"}, {"type": "null"}], "description": "Only methods collected by this provider. Methods without a `provider` never match. Omit to return methods of every provider, and those without one.", "examples": ["toku"], "title": "Provider"}}, {"description": "ISO 4217 code, case-insensitive. An unknown code returns 422.", "in": "query", "name": "currency", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "ISO 4217 code, case-insensitive. An unknown code returns 422.", "title": "Currency"}}, {"description": "ISO 3166-1 alpha-2 code, case-insensitive. An unknown code returns 422.", "in": "query", "name": "country", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/CountryEnum"}, {"type": "null"}], "description": "ISO 3166-1 alpha-2 code, case-insensitive. An unknown code returns 422.", "title": "Country"}}, {"description": "Only records with `updated_at` at or after this instant (inclusive). Use it to sync changes incrementally.", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "updated_since", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Only records with `updated_at` at or after this instant (inclusive). Use it to sync changes incrementally.", "title": "Updated Since"}}, {"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentMethodPage"}}}, "description": "One page of payment methods.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["payment_methods:read"]}], "summary": "List payment methods", "tags": ["Payment Methods"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["payment_methods:read"]}, "post": {"description": "Create an organization payment method. Currency and country codes are normalized to upper case. Send an `Idempotency-Key`: the same key and body replays the original result; the same key with a different body returns 409 `idempotency_key_reused`.\n\n**Required scope:** `payment_methods:write`", "operationId": "createPaymentMethod", "parameters": [{"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentMethodCreateRequest"}}}, "required": true}, "responses": {"201": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentMethod"}}}, "description": "The created payment method.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "Location": {"description": "URL of the created resource.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "A concurrent write to the same payment method won the race; read it again and retry (`payment_method_conflict`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The method's fields break a payment-method rule — for example an `offline` method with a provider, a provider without a connection, or a `bank_account_id` on a kind other than `bank_transfer` (`payment_method_invalid`). The referenced bank account or provider connection does not exist, is inactive, or does not match the method's provider (`payment_method_reference_unusable`). A Relvo-collected `bank_transfer` method has no `bank_account_id` (`payments_payment_method_bank_account_required`), the account lacks the number, holder name or holder id a payer needs (`payments_payment_method_bank_account_incomplete`, `params.missing` names the fields), or the account's currency is not one the method supports (`payments_payment_method_bank_account_currency_unsupported`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["payment_methods:write"]}], "summary": "Create a payment method", "tags": ["Payment Methods"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["payment_methods:write"]}}, "/api/v1/sandbox/payment-methods/{payment_method_id}": {"get": {"description": "Return one of the organization's payment methods, active or inactive. The `ETag` header carries its `version`; send it as `If-Match` on the next write.\n\n**Required scope:** `payment_methods:read`", "operationId": "getPaymentMethod", "parameters": [{"description": "Id of the payment method.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "payment_method_id", "required": true, "schema": {"format": "uuid", "title": "Payment Method Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentMethod"}}}, "description": "The payment method.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No payment method with this id in the token's organization (`payment_method_not_found`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["payment_methods:read"]}], "summary": "Get a payment method", "tags": ["Payment Methods"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["payment_methods:read"]}, "patch": {"description": "Partially update a payment method; omitted fields are unchanged. `kind` and `provider` cannot change — create a new method instead. Send `If-Match` with the `ETag` (the resource's `version`) from your last read. Missing returns 428; stale returns 412 — re-read and retry. Send an `Idempotency-Key`: the same key and body replays the original result; the same key with a different body returns 409 `idempotency_key_reused`.\n\n**Required scope:** `payment_methods:write`", "operationId": "updatePaymentMethod", "parameters": [{"description": "Id of the payment method.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "payment_method_id", "required": true, "schema": {"format": "uuid", "title": "Payment Method Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentMethodUpdateRequest"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentMethod"}}}, "description": "The updated payment method.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No payment method with this id in the token's organization (`payment_method_not_found`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The payment method is inactive, and inactive methods are terminal (`payment_method_inactive`). A concurrent write to the same payment method won the race; read it again and retry (`payment_method_conflict`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The method's fields break a payment-method rule — for example an `offline` method with a provider, a provider without a connection, or a `bank_account_id` on a kind other than `bank_transfer` (`payment_method_invalid`). The referenced bank account or provider connection does not exist, is inactive, or does not match the method's provider (`payment_method_reference_unusable`). A Relvo-collected `bank_transfer` method has no `bank_account_id` (`payments_payment_method_bank_account_required`), the account lacks the number, holder name or holder id a payer needs (`payments_payment_method_bank_account_incomplete`, `params.missing` names the fields), or the account's currency is not one the method supports (`payments_payment_method_bank_account_currency_unsupported`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["payment_methods:write"]}], "summary": "Update a payment method", "tags": ["Payment Methods"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["payment_methods:write"]}}, "/api/v1/sandbox/payment-methods/{payment_method_id}/clear-organization-default": {"post": {"description": "Remove the organization-default flag from this method, leaving the organization without a default. Send `If-Match` with the `ETag` (the resource's `version`) from your last read. Missing returns 428; stale returns 412 — re-read and retry. Send an `Idempotency-Key`: the same key and body replays the original result; the same key with a different body returns 409 `idempotency_key_reused`.\n\n**Required scope:** `payment_methods:write`", "operationId": "clearOrganizationDefaultPaymentMethod", "parameters": [{"description": "Id of the payment method.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "payment_method_id", "required": true, "schema": {"format": "uuid", "title": "Payment Method Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentMethod"}}}, "description": "The updated payment method.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No payment method with this id in the token's organization (`payment_method_not_found`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "A concurrent write to the same payment method won the race; read it again and retry (`payment_method_conflict`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The method's fields break a payment-method rule — for example an `offline` method with a provider, a provider without a connection, or a `bank_account_id` on a kind other than `bank_transfer` (`payment_method_invalid`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["payment_methods:write"]}], "summary": "Clear the organization default", "tags": ["Payment Methods"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["payment_methods:write"]}}, "/api/v1/sandbox/payment-methods/{payment_method_id}/deactivate": {"post": {"description": "Deactivate a payment method so it can no longer be assigned. Customer default assignments that pointed at it lose their default flag; list a customer's payment methods to see the result. The record is kept for audit. Send `If-Match` with the `ETag` (the resource's `version`) from your last read. Missing returns 428; stale returns 412 — re-read and retry. Send an `Idempotency-Key`: the same key and body replays the original result; the same key with a different body returns 409 `idempotency_key_reused`.\n\n**Required scope:** `payment_methods:write`", "operationId": "deactivatePaymentMethod", "parameters": [{"description": "Id of the payment method.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "payment_method_id", "required": true, "schema": {"format": "uuid", "title": "Payment Method Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentMethod"}}}, "description": "The updated payment method.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No payment method with this id in the token's organization (`payment_method_not_found`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The method is already inactive (`payment_method_inactive`). Active transfer routes still point at this method; re-route or deactivate them first (`payment_method_conflict`). A concurrent write to the same payment method won the race; read it again and retry (`payment_method_conflict`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The method's fields break a payment-method rule — for example an `offline` method with a provider, a provider without a connection, or a `bank_account_id` on a kind other than `bank_transfer` (`payment_method_invalid`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["payment_methods:write"]}], "summary": "Deactivate a payment method", "tags": ["Payment Methods"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["payment_methods:write"]}}, "/api/v1/sandbox/payment-methods/{payment_method_id}/set-organization-default": {"post": {"description": "Make this method the organization default, used for billing entities with no default of their own. The previous default is demoted in the same transaction. The method must be active and reference an active bank account, otherwise 409. Send `If-Match` with the `ETag` (the resource's `version`) from your last read. Missing returns 428; stale returns 412 — re-read and retry. Send an `Idempotency-Key`: the same key and body replays the original result; the same key with a different body returns 409 `idempotency_key_reused`.\n\n**Required scope:** `payment_methods:write`", "operationId": "setOrganizationDefaultPaymentMethod", "parameters": [{"description": "Id of the payment method.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "payment_method_id", "required": true, "schema": {"format": "uuid", "title": "Payment Method Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentMethod"}}}, "description": "The updated payment method.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No payment method with this id in the token's organization (`payment_method_not_found`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The payment method is inactive, and inactive methods are terminal (`payment_method_inactive`). The method references no bank account, or its bank account is inactive (`payment_method_conflict`). A concurrent write to the same payment method won the race; read it again and retry (`payment_method_conflict`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The method's fields break a payment-method rule — for example an `offline` method with a provider, a provider without a connection, or a `bank_account_id` on a kind other than `bank_transfer` (`payment_method_invalid`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["payment_methods:write"]}], "summary": "Make a payment method the organization default", "tags": ["Payment Methods"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["payment_methods:write"]}}, "/api/v1/sandbox/payments": {"get": {"description": "List payments received, newest first (`received_at` desc, then id desc). Pass `next_cursor` back as `cursor` with the same filters until it is null. Filters combine with AND; a repeated filter (`status=pending&status=succeeded`) matches any of its values. `invoice_id` returns the payments currently applied to any of the given invoices. Use `updated_since` to sync only payments that changed — including a reversed allocation or a refund — at or after an instant.\n\n**Required scope:** `payments:read`", "operationId": "listPayments", "parameters": [{"description": "Only payments from this customer.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "customer_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Only payments from this customer.", "title": "Customer Id"}}, {"description": "Only payments applied to this invoice. Repeat to match any of up to 100 invoices.", "in": "query", "name": "invoice_id", "required": false, "schema": {"anyOf": [{"items": {"format": "uuid", "type": "string"}, "maxItems": 100, "type": "array"}, {"type": "null"}], "description": "Only payments applied to this invoice. Repeat to match any of up to 100 invoices.", "title": "Invoice Id"}}, {"description": "Only payments in this state. Repeat to match any of several.", "in": "query", "name": "status", "required": false, "schema": {"anyOf": [{"items": {"$ref": "#/components/schemas/PaymentState"}, "type": "array"}, {"type": "null"}], "description": "Only payments in this state. Repeat to match any of several.", "title": "Status"}}, {"description": "Only payments received at or after this instant (inclusive). Offset required.", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "received_at_from", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Only payments received at or after this instant (inclusive). Offset required.", "title": "Received At From"}}, {"description": "Only payments received at or before this instant (inclusive). Offset required.", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "received_at_to", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Only payments received at or before this instant (inclusive). Offset required.", "title": "Received At To"}}, {"description": "Only payments whose `updated_at` is at or after this instant (inclusive). Offset required.", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "updated_since", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Only payments whose `updated_at` is at or after this instant (inclusive). Offset required.", "title": "Updated Since"}}, {"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentPage"}}}, "description": "One page of payments.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`received_at_from` is after `received_at_to` (`invalid_range`), more than 100 `invoice_id` values (`validation_failed` with `params.field` = `invoice_id`), or a schema violation (`validation_failed`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["payments:read"]}], "summary": "List payments", "tags": ["Payments"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["payments:read"]}}, "/api/v1/sandbox/payments/{payment_id}": {"get": {"description": "Fetch one payment with its current allocations to invoices.\n\n**Required scope:** `payments:read`", "operationId": "getPayment", "parameters": [{"description": "Id of the payment.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "payment_id", "required": true, "schema": {"format": "uuid", "title": "Payment Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Payment"}}}, "description": "The payment.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`payment_not_found`: no payment with this id in your organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["payments:read"]}], "summary": "Get a payment", "tags": ["Payments"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["payments:read"]}}, "/api/v1/sandbox/prices": {"get": {"description": "List prices of every status. Repeat `type` / `status` to match several; `query` matches the name or invoice name, case-insensitively. Ordered by `sort` then `id`; pass `next_cursor` back as `cursor` with identical filters.\n\n**Required scope:** `charging:read`", "operationId": "listPrices", "parameters": [{"description": "Only prices of these types.", "in": "query", "name": "type", "required": false, "schema": {"anyOf": [{"items": {"$ref": "#/components/schemas/PriceType"}, "type": "array"}, {"type": "null"}], "description": "Only prices of these types.", "title": "Type"}}, {"description": "Only prices in these statuses.", "in": "query", "name": "status", "required": false, "schema": {"anyOf": [{"items": {"$ref": "#/components/schemas/PriceStatus"}, "type": "array"}, {"type": "null"}], "description": "Only prices in these statuses.", "title": "Status"}}, {"description": "Text match on the names.", "in": "query", "name": "query", "required": false, "schema": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "Text match on the names.", "title": "Query"}}, {"description": "Only prices updated at or after this instant.", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "updated_since", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Only prices updated at or after this instant.", "title": "Updated Since"}}, {"description": "Field to order by: `created_at` (default) or `updated_at`. Rows with equal values are ordered by `id`, so paging is stable.", "in": "query", "name": "sort", "required": false, "schema": {"$ref": "#/components/schemas/SortField", "default": "created_at", "description": "Field to order by: `created_at` (default) or `updated_at`. Rows with equal values are ordered by `id`, so paging is stable.", "examples": ["updated_at"]}}, {"description": "Direction for `sort`: `desc` (default, newest first) or `asc` (oldest first).", "in": "query", "name": "order", "required": false, "schema": {"$ref": "#/components/schemas/SortOrder", "default": "desc", "description": "Direction for `sort`: `desc` (default, newest first) or `asc` (oldest first).", "examples": ["asc"]}}, {"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/PricePage"}}}, "description": "One page of prices.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["charging:read"]}], "summary": "List prices", "tags": ["Prices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["charging:read"]}, "post": {"description": "Create a fixed, usage or seat price; the body is discriminated by `type` and its `pricing` by `model`. Fixed and seat prices are always `standard`. Amounts, rates and decimal quantities are strings. Tiers are `{from, up_to}`: a tier covers `from < quantity <= up_to`, the first starts at `0` (or `free_units`), each later tier starts at the previous `up_to`, and only the last is open-ended. Requires an `Idempotency-Key` header.\n\n**Required scope:** `charging:write`", "operationId": "createPrice", "parameters": [{"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"discriminator": {"mapping": {"fixed": "#/components/schemas/CreateFixedPriceRequest", "seat": "#/components/schemas/CreateSeatPriceRequest", "usage": "#/components/schemas/CreateUsagePriceRequest"}, "propertyName": "type"}, "oneOf": [{"$ref": "#/components/schemas/CreateFixedPriceRequest"}, {"$ref": "#/components/schemas/CreateUsagePriceRequest"}, {"$ref": "#/components/schemas/CreateSeatPriceRequest"}], "title": "Payload"}}}, "required": true}, "responses": {"201": {"content": {"application/json": {"schema": {"discriminator": {"mapping": {"fixed": "#/components/schemas/FixedPrice", "seat": "#/components/schemas/SeatPrice", "usage": "#/components/schemas/UsagePrice"}, "propertyName": "type"}, "oneOf": [{"$ref": "#/components/schemas/FixedPrice"}, {"$ref": "#/components/schemas/UsagePrice"}, {"$ref": "#/components/schemas/SeatPrice"}], "title": "Response Createprice"}}}, "description": "The created price.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "Location": {"description": "URL of the created resource.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "A referenced item, billable metric or seat metric does not exist, or the pricing definition breaks a pricing rule (`validation_failed`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["charging:write"]}], "summary": "Create a price", "tags": ["Prices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["charging:write"]}}, "/api/v1/sandbox/prices/formula/preview": {"post": {"description": "Evaluate a formula expression against sample inputs without writing anything, and return the period total it would bill. Read-only, so no `Idempotency-Key` is needed.\n\n**Required scope:** `charging:read`", "operationId": "previewPriceFormula", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/PreviewPriceFormulaRequest"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/PriceFormulaPreview"}}}, "description": "The price formula preview.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The expression does not compile or cannot be evaluated with the given inputs (`validation_failed`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["charging:read"]}], "summary": "Preview a formula price", "tags": ["Prices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["charging:read"]}}, "/api/v1/sandbox/prices/{price_id}": {"delete": {"description": "Archive a price that was never published: a `draft` price moves to `archived` and stays readable. Published prices answer `409`; set `status` with PATCH instead. Requires `If-Match` (`412` when stale, `428` when missing). Returns `204` with no body.\n\n**Required scope:** `charging:write`", "operationId": "deletePrice", "parameters": [{"description": "Id of the price.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "price_id", "required": true, "schema": {"format": "uuid", "title": "Price Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"204": {"description": "Deleted; no content.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Price not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "A contract uses the price (`price_in_use`); or the price is active, was published before, is already archived or deleted, or was changed concurrently (`price_lifecycle_conflict`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["charging:write"]}], "summary": "Delete a price", "tags": ["Prices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["charging:write"]}, "get": {"description": "Fetch one price, archived ones included. The body is the fixed, usage or seat variant selected by `type`, with `pricing` shaped by its `model`. `status` is `draft` (not yet usable on contracts), `active` or `archived`; the `ETag` carries the version to send as `If-Match` on a later PATCH or DELETE.\n\n**Required scope:** `charging:read`", "operationId": "getPrice", "parameters": [{"description": "Id of the price.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "price_id", "required": true, "schema": {"format": "uuid", "title": "Price Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"discriminator": {"mapping": {"fixed": "#/components/schemas/FixedPrice", "seat": "#/components/schemas/SeatPrice", "usage": "#/components/schemas/UsagePrice"}, "propertyName": "type"}, "oneOf": [{"$ref": "#/components/schemas/FixedPrice"}, {"$ref": "#/components/schemas/UsagePrice"}, {"$ref": "#/components/schemas/SeatPrice"}], "title": "Response Getprice"}}}, "description": "The price.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Price not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["charging:read"]}], "summary": "Get a price", "tags": ["Prices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["charging:read"]}, "patch": {"description": "Update a price's name, invoice label or `draft`/`active` status. Pricing is immutable; create a new price to change what it bills. Requires `If-Match` (`412` when stale, `428` when missing).\n\n**Required scope:** `charging:write`", "operationId": "updatePrice", "parameters": [{"description": "Id of the price.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "price_id", "required": true, "schema": {"format": "uuid", "title": "Price Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UpdatePriceRequest"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"discriminator": {"mapping": {"fixed": "#/components/schemas/FixedPrice", "seat": "#/components/schemas/SeatPrice", "usage": "#/components/schemas/UsagePrice"}, "propertyName": "type"}, "oneOf": [{"$ref": "#/components/schemas/FixedPrice"}, {"$ref": "#/components/schemas/UsagePrice"}, {"$ref": "#/components/schemas/SeatPrice"}], "title": "Response Updateprice"}}}, "description": "The updated price.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Price not found", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Setting `draft` on an active price that a contract uses (`price_in_use`); or the price is archived or deleted, or was changed concurrently (`price_lifecycle_conflict`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["charging:write"]}], "summary": "Update a price", "tags": ["Prices"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["charging:write"]}}, "/api/v1/sandbox/quote-templates": {"get": {"description": "List published quote templates using their latest published defaults. Unpublished edits do not change these defaults. Cursors are bound to the organization and filters.\n\n**Required scope:** `full_read`", "operationId": "listQuoteTemplates", "parameters": [{"description": "Maximum number of templates to return.", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of templates to return.", "maximum": 100, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Fetch the page after this opaque cursor.", "in": "query", "name": "after", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Fetch the page after this opaque cursor.", "title": "After"}}, {"description": "Fetch the page before this opaque cursor.", "in": "query", "name": "before", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Fetch the page before this opaque cursor.", "title": "Before"}}, {"description": "Comma-separated creator references returned by this API.", "in": "query", "name": "createdBy", "required": false, "schema": {"anyOf": [{"maxLength": 4096, "type": "string"}, {"type": "null"}], "description": "Comma-separated creator references returned by this API.", "title": "Createdby"}}, {"description": "Currency of the latest published defaults.", "in": "query", "name": "currency", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "Currency of the latest published defaults.", "title": "Currency"}}, {"description": "Commercial purpose of the published template.", "in": "query", "name": "dealType", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/QuoteTemplateDealType"}, {"type": "null"}], "description": "Commercial purpose of the published template.", "title": "Dealtype"}}, {"description": "Include archived templates in the results.", "in": "query", "name": "includeArchived", "required": false, "schema": {"default": false, "description": "Include archived templates in the results.", "title": "Includearchived", "type": "boolean"}}, {"description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "in": "header", "name": "sequence-version", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "title": "Sequence-Version"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/QuoteTemplates"}}}, "description": "Matching published quote templates and pagination.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`quote_template_creator_unknown`: original creator evidence is unavailable.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["full_read"]}], "summary": "List quote templates", "tags": ["Quotes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["full_read"]}}, "/api/v1/sandbox/quotes": {"get": {"description": "List quote summaries with organization-bound signed cursors. Sort by creation time or acceptedAt; null acceptance dates are last in either direction. Title matching is a literal, case-insensitive substring. Reading never changes a quote.\n\n**Required scope:** `full_read`", "operationId": "listQuotes", "parameters": [{"description": "Maximum quotes per page.", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum quotes per page.", "maximum": 100, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Cursor for the next page.", "in": "query", "name": "after", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Cursor for the next page.", "title": "After"}}, {"description": "Cursor for the previous page.", "in": "query", "name": "before", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Cursor for the previous page.", "title": "Before"}}, {"description": "Customer reference in this organization.", "in": "query", "name": "customerId", "required": false, "schema": {"anyOf": [{"maxLength": 255, "type": "string"}, {"type": "null"}], "description": "Customer reference in this organization.", "title": "Customerid"}}, {"description": "Include archived quotes.", "in": "query", "name": "includeArchived", "required": false, "schema": {"default": false, "description": "Include archived quotes.", "title": "Includearchived", "type": "boolean"}}, {"description": "Filter the derived quote lifecycle view.", "in": "query", "name": "status", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/QuoteStatus"}, {"type": "null"}], "description": "Filter the derived quote lifecycle view.", "title": "Status"}}, {"description": "Comma-separated original creator references.", "in": "query", "name": "createdBy", "required": false, "schema": {"anyOf": [{"maxLength": 4096, "type": "string"}, {"type": "null"}], "description": "Comma-separated original creator references.", "title": "Createdby"}}, {"description": "Literal case-insensitive title substring.", "in": "query", "name": "title", "required": false, "schema": {"anyOf": [{"maxLength": 255, "type": "string"}, {"type": "null"}], "description": "Literal case-insensitive title substring.", "title": "Title"}}, {"description": "Whether a pending internal quote-publication approval request exists. This does not indicate publication authorization or whether approval policy is satisfied.", "in": "query", "name": "hasActiveApprovalWorkflow", "required": false, "schema": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "description": "Whether a pending internal quote-publication approval request exists. This does not indicate publication authorization or whether approval policy is satisfied.", "title": "Hasactiveapprovalworkflow"}}, {"description": "Order by acceptedAt, or omit for creation time.", "in": "query", "name": "sortBy", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/QuoteSortBy"}, {"type": "null"}], "description": "Order by acceptedAt, or omit for creation time.", "title": "Sortby"}}, {"description": "Ascending or descending order, with quote reference as the tie-breaker.", "in": "query", "name": "sortOrder", "required": false, "schema": {"$ref": "#/components/schemas/QuoteSortOrder", "default": "DESC", "description": "Ascending or descending order, with quote reference as the tie-breaker."}}, {"description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "in": "header", "name": "sequence-version", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "title": "Sequence-Version"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Quotes"}}}, "description": "Matching quote summaries and pagination.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`quote_identity_unavailable`: original quote identity metadata is unavailable.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["full_read"]}], "summary": "List quotes", "tags": ["Quotes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["full_read"]}}, "/api/v1/sandbox/quotes/from-template/{template_id}": {"post": {"description": "Create a fresh editable draft from the latest published, admitted template version. Supports NEW_BUSINESS customer-bound canonical defaults with one billing account and unchanged existing prices. Requires a default issuer and explicit template branding preferences; unavailable defaults return 409. Owner defaults to the authenticated human or eligible human template creator; otherwise supply ownerId. No If-Match is required for the new Quote. Its source version is pinned within the transaction. Optional/null overrides inherit defaults. Customer contactIds are admitted live; no prior signer evidence, form answers, CRM or PO is inherited. Changed economics/dates/currency/deal type, new assets, countersigners and integrations return 409. The operation creates no prices, contract, publication or email.\n\n**Required scope:** `full_access`", "operationId": "createQuoteFromTemplate", "parameters": [{"description": "Id of the template.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "template_id", "required": true, "schema": {"format": "uuid", "title": "Template Id", "type": "string"}}, {"description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "in": "header", "name": "sequence-version", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "title": "Sequence-Version"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"properties": {"attachmentAssetIds": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}]}, "contactIds": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}]}, "counterSignerIds": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}]}, "currency": {"anyOf": [{"enum": ["AED", "ARS", "AUD", "BRL", "BGN", "CAD", "CHF", "CLP", "CNY", "COP", "CZK", "DKK", "EGP", "EUR", "GBP", "HKD", "ILS", "INR", "ISK", "JPY", "KRW", "MXN", "NOK", "NZD", "PLN", "SAR", "SEK", "SGD", "THB", "USD", "UYU", "ZAR"], "type": "string"}, {"type": "null"}]}, "dealType": {"anyOf": [{"enum": ["NEW_BUSINESS", "RENEWAL", "AMENDMENT"], "type": "string"}, {"type": "null"}]}, "defaultDueDateDays": {"anyOf": [{"type": "integer"}, {"type": "null"}]}, "expiryDays": {"anyOf": [{"format": "int32", "type": "integer"}, {"type": "null"}]}, "integrationIds": {"anyOf": [{"items": {"properties": {"id": {"type": "string"}, "service": {"enum": ["Amazon_Redshift", "GoCardless", "Google_BigQuery", "Google_Sheets", "HubSpot", "NetSuite", "QuickBooks_Online", "Salesforce", "Slack", "Snowflake", "Stripe", "Xero", "Avalara", "Anrok", "Attio", "Numeral", "Rillet", "Sphere"], "type": "string"}}, "required": ["id", "service"], "type": "object"}, "type": "array"}, {"type": "null"}]}, "ownerId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "phases": {"anyOf": [{"items": {"properties": {"discounts": {"items": {"properties": {"amount": {"type": "string"}, "message": {"type": "string"}, "restrictToPrices": {"items": {"type": "string"}, "type": "array"}, "seatDiscountType": {"anyOf": [{"enum": ["INCLUDED_SEATS_ONLY", "OVERAGE_SEATS_ONLY", "ALL_SEATS"], "type": "string"}, {"type": "null"}]}, "type": {"enum": ["PERCENTAGE", "NOMINAL"], "type": "string"}}, "required": ["amount", "message", "restrictToPrices", "type"], "type": "object"}, "type": "array"}, "duration": {"anyOf": [{"properties": {"days": {"format": "int32", "type": "integer"}, "months": {"format": "int32", "type": "integer"}, "weeks": {"format": "int32", "type": "integer"}, "years": {"format": "int32", "type": "integer"}}, "required": ["days", "months", "weeks", "years"], "type": "object"}, {"type": "null"}]}, "minimums": {"items": {"properties": {"amount": {"type": "string"}, "restrictToPrices": {"items": {"type": "string"}, "type": "array"}}, "required": ["amount", "restrictToPrices"], "type": "object"}, "type": "array"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "prices": {"items": {"properties": {"billingFrequency": {"enum": ["ON_DEMAND", "ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY", "PER_EVENT"], "type": "string"}, "billingType": {"enum": ["IN_ARREARS", "IN_ADVANCE"], "type": "string"}, "customMetricParameters": {"items": {"properties": {"parameterId": {"type": "string"}, "value": {"type": "string"}}, "required": ["parameterId", "value"], "type": "object"}, "type": "array"}, "integrationIds": {"items": {"properties": {"id": {"type": "string"}, "service": {"enum": ["Amazon_Redshift", "GoCardless", "Google_BigQuery", "Google_Sheets", "HubSpot", "NetSuite", "QuickBooks_Online", "Salesforce", "Slack", "Snowflake", "Stripe", "Xero", "Avalara", "Anrok", "Attio", "Numeral", "Rillet", "Sphere"], "type": "string"}}, "required": ["id", "service"], "type": "object"}, "type": "array"}, "listPriceId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "name": {"type": "string"}, "productId": {"type": "string"}, "structure": {"discriminator": {"propertyName": "pricingType"}, "oneOf": [{"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["ONE_TIME"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["FIXED"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"isPricePercentage": {"type": "boolean"}, "pricePerUnit": {"type": "string"}, "pricingType": {"enum": ["LINEAR"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["isPricePercentage", "pricePerUnit", "pricingType", "usageMetricId"], "type": "object"}, {"properties": {"contractedMinimumSeats": {"type": "integer"}, "overagesBillingFrequency": {"anyOf": [{"enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, {"type": "null"}]}, "pricePerSeat": {"type": "string"}, "pricingType": {"enum": ["SEAT_BASED"], "type": "string"}, "prorateFlatFees": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, "prorationStrategy": {"enum": ["USE_MAXIMUM", "PRORATE_INCREMENTS", "PRORATE_ALL_CHANGES"], "type": "string"}, "seatMetricId": {"type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["price"], "type": "object"}, "type": "array"}}, "required": ["contractedMinimumSeats", "pricePerSeat", "pricingType", "prorationStrategy", "seatMetricId", "tiers"], "type": "object"}, {"properties": {"pricingType": {"enum": ["GRADUATED"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageCalculationMode": {"enum": ["BILLING_PERIOD", "CUMULATIVE", "PERIODIC"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageCalculationMode", "usageMetricId"], "type": "object"}, {"properties": {"pricingType": {"enum": ["VOLUME"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "maxPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageMetricId"], "type": "object"}, {"properties": {"packageSize": {"type": "string"}, "pricePerPackage": {"type": "string"}, "pricingType": {"enum": ["PACKAGE"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["packageSize", "pricePerPackage", "pricingType", "usageMetricId"], "type": "object"}], "required": ["pricingType"]}, "temporaryId": {"type": "string"}}, "required": ["billingFrequency", "billingType", "customMetricParameters", "integrationIds", "name", "productId", "structure", "temporaryId"], "type": "object"}, "type": "array"}}, "required": ["discounts", "minimums", "prices"], "type": "object"}, "type": "array"}, {"type": "null"}]}, "preliminaryBillingStartDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "purchaseOrderNumber": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "salesforceOpportunityId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "title": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "type": "object"}}}, "required": false}, "responses": {"201": {"content": {"application/json": {"schema": {"properties": {"acceptedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "activeErrors": {"items": {"properties": {"createdAt": {"type": "string"}, "errorCode": {"enum": ["DROPBOX_SIGNATURE_REQUEST_REJECTED", "DROPBOX_REQUEST_NOT_ACKNOWLEDGED", "PDF_GENERATION_TIMEOUT", "PDF_GENERATION_FAILED", "TASK_EXHAUSTED_RETRIES", "WEBHOOK_PROCESSING_FAILED", "AUTO_EXECUTE_FAILED", "SIGNER_AUTH_FAILED", "QUOTE_STUCK_IN_PREPARING_SIGNATURE_REQUEST_STATUS"], "type": "string"}, "errorContext": {"additionalProperties": {}, "type": "object"}, "id": {"type": "string"}, "recoveryAction": {"enum": ["REPUBLISH", "REGENERATE_PDF", "MANUAL_EXECUTE", "RESEND_SIGNING_EMAIL", "RETRY_SIGNATURE_REQUEST", "CONTACT_SUPPORT"], "type": "string"}}, "required": ["createdAt", "errorCode", "errorContext", "id", "recoveryAction"], "type": "object"}, "type": "array"}, "amendment": {"anyOf": [{"additionalProperties": false, "properties": {"adjustmentTotal": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "amended": {"anyOf": [{"properties": {"phases": {"items": {"properties": {"discounts": {"items": {"properties": {"amount": {"type": "string"}, "discountCalculationType": {"enum": ["PERCENTAGE", "NOMINAL"], "type": "string"}, "message": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}, "seatDiscountType": {"anyOf": [{"enum": ["INCLUDED_SEATS_ONLY", "OVERAGE_SEATS_ONLY", "ALL_SEATS"], "type": "string"}, {"type": "null"}]}}, "required": ["amount", "discountCalculationType", "message", "productIds"], "type": "object"}, "type": "array"}, "endDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minimums": {"items": {"properties": {"amount": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}}, "required": ["amount", "productIds"], "type": "object"}, "type": "array"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "prices": {"items": {"properties": {"billingFrequency": {"enum": ["ON_DEMAND", "ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY", "PER_EVENT"], "type": "string"}, "billingType": {"enum": ["IN_ARREARS", "IN_ADVANCE"], "type": "string"}, "customMetricParameters": {"items": {"properties": {"parameterId": {"type": "string"}, "value": {"type": "string"}}, "required": ["parameterId", "value"], "type": "object"}, "type": "array"}, "name": {"type": "string"}, "productId": {"type": "string"}, "structure": {"discriminator": {"propertyName": "pricingType"}, "oneOf": [{"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["ONE_TIME"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["FIXED"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"isPricePercentage": {"type": "boolean"}, "pricePerUnit": {"type": "string"}, "pricingType": {"enum": ["LINEAR"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["isPricePercentage", "pricePerUnit", "pricingType", "usageMetricId"], "type": "object"}, {"properties": {"contractedMinimumSeats": {"type": "integer"}, "overagesBillingFrequency": {"anyOf": [{"enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, {"type": "null"}]}, "pricePerSeat": {"type": "string"}, "pricingType": {"enum": ["SEAT_BASED"], "type": "string"}, "prorateFlatFees": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, "prorationStrategy": {"enum": ["USE_MAXIMUM", "PRORATE_INCREMENTS", "PRORATE_ALL_CHANGES"], "type": "string"}, "seatMetricId": {"type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["price"], "type": "object"}, "type": "array"}}, "required": ["contractedMinimumSeats", "pricePerSeat", "pricingType", "prorationStrategy", "seatMetricId", "tiers"], "type": "object"}, {"properties": {"pricingType": {"enum": ["GRADUATED"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageCalculationMode": {"enum": ["BILLING_PERIOD", "CUMULATIVE", "PERIODIC"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageCalculationMode", "usageMetricId"], "type": "object"}, {"properties": {"pricingType": {"enum": ["VOLUME"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "maxPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageMetricId"], "type": "object"}, {"properties": {"packageSize": {"type": "string"}, "pricePerPackage": {"type": "string"}, "pricingType": {"enum": ["PACKAGE"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["packageSize", "pricePerPackage", "pricingType", "usageMetricId"], "type": "object"}], "required": ["pricingType"]}, "usageCalculationPeriod": {"anyOf": [{"properties": {"frequency": {"enum": ["MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, "interval": {"format": "int32", "type": "integer"}}, "required": ["frequency", "interval"], "type": "object"}, {"type": "null"}]}}, "required": ["billingFrequency", "billingType", "customMetricParameters", "name", "productId", "structure"], "type": "object"}, "type": "array"}, "startDate": {"type": "string"}}, "required": ["discounts", "minimums", "prices", "startDate"], "type": "object"}, "type": "array"}}, "required": ["phases"], "type": "object"}, {"type": "null"}]}, "amendedContractValue": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "appliedFrom": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "contractId": {"type": "string"}, "effectiveFrom": {"type": "string"}, "executableUntil": {"type": "string"}, "original": {"anyOf": [{"properties": {"phases": {"items": {"properties": {"discounts": {"items": {"properties": {"amount": {"type": "string"}, "discountCalculationType": {"enum": ["PERCENTAGE", "NOMINAL"], "type": "string"}, "message": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}, "seatDiscountType": {"anyOf": [{"enum": ["INCLUDED_SEATS_ONLY", "OVERAGE_SEATS_ONLY", "ALL_SEATS"], "type": "string"}, {"type": "null"}]}}, "required": ["amount", "discountCalculationType", "message", "productIds"], "type": "object"}, "type": "array"}, "endDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minimums": {"items": {"properties": {"amount": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}}, "required": ["amount", "productIds"], "type": "object"}, "type": "array"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "prices": {"items": {"properties": {"billingFrequency": {"enum": ["ON_DEMAND", "ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY", "PER_EVENT"], "type": "string"}, "billingType": {"enum": ["IN_ARREARS", "IN_ADVANCE"], "type": "string"}, "customMetricParameters": {"items": {"properties": {"parameterId": {"type": "string"}, "value": {"type": "string"}}, "required": ["parameterId", "value"], "type": "object"}, "type": "array"}, "name": {"type": "string"}, "productId": {"type": "string"}, "structure": {"discriminator": {"propertyName": "pricingType"}, "oneOf": [{"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["ONE_TIME"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["FIXED"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"isPricePercentage": {"type": "boolean"}, "pricePerUnit": {"type": "string"}, "pricingType": {"enum": ["LINEAR"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["isPricePercentage", "pricePerUnit", "pricingType", "usageMetricId"], "type": "object"}, {"properties": {"contractedMinimumSeats": {"type": "integer"}, "overagesBillingFrequency": {"anyOf": [{"enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, {"type": "null"}]}, "pricePerSeat": {"type": "string"}, "pricingType": {"enum": ["SEAT_BASED"], "type": "string"}, "prorateFlatFees": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, "prorationStrategy": {"enum": ["USE_MAXIMUM", "PRORATE_INCREMENTS", "PRORATE_ALL_CHANGES"], "type": "string"}, "seatMetricId": {"type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["price"], "type": "object"}, "type": "array"}}, "required": ["contractedMinimumSeats", "pricePerSeat", "pricingType", "prorationStrategy", "seatMetricId", "tiers"], "type": "object"}, {"properties": {"pricingType": {"enum": ["GRADUATED"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageCalculationMode": {"enum": ["BILLING_PERIOD", "CUMULATIVE", "PERIODIC"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageCalculationMode", "usageMetricId"], "type": "object"}, {"properties": {"pricingType": {"enum": ["VOLUME"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "maxPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageMetricId"], "type": "object"}, {"properties": {"packageSize": {"type": "string"}, "pricePerPackage": {"type": "string"}, "pricingType": {"enum": ["PACKAGE"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["packageSize", "pricePerPackage", "pricingType", "usageMetricId"], "type": "object"}], "required": ["pricingType"]}, "usageCalculationPeriod": {"anyOf": [{"properties": {"frequency": {"enum": ["MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, "interval": {"format": "int32", "type": "integer"}}, "required": ["frequency", "interval"], "type": "object"}, {"type": "null"}]}}, "required": ["billingFrequency", "billingType", "customMetricParameters", "name", "productId", "structure"], "type": "object"}, "type": "array"}, "startDate": {"type": "string"}}, "required": ["discounts", "minimums", "prices", "startDate"], "type": "object"}, "type": "array"}}, "required": ["phases"], "type": "object"}, {"type": "null"}]}, "originalContractValue": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "outForSignatureQuoteId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "supersededByQuoteId": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["contractId", "effectiveFrom", "executableUntil"], "type": "object"}, {"type": "null"}]}, "approvalWorkflowId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "archivedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "attachmentAssets": {"items": {"properties": {"createdAt": {"type": "string"}, "createdBy": {"type": "string"}, "createdByType": {"enum": ["SEQUENCE_USER", "API_CLIENT"], "type": "string"}, "fileName": {"type": "string"}, "fileSizeBytes": {"format": "int32", "type": "integer"}, "format": {"enum": ["JPEG", "JPG", "PNG", "PDF", "CSV", "TXT", "RTF", "MD", "XLS", "XLSX", "XLSM", "DOC", "DOCX", "ZIP", "ODT", "ODS"], "type": "string"}, "id": {"type": "string"}, "type": {"enum": ["IMAGE", "DOCUMENT", "BINARY"], "type": "string"}, "url": {"type": "string"}}, "required": ["createdAt", "createdBy", "createdByType", "fileName", "fileSizeBytes", "format", "id", "type", "url"], "type": "object"}, "type": "array"}, "ccContactIds": {"items": {"type": "string"}, "type": "array"}, "ccContacts": {"items": {"properties": {"contactId": {"type": "string"}, "email": {"type": "string"}, "name": {"type": "string"}, "notificationHistory": {"items": {"properties": {"notifiedAt": {"type": "string"}, "trigger": {"enum": ["PUBLISH", "READY_TO_SIGN", "SEND_REMINDERS", "NOTIFY_RECIPIENTS"], "type": "string"}}, "required": ["notifiedAt", "trigger"], "type": "object"}, "type": "array"}}, "required": ["contactId", "email", "name", "notificationHistory"], "type": "object"}, "type": "array"}, "contactIds": {"items": {"type": "string"}, "type": "array"}, "contacts": {"items": {"properties": {"contactId": {"type": "string"}, "email": {"type": "string"}, "name": {"type": "string"}, "notificationHistory": {"items": {"properties": {"notifiedAt": {"type": "string"}, "trigger": {"enum": ["PUBLISH", "READY_TO_SIGN", "SEND_REMINDERS", "NOTIFY_RECIPIENTS"], "type": "string"}}, "required": ["notifiedAt", "trigger"], "type": "object"}, "type": "array"}, "signedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["contactId", "email", "name", "notificationHistory"], "type": "object"}, "type": "array"}, "contractId": {"description": "Created contract ID after execution, or the target contract ID for an amendment; null when neither exists. Older idempotency replays may omit this field; GET returns the current reference.", "type": ["string", "null"]}, "counterSigners": {"items": {"properties": {"email": {"type": "string"}, "id": {"type": "string"}, "name": {"type": "string"}, "notificationHistory": {"items": {"properties": {"notifiedAt": {"type": "string"}, "trigger": {"enum": ["PUBLISH", "READY_TO_SIGN", "SEND_REMINDERS", "NOTIFY_RECIPIENTS"], "type": "string"}}, "required": ["notifiedAt", "trigger"], "type": "object"}, "type": "array"}, "signedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["email", "id", "name", "notificationHistory"], "type": "object"}, "type": "array"}, "createdAt": {"type": "string"}, "createdBy": {"type": "string"}, "createdFrom": {"anyOf": [{"properties": {"entityId": {"type": "string"}, "entityType": {"enum": ["BILLING_SCHEDULE", "BILLING_SCHEDULE_DISCOUNT", "BILLING_SCHEDULE_MINIMUM", "BILLING_SCHEDULE_PHASE", "BILLING_SCHEDULE_PRICE", "CONTACT", "CREDIT_NOTE", "CREDIT_NOTE_APPLICATION", "CUSTOMER", "FILE", "INVOICE", "LEDGER_ACCOUNT", "LIST_PRICE", "OVERPAYMENT", "PAYMENT", "PAYMENT_APPLICATION", "PRICE", "PRODUCT", "QUOTE", "QUOTE_DISCOUNT", "QUOTE_MINIMUM", "QUOTE_PHASE", "QUOTE_PRICE", "QUOTE_PRICE_TIER", "QUOTE_TEMPLATE_PRICE", "TAX_CATEGORY", "TAX_CODE"], "type": "string"}}, "required": ["entityId", "entityType"], "type": "object"}, {"type": "null"}]}, "currency": {"anyOf": [{"enum": ["AED", "ARS", "AUD", "BRL", "BGN", "CAD", "CHF", "CLP", "CNY", "COP", "CZK", "DKK", "EGP", "EUR", "GBP", "HKD", "ILS", "INR", "ISK", "JPY", "KRW", "MXN", "NOK", "NZD", "PLN", "SAR", "SEK", "SGD", "THB", "USD", "UYU", "ZAR", "CLF"], "type": "string"}, {"type": "null"}], "description": "Quote currency, including CLF (Unidad de Fomento)."}, "customerAddress": {"anyOf": [{"properties": {"country": {"enum": ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW"], "type": "string"}, "line1": {"type": "string"}, "line2": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "postcode": {"type": "string"}, "state": {"anyOf": [{"enum": ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AB", "BC", "MB", "NB", "NL", "NS", "NT", "NU", "ON", "PE", "QC", "SK", "YT"], "type": "string"}, {"type": "null"}]}, "town": {"type": "string"}}, "required": ["country", "line1", "postcode", "town"], "type": "object"}, {"type": "null"}]}, "customerId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "customerLegalName": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "dealType": {"anyOf": [{"enum": ["NEW_BUSINESS", "RENEWAL", "AMENDMENT"], "type": "string"}, {"type": "null"}]}, "defaultDueDateDays": {"anyOf": [{"type": "integer"}, {"type": "null"}]}, "executedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "expiresAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "expiryDays": {"anyOf": [{"format": "int32", "type": "integer"}, {"type": "null"}]}, "id": {"type": "string"}, "integrationIds": {"items": {"properties": {"id": {"type": "string"}, "isPending": {"type": "boolean"}, "service": {"enum": ["Amazon_Redshift", "GoCardless", "Google_BigQuery", "Google_Sheets", "HubSpot", "NetSuite", "QuickBooks_Online", "Salesforce", "Slack", "Snowflake", "Stripe", "Xero", "Avalara", "Anrok", "Attio", "Numeral", "Rillet", "Sphere"], "type": "string"}}, "required": ["id", "isPending", "service"], "type": "object"}, "type": "array"}, "isExpired": {"type": "boolean"}, "isSignaturesEnabled": {"type": "boolean"}, "merchantBranding": {"properties": {"address": {"properties": {"country": {"enum": ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW"], "type": "string"}, "line1": {"type": "string"}, "line2": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "postcode": {"type": "string"}, "state": {"anyOf": [{"enum": ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AB", "BC", "MB", "NB", "NL", "NS", "NT", "NU", "ON", "PE", "QC", "SK", "YT"], "type": "string"}, {"type": "null"}]}, "town": {"type": "string"}}, "required": ["country", "line1", "postcode", "town"], "type": "object"}, "email": {"type": "string"}, "legalCompanyName": {"type": "string"}, "logoUrl": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "primaryColour": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "showUsageInCustomerPortal": {"type": "boolean"}, "supportEmail": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "supportUrl": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "url": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["address", "email", "legalCompanyName", "showUsageInCustomerPortal"], "type": "object"}, "pdfStatus": {"enum": ["NOT_YET_REQUESTED", "REQUESTED", "IN_PROGRESS", "FAILED", "GENERATED"], "type": "string"}, "phases": {"items": {"properties": {"createdAt": {"type": "string"}, "discounts": {"items": {"properties": {"amount": {"type": "string"}, "createdAt": {"type": "string"}, "discountCalculationType": {"enum": ["PERCENTAGE", "NOMINAL"], "type": "string"}, "id": {"type": "string"}, "message": {"type": "string"}, "restrictToPrices": {"items": {"type": "string"}, "type": "array"}, "seatDiscountType": {"anyOf": [{"enum": ["INCLUDED_SEATS_ONLY", "OVERAGE_SEATS_ONLY", "ALL_SEATS"], "type": "string"}, {"type": "null"}]}, "updatedAt": {"type": "string"}}, "required": ["amount", "createdAt", "discountCalculationType", "id", "message", "restrictToPrices", "updatedAt"], "type": "object"}, "type": "array"}, "duration": {"anyOf": [{"properties": {"days": {"format": "int32", "type": "integer"}, "months": {"format": "int32", "type": "integer"}, "weeks": {"format": "int32", "type": "integer"}, "years": {"format": "int32", "type": "integer"}}, "required": ["days", "months", "weeks", "years"], "type": "object"}, {"type": "null"}]}, "id": {"type": "string"}, "minimums": {"items": {"properties": {"amount": {"type": "string"}, "createdAt": {"type": "string"}, "id": {"type": "string"}, "restrictToPrices": {"items": {"type": "string"}, "type": "array"}, "updatedAt": {"type": "string"}}, "required": ["amount", "createdAt", "id", "restrictToPrices", "updatedAt"], "type": "object"}, "type": "array"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "prices": {"items": {"properties": {"billingFrequency": {"enum": ["ON_DEMAND", "ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY", "PER_EVENT"], "type": "string"}, "billingType": {"enum": ["IN_ARREARS", "IN_ADVANCE"], "type": "string"}, "createdAt": {"type": "string"}, "customMetricParameters": {"items": {"properties": {"parameterId": {"type": "string"}, "value": {"type": "string"}}, "required": ["parameterId", "value"], "type": "object"}, "type": "array"}, "id": {"type": "string"}, "integrationIds": {"items": {"properties": {"id": {"type": "string"}, "isPending": {"type": "boolean"}, "service": {"enum": ["Amazon_Redshift", "GoCardless", "Google_BigQuery", "Google_Sheets", "HubSpot", "NetSuite", "QuickBooks_Online", "Salesforce", "Slack", "Snowflake", "Stripe", "Xero", "Avalara", "Anrok", "Attio", "Numeral", "Rillet", "Sphere"], "type": "string"}}, "required": ["id", "isPending", "service"], "type": "object"}, "type": "array"}, "listPriceId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "name": {"type": "string"}, "productId": {"type": "string"}, "structure": {"discriminator": {"propertyName": "pricingType"}, "oneOf": [{"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["ONE_TIME"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["FIXED"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"isPricePercentage": {"type": "boolean"}, "pricePerUnit": {"type": "string"}, "pricingType": {"enum": ["LINEAR"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["isPricePercentage", "pricePerUnit", "pricingType", "usageMetricId"], "type": "object"}, {"properties": {"contractedMinimumSeats": {"type": "integer"}, "overagesBillingFrequency": {"anyOf": [{"enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, {"type": "null"}]}, "pricePerSeat": {"type": "string"}, "pricingType": {"enum": ["SEAT_BASED"], "type": "string"}, "prorateFlatFees": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, "prorationStrategy": {"enum": ["USE_MAXIMUM", "PRORATE_INCREMENTS", "PRORATE_ALL_CHANGES"], "type": "string"}, "seatMetricId": {"type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["price"], "type": "object"}, "type": "array"}}, "required": ["contractedMinimumSeats", "pricePerSeat", "pricingType", "prorationStrategy", "seatMetricId", "tiers"], "type": "object"}, {"properties": {"pricingType": {"enum": ["GRADUATED"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageCalculationMode": {"enum": ["BILLING_PERIOD", "CUMULATIVE", "PERIODIC"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageCalculationMode", "usageMetricId"], "type": "object"}, {"properties": {"pricingType": {"enum": ["VOLUME"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "maxPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageMetricId"], "type": "object"}, {"properties": {"packageSize": {"type": "string"}, "pricePerPackage": {"type": "string"}, "pricingType": {"enum": ["PACKAGE"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["packageSize", "pricePerPackage", "pricingType", "usageMetricId"], "type": "object"}], "required": ["pricingType"]}, "updatedAt": {"type": "string"}}, "required": ["billingFrequency", "billingType", "createdAt", "customMetricParameters", "id", "integrationIds", "name", "productId", "structure", "updatedAt"], "type": "object"}, "type": "array"}}, "required": ["createdAt", "discounts", "id", "minimums", "prices"], "type": "object"}, "type": "array"}, "preliminaryBillingStartDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "preparingSignatureRequestAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "publishedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "purchaseOrderNumber": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "quoteNumber": {"type": "string"}, "readyToSignAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "salesforceOpportunityId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "signatureMode": {"anyOf": [{"enum": ["EMBEDDED", "NON_EMBEDDED"], "type": "string"}, {"type": "null"}]}, "status": {"enum": ["DRAFT", "PUBLISHED", "PREPARING_SIGNATURE_REQUEST", "READY_TO_SIGN", "ACCEPTED", "EXECUTED"], "type": "string"}, "title": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "updatedAt": {"type": "string"}}, "required": ["activeErrors", "attachmentAssets", "ccContactIds", "ccContacts", "contactIds", "contacts", "counterSigners", "createdAt", "createdBy", "id", "integrationIds", "isExpired", "isSignaturesEnabled", "merchantBranding", "pdfStatus", "phases", "quoteNumber", "status", "updatedAt"], "type": "object"}}}, "description": "The created quote.", "headers": {"ETag": {"description": "Current quote version for If-Match on quote changes.", "schema": {"type": "string"}}, "Location": {"description": "URL of the created resource.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["full_access"]}], "summary": "Create a quote from a template", "tags": ["Quotes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["full_access"]}}, "/api/v1/sandbox/quotes/total": {"post": {"description": "Read-only calculation; creates no quote or price and requires no Idempotency-Key or If-Match. Supports ONE_TIME fees and FIXED fees over complete monthly, quarterly, half-yearly or yearly cycles. Single-price monetary discounts and recurring minimums use Billing's canonical adjustment rules. discountValue records applied markdowns before minimum top-ups. Variable usage/seat models, pooled adjustments and partial periods return explicit 409 errors. Recurring fees need a bounded phase duration. Day/week-based horizons additionally need an explicit preliminaryBillingStartDate. Dated duration is returned as actual elapsed days. This valuation is not publication readiness or a billing simulation.\n\n**Required scope:** `full_read`", "operationId": "calculateQuoteTotals", "parameters": [{"description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "in": "header", "name": "sequence-version", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "title": "Sequence-Version"}}], "requestBody": {"content": {"application/json": {"schema": {"properties": {"currency": {"enum": ["AED", "ARS", "AUD", "BRL", "BGN", "CAD", "CHF", "CLP", "CNY", "COP", "CZK", "DKK", "EGP", "EUR", "GBP", "HKD", "ILS", "INR", "ISK", "JPY", "KRW", "MXN", "NOK", "NZD", "PLN", "SAR", "SEK", "SGD", "THB", "USD", "UYU", "ZAR"], "type": "string"}, "phases": {"items": {"properties": {"discounts": {"anyOf": [{"items": {"properties": {"amount": {"type": "string"}, "restrictToPrices": {"items": {"type": "string"}, "type": "array"}, "type": {"enum": ["PERCENTAGE", "NOMINAL"], "type": "string"}}, "required": ["amount", "restrictToPrices", "type"], "type": "object"}, "type": "array"}, {"type": "null"}]}, "duration": {"anyOf": [{"properties": {"days": {"format": "int32", "type": "integer"}, "months": {"format": "int32", "type": "integer"}, "weeks": {"format": "int32", "type": "integer"}, "years": {"format": "int32", "type": "integer"}}, "required": ["days", "months", "weeks", "years"], "type": "object"}, {"type": "null"}]}, "minimums": {"anyOf": [{"items": {}, "type": "array"}, {"type": "null"}]}, "prices": {"items": {"properties": {"billingFrequency": {"enum": ["ON_DEMAND", "ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY", "PER_EVENT"], "type": "string"}, "billingType": {"enum": ["IN_ARREARS", "IN_ADVANCE"], "type": "string"}, "structure": {"discriminator": {"propertyName": "pricingType"}, "oneOf": [{"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["ONE_TIME"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["FIXED"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"isPricePercentage": {"type": "boolean"}, "pricePerUnit": {"type": "string"}, "pricingType": {"enum": ["LINEAR"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["isPricePercentage", "pricePerUnit", "pricingType", "usageMetricId"], "type": "object"}, {"properties": {"contractedMinimumSeats": {"type": "integer"}, "overagesBillingFrequency": {"anyOf": [{"enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, {"type": "null"}]}, "pricePerSeat": {"type": "string"}, "pricingType": {"enum": ["SEAT_BASED"], "type": "string"}, "prorateFlatFees": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, "prorationStrategy": {"enum": ["USE_MAXIMUM", "PRORATE_INCREMENTS", "PRORATE_ALL_CHANGES"], "type": "string"}, "seatMetricId": {"type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["price"], "type": "object"}, "type": "array"}}, "required": ["contractedMinimumSeats", "pricePerSeat", "pricingType", "prorationStrategy", "seatMetricId", "tiers"], "type": "object"}, {"properties": {"pricingType": {"enum": ["GRADUATED"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageCalculationMode": {"enum": ["BILLING_PERIOD", "CUMULATIVE", "PERIODIC"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageCalculationMode", "usageMetricId"], "type": "object"}, {"properties": {"pricingType": {"enum": ["VOLUME"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "maxPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageMetricId"], "type": "object"}, {"properties": {"packageSize": {"type": "string"}, "pricePerPackage": {"type": "string"}, "pricingType": {"enum": ["PACKAGE"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["packageSize", "pricePerPackage", "pricingType", "usageMetricId"], "type": "object"}], "required": ["pricingType"]}, "temporaryId": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["billingFrequency", "billingType", "structure"], "type": "object"}, "type": "array"}}, "required": ["prices"], "type": "object"}, "type": "array"}, "preliminaryBillingStartDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["currency", "phases"], "type": "object"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"properties": {"total": {"properties": {"contractValue": {"type": "string"}, "discountValue": {"type": "string"}, "duration": {"anyOf": [{"properties": {"days": {"format": "int32", "type": "integer"}, "months": {"format": "int32", "type": "integer"}, "weeks": {"format": "int32", "type": "integer"}, "years": {"format": "int32", "type": "integer"}}, "required": ["days", "months", "weeks", "years"], "type": "object"}, {"type": "null"}]}}, "required": ["contractValue", "discountValue"], "type": "object"}}, "required": ["total"], "type": "object"}}}, "description": "The updated quote.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["full_read"]}], "summary": "Calculate quote totals", "tags": ["Quotes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["full_read"]}}, "/api/v1/sandbox/quotes/{quote_id}": {"get": {"description": "**Required scope:** `full_read`", "operationId": "getQuote", "parameters": [{"description": "Id of the quote.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "quote_id", "required": true, "schema": {"format": "uuid", "title": "Quote Id", "type": "string"}}, {"description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "in": "header", "name": "sequence-version", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "title": "Sequence-Version"}}], "responses": {"200": {"content": {"application/json": {"schema": {"properties": {"acceptedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "activeErrors": {"items": {"properties": {"createdAt": {"type": "string"}, "errorCode": {"enum": ["DROPBOX_SIGNATURE_REQUEST_REJECTED", "DROPBOX_REQUEST_NOT_ACKNOWLEDGED", "PDF_GENERATION_TIMEOUT", "PDF_GENERATION_FAILED", "TASK_EXHAUSTED_RETRIES", "WEBHOOK_PROCESSING_FAILED", "AUTO_EXECUTE_FAILED", "SIGNER_AUTH_FAILED", "QUOTE_STUCK_IN_PREPARING_SIGNATURE_REQUEST_STATUS"], "type": "string"}, "errorContext": {"additionalProperties": {}, "type": "object"}, "id": {"type": "string"}, "recoveryAction": {"enum": ["REPUBLISH", "REGENERATE_PDF", "MANUAL_EXECUTE", "RESEND_SIGNING_EMAIL", "RETRY_SIGNATURE_REQUEST", "CONTACT_SUPPORT"], "type": "string"}}, "required": ["createdAt", "errorCode", "errorContext", "id", "recoveryAction"], "type": "object"}, "type": "array"}, "amendment": {"anyOf": [{"additionalProperties": false, "properties": {"adjustmentTotal": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "amended": {"anyOf": [{"properties": {"phases": {"items": {"properties": {"discounts": {"items": {"properties": {"amount": {"type": "string"}, "discountCalculationType": {"enum": ["PERCENTAGE", "NOMINAL"], "type": "string"}, "message": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}, "seatDiscountType": {"anyOf": [{"enum": ["INCLUDED_SEATS_ONLY", "OVERAGE_SEATS_ONLY", "ALL_SEATS"], "type": "string"}, {"type": "null"}]}}, "required": ["amount", "discountCalculationType", "message", "productIds"], "type": "object"}, "type": "array"}, "endDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minimums": {"items": {"properties": {"amount": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}}, "required": ["amount", "productIds"], "type": "object"}, "type": "array"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "prices": {"items": {"properties": {"billingFrequency": {"enum": ["ON_DEMAND", "ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY", "PER_EVENT"], "type": "string"}, "billingType": {"enum": ["IN_ARREARS", "IN_ADVANCE"], "type": "string"}, "customMetricParameters": {"items": {"properties": {"parameterId": {"type": "string"}, "value": {"type": "string"}}, "required": ["parameterId", "value"], "type": "object"}, "type": "array"}, "name": {"type": "string"}, "productId": {"type": "string"}, "structure": {"discriminator": {"propertyName": "pricingType"}, "oneOf": [{"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["ONE_TIME"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["FIXED"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"isPricePercentage": {"type": "boolean"}, "pricePerUnit": {"type": "string"}, "pricingType": {"enum": ["LINEAR"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["isPricePercentage", "pricePerUnit", "pricingType", "usageMetricId"], "type": "object"}, {"properties": {"contractedMinimumSeats": {"type": "integer"}, "overagesBillingFrequency": {"anyOf": [{"enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, {"type": "null"}]}, "pricePerSeat": {"type": "string"}, "pricingType": {"enum": ["SEAT_BASED"], "type": "string"}, "prorateFlatFees": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, "prorationStrategy": {"enum": ["USE_MAXIMUM", "PRORATE_INCREMENTS", "PRORATE_ALL_CHANGES"], "type": "string"}, "seatMetricId": {"type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["price"], "type": "object"}, "type": "array"}}, "required": ["contractedMinimumSeats", "pricePerSeat", "pricingType", "prorationStrategy", "seatMetricId", "tiers"], "type": "object"}, {"properties": {"pricingType": {"enum": ["GRADUATED"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageCalculationMode": {"enum": ["BILLING_PERIOD", "CUMULATIVE", "PERIODIC"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageCalculationMode", "usageMetricId"], "type": "object"}, {"properties": {"pricingType": {"enum": ["VOLUME"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "maxPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageMetricId"], "type": "object"}, {"properties": {"packageSize": {"type": "string"}, "pricePerPackage": {"type": "string"}, "pricingType": {"enum": ["PACKAGE"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["packageSize", "pricePerPackage", "pricingType", "usageMetricId"], "type": "object"}], "required": ["pricingType"]}, "usageCalculationPeriod": {"anyOf": [{"properties": {"frequency": {"enum": ["MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, "interval": {"format": "int32", "type": "integer"}}, "required": ["frequency", "interval"], "type": "object"}, {"type": "null"}]}}, "required": ["billingFrequency", "billingType", "customMetricParameters", "name", "productId", "structure"], "type": "object"}, "type": "array"}, "startDate": {"type": "string"}}, "required": ["discounts", "minimums", "prices", "startDate"], "type": "object"}, "type": "array"}}, "required": ["phases"], "type": "object"}, {"type": "null"}]}, "amendedContractValue": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "appliedFrom": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "contractId": {"type": "string"}, "effectiveFrom": {"type": "string"}, "executableUntil": {"type": "string"}, "original": {"anyOf": [{"properties": {"phases": {"items": {"properties": {"discounts": {"items": {"properties": {"amount": {"type": "string"}, "discountCalculationType": {"enum": ["PERCENTAGE", "NOMINAL"], "type": "string"}, "message": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}, "seatDiscountType": {"anyOf": [{"enum": ["INCLUDED_SEATS_ONLY", "OVERAGE_SEATS_ONLY", "ALL_SEATS"], "type": "string"}, {"type": "null"}]}}, "required": ["amount", "discountCalculationType", "message", "productIds"], "type": "object"}, "type": "array"}, "endDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minimums": {"items": {"properties": {"amount": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}}, "required": ["amount", "productIds"], "type": "object"}, "type": "array"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "prices": {"items": {"properties": {"billingFrequency": {"enum": ["ON_DEMAND", "ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY", "PER_EVENT"], "type": "string"}, "billingType": {"enum": ["IN_ARREARS", "IN_ADVANCE"], "type": "string"}, "customMetricParameters": {"items": {"properties": {"parameterId": {"type": "string"}, "value": {"type": "string"}}, "required": ["parameterId", "value"], "type": "object"}, "type": "array"}, "name": {"type": "string"}, "productId": {"type": "string"}, "structure": {"discriminator": {"propertyName": "pricingType"}, "oneOf": [{"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["ONE_TIME"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["FIXED"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"isPricePercentage": {"type": "boolean"}, "pricePerUnit": {"type": "string"}, "pricingType": {"enum": ["LINEAR"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["isPricePercentage", "pricePerUnit", "pricingType", "usageMetricId"], "type": "object"}, {"properties": {"contractedMinimumSeats": {"type": "integer"}, "overagesBillingFrequency": {"anyOf": [{"enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, {"type": "null"}]}, "pricePerSeat": {"type": "string"}, "pricingType": {"enum": ["SEAT_BASED"], "type": "string"}, "prorateFlatFees": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, "prorationStrategy": {"enum": ["USE_MAXIMUM", "PRORATE_INCREMENTS", "PRORATE_ALL_CHANGES"], "type": "string"}, "seatMetricId": {"type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["price"], "type": "object"}, "type": "array"}}, "required": ["contractedMinimumSeats", "pricePerSeat", "pricingType", "prorationStrategy", "seatMetricId", "tiers"], "type": "object"}, {"properties": {"pricingType": {"enum": ["GRADUATED"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageCalculationMode": {"enum": ["BILLING_PERIOD", "CUMULATIVE", "PERIODIC"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageCalculationMode", "usageMetricId"], "type": "object"}, {"properties": {"pricingType": {"enum": ["VOLUME"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "maxPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageMetricId"], "type": "object"}, {"properties": {"packageSize": {"type": "string"}, "pricePerPackage": {"type": "string"}, "pricingType": {"enum": ["PACKAGE"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["packageSize", "pricePerPackage", "pricingType", "usageMetricId"], "type": "object"}], "required": ["pricingType"]}, "usageCalculationPeriod": {"anyOf": [{"properties": {"frequency": {"enum": ["MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, "interval": {"format": "int32", "type": "integer"}}, "required": ["frequency", "interval"], "type": "object"}, {"type": "null"}]}}, "required": ["billingFrequency", "billingType", "customMetricParameters", "name", "productId", "structure"], "type": "object"}, "type": "array"}, "startDate": {"type": "string"}}, "required": ["discounts", "minimums", "prices", "startDate"], "type": "object"}, "type": "array"}}, "required": ["phases"], "type": "object"}, {"type": "null"}]}, "originalContractValue": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "outForSignatureQuoteId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "supersededByQuoteId": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["contractId", "effectiveFrom", "executableUntil"], "type": "object"}, {"type": "null"}]}, "approvalWorkflowId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "archivedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "attachmentAssets": {"items": {"properties": {"createdAt": {"type": "string"}, "createdBy": {"type": "string"}, "createdByType": {"enum": ["SEQUENCE_USER", "API_CLIENT"], "type": "string"}, "fileName": {"type": "string"}, "fileSizeBytes": {"format": "int32", "type": "integer"}, "format": {"enum": ["JPEG", "JPG", "PNG", "PDF", "CSV", "TXT", "RTF", "MD", "XLS", "XLSX", "XLSM", "DOC", "DOCX", "ZIP", "ODT", "ODS"], "type": "string"}, "id": {"type": "string"}, "type": {"enum": ["IMAGE", "DOCUMENT", "BINARY"], "type": "string"}, "url": {"type": "string"}}, "required": ["createdAt", "createdBy", "createdByType", "fileName", "fileSizeBytes", "format", "id", "type", "url"], "type": "object"}, "type": "array"}, "ccContactIds": {"items": {"type": "string"}, "type": "array"}, "ccContacts": {"items": {"properties": {"contactId": {"type": "string"}, "email": {"type": "string"}, "name": {"type": "string"}, "notificationHistory": {"items": {"properties": {"notifiedAt": {"type": "string"}, "trigger": {"enum": ["PUBLISH", "READY_TO_SIGN", "SEND_REMINDERS", "NOTIFY_RECIPIENTS"], "type": "string"}}, "required": ["notifiedAt", "trigger"], "type": "object"}, "type": "array"}}, "required": ["contactId", "email", "name", "notificationHistory"], "type": "object"}, "type": "array"}, "contactIds": {"items": {"type": "string"}, "type": "array"}, "contacts": {"items": {"properties": {"contactId": {"type": "string"}, "email": {"type": "string"}, "name": {"type": "string"}, "notificationHistory": {"items": {"properties": {"notifiedAt": {"type": "string"}, "trigger": {"enum": ["PUBLISH", "READY_TO_SIGN", "SEND_REMINDERS", "NOTIFY_RECIPIENTS"], "type": "string"}}, "required": ["notifiedAt", "trigger"], "type": "object"}, "type": "array"}, "signedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["contactId", "email", "name", "notificationHistory"], "type": "object"}, "type": "array"}, "contractId": {"description": "Created contract ID after execution, or the target contract ID for an amendment; null when neither exists. Older idempotency replays may omit this field; GET returns the current reference.", "type": ["string", "null"]}, "counterSigners": {"items": {"properties": {"email": {"type": "string"}, "id": {"type": "string"}, "name": {"type": "string"}, "notificationHistory": {"items": {"properties": {"notifiedAt": {"type": "string"}, "trigger": {"enum": ["PUBLISH", "READY_TO_SIGN", "SEND_REMINDERS", "NOTIFY_RECIPIENTS"], "type": "string"}}, "required": ["notifiedAt", "trigger"], "type": "object"}, "type": "array"}, "signedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["email", "id", "name", "notificationHistory"], "type": "object"}, "type": "array"}, "createdAt": {"type": "string"}, "createdBy": {"type": "string"}, "createdFrom": {"anyOf": [{"properties": {"entityId": {"type": "string"}, "entityType": {"enum": ["BILLING_SCHEDULE", "BILLING_SCHEDULE_DISCOUNT", "BILLING_SCHEDULE_MINIMUM", "BILLING_SCHEDULE_PHASE", "BILLING_SCHEDULE_PRICE", "CONTACT", "CREDIT_NOTE", "CREDIT_NOTE_APPLICATION", "CUSTOMER", "FILE", "INVOICE", "LEDGER_ACCOUNT", "LIST_PRICE", "OVERPAYMENT", "PAYMENT", "PAYMENT_APPLICATION", "PRICE", "PRODUCT", "QUOTE", "QUOTE_DISCOUNT", "QUOTE_MINIMUM", "QUOTE_PHASE", "QUOTE_PRICE", "QUOTE_PRICE_TIER", "QUOTE_TEMPLATE_PRICE", "TAX_CATEGORY", "TAX_CODE"], "type": "string"}}, "required": ["entityId", "entityType"], "type": "object"}, {"type": "null"}]}, "currency": {"anyOf": [{"enum": ["AED", "ARS", "AUD", "BRL", "BGN", "CAD", "CHF", "CLP", "CNY", "COP", "CZK", "DKK", "EGP", "EUR", "GBP", "HKD", "ILS", "INR", "ISK", "JPY", "KRW", "MXN", "NOK", "NZD", "PLN", "SAR", "SEK", "SGD", "THB", "USD", "UYU", "ZAR", "CLF"], "type": "string"}, {"type": "null"}], "description": "Quote currency, including CLF (Unidad de Fomento)."}, "customerAddress": {"anyOf": [{"properties": {"country": {"enum": ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW"], "type": "string"}, "line1": {"type": "string"}, "line2": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "postcode": {"type": "string"}, "state": {"anyOf": [{"enum": ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AB", "BC", "MB", "NB", "NL", "NS", "NT", "NU", "ON", "PE", "QC", "SK", "YT"], "type": "string"}, {"type": "null"}]}, "town": {"type": "string"}}, "required": ["country", "line1", "postcode", "town"], "type": "object"}, {"type": "null"}]}, "customerId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "customerLegalName": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "dealType": {"anyOf": [{"enum": ["NEW_BUSINESS", "RENEWAL", "AMENDMENT"], "type": "string"}, {"type": "null"}]}, "defaultDueDateDays": {"anyOf": [{"type": "integer"}, {"type": "null"}]}, "executedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "expiresAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "expiryDays": {"anyOf": [{"format": "int32", "type": "integer"}, {"type": "null"}]}, "id": {"type": "string"}, "integrationIds": {"items": {"properties": {"id": {"type": "string"}, "isPending": {"type": "boolean"}, "service": {"enum": ["Amazon_Redshift", "GoCardless", "Google_BigQuery", "Google_Sheets", "HubSpot", "NetSuite", "QuickBooks_Online", "Salesforce", "Slack", "Snowflake", "Stripe", "Xero", "Avalara", "Anrok", "Attio", "Numeral", "Rillet", "Sphere"], "type": "string"}}, "required": ["id", "isPending", "service"], "type": "object"}, "type": "array"}, "isExpired": {"type": "boolean"}, "isSignaturesEnabled": {"type": "boolean"}, "merchantBranding": {"properties": {"address": {"properties": {"country": {"enum": ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW"], "type": "string"}, "line1": {"type": "string"}, "line2": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "postcode": {"type": "string"}, "state": {"anyOf": [{"enum": ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AB", "BC", "MB", "NB", "NL", "NS", "NT", "NU", "ON", "PE", "QC", "SK", "YT"], "type": "string"}, {"type": "null"}]}, "town": {"type": "string"}}, "required": ["country", "line1", "postcode", "town"], "type": "object"}, "email": {"type": "string"}, "legalCompanyName": {"type": "string"}, "logoUrl": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "primaryColour": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "showUsageInCustomerPortal": {"type": "boolean"}, "supportEmail": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "supportUrl": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "url": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["address", "email", "legalCompanyName", "showUsageInCustomerPortal"], "type": "object"}, "pdfStatus": {"enum": ["NOT_YET_REQUESTED", "REQUESTED", "IN_PROGRESS", "FAILED", "GENERATED"], "type": "string"}, "phases": {"items": {"properties": {"createdAt": {"type": "string"}, "discounts": {"items": {"properties": {"amount": {"type": "string"}, "createdAt": {"type": "string"}, "discountCalculationType": {"enum": ["PERCENTAGE", "NOMINAL"], "type": "string"}, "id": {"type": "string"}, "message": {"type": "string"}, "restrictToPrices": {"items": {"type": "string"}, "type": "array"}, "seatDiscountType": {"anyOf": [{"enum": ["INCLUDED_SEATS_ONLY", "OVERAGE_SEATS_ONLY", "ALL_SEATS"], "type": "string"}, {"type": "null"}]}, "updatedAt": {"type": "string"}}, "required": ["amount", "createdAt", "discountCalculationType", "id", "message", "restrictToPrices", "updatedAt"], "type": "object"}, "type": "array"}, "duration": {"anyOf": [{"properties": {"days": {"format": "int32", "type": "integer"}, "months": {"format": "int32", "type": "integer"}, "weeks": {"format": "int32", "type": "integer"}, "years": {"format": "int32", "type": "integer"}}, "required": ["days", "months", "weeks", "years"], "type": "object"}, {"type": "null"}]}, "id": {"type": "string"}, "minimums": {"items": {"properties": {"amount": {"type": "string"}, "createdAt": {"type": "string"}, "id": {"type": "string"}, "restrictToPrices": {"items": {"type": "string"}, "type": "array"}, "updatedAt": {"type": "string"}}, "required": ["amount", "createdAt", "id", "restrictToPrices", "updatedAt"], "type": "object"}, "type": "array"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "prices": {"items": {"properties": {"billingFrequency": {"enum": ["ON_DEMAND", "ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY", "PER_EVENT"], "type": "string"}, "billingType": {"enum": ["IN_ARREARS", "IN_ADVANCE"], "type": "string"}, "createdAt": {"type": "string"}, "customMetricParameters": {"items": {"properties": {"parameterId": {"type": "string"}, "value": {"type": "string"}}, "required": ["parameterId", "value"], "type": "object"}, "type": "array"}, "id": {"type": "string"}, "integrationIds": {"items": {"properties": {"id": {"type": "string"}, "isPending": {"type": "boolean"}, "service": {"enum": ["Amazon_Redshift", "GoCardless", "Google_BigQuery", "Google_Sheets", "HubSpot", "NetSuite", "QuickBooks_Online", "Salesforce", "Slack", "Snowflake", "Stripe", "Xero", "Avalara", "Anrok", "Attio", "Numeral", "Rillet", "Sphere"], "type": "string"}}, "required": ["id", "isPending", "service"], "type": "object"}, "type": "array"}, "listPriceId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "name": {"type": "string"}, "productId": {"type": "string"}, "structure": {"discriminator": {"propertyName": "pricingType"}, "oneOf": [{"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["ONE_TIME"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["FIXED"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"isPricePercentage": {"type": "boolean"}, "pricePerUnit": {"type": "string"}, "pricingType": {"enum": ["LINEAR"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["isPricePercentage", "pricePerUnit", "pricingType", "usageMetricId"], "type": "object"}, {"properties": {"contractedMinimumSeats": {"type": "integer"}, "overagesBillingFrequency": {"anyOf": [{"enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, {"type": "null"}]}, "pricePerSeat": {"type": "string"}, "pricingType": {"enum": ["SEAT_BASED"], "type": "string"}, "prorateFlatFees": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, "prorationStrategy": {"enum": ["USE_MAXIMUM", "PRORATE_INCREMENTS", "PRORATE_ALL_CHANGES"], "type": "string"}, "seatMetricId": {"type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["price"], "type": "object"}, "type": "array"}}, "required": ["contractedMinimumSeats", "pricePerSeat", "pricingType", "prorationStrategy", "seatMetricId", "tiers"], "type": "object"}, {"properties": {"pricingType": {"enum": ["GRADUATED"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageCalculationMode": {"enum": ["BILLING_PERIOD", "CUMULATIVE", "PERIODIC"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageCalculationMode", "usageMetricId"], "type": "object"}, {"properties": {"pricingType": {"enum": ["VOLUME"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "maxPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageMetricId"], "type": "object"}, {"properties": {"packageSize": {"type": "string"}, "pricePerPackage": {"type": "string"}, "pricingType": {"enum": ["PACKAGE"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["packageSize", "pricePerPackage", "pricingType", "usageMetricId"], "type": "object"}], "required": ["pricingType"]}, "updatedAt": {"type": "string"}}, "required": ["billingFrequency", "billingType", "createdAt", "customMetricParameters", "id", "integrationIds", "name", "productId", "structure", "updatedAt"], "type": "object"}, "type": "array"}}, "required": ["createdAt", "discounts", "id", "minimums", "prices"], "type": "object"}, "type": "array"}, "preliminaryBillingStartDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "preparingSignatureRequestAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "publishedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "purchaseOrderNumber": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "quoteNumber": {"type": "string"}, "readyToSignAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "salesforceOpportunityId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "signatureMode": {"anyOf": [{"enum": ["EMBEDDED", "NON_EMBEDDED"], "type": "string"}, {"type": "null"}]}, "status": {"enum": ["DRAFT", "PUBLISHED", "PREPARING_SIGNATURE_REQUEST", "READY_TO_SIGN", "ACCEPTED", "EXECUTED"], "type": "string"}, "title": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "updatedAt": {"type": "string"}}, "required": ["activeErrors", "attachmentAssets", "ccContactIds", "ccContacts", "contactIds", "contacts", "counterSigners", "createdAt", "createdBy", "id", "integrationIds", "isExpired", "isSignaturesEnabled", "merchantBranding", "pdfStatus", "phases", "quoteNumber", "status", "updatedAt"], "type": "object"}}}, "description": "The quote.", "headers": {"ETag": {"description": "Current quote version for If-Match on quote changes.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["full_read"]}], "summary": "Get a quote", "tags": ["Quotes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["full_read"]}, "put": {"description": "Save metadata and admit customer signers/CC from the quote's active billing links while preserving negotiated economics. Supply complete unchanged phases and contactIds; at most 100 new customer references per update. Changed prices, financial context, payment terms, new merchant countersigners, files, integration bindings and staged roster changes require authoring admission and return 409. Optional omissions preserve values; null clears scalar metadata/integration IDs, null optional recipient/asset arrays preserve and [] clears. A null or blank title is refused.\n\n**Required scope:** `full_access`", "operationId": "updateQuote", "parameters": [{"description": "Id of the quote.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "quote_id", "required": true, "schema": {"format": "uuid", "title": "Quote Id", "type": "string"}}, {"description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "in": "header", "name": "sequence-version", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "title": "Sequence-Version"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"properties": {"amendment": {"anyOf": [{"additionalProperties": false, "properties": {"contractId": {"type": "string"}, "effectiveFrom": {"type": "string"}}, "required": ["contractId", "effectiveFrom"], "type": "object"}, {"type": "null"}]}, "attachmentAssetIds": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}]}, "ccContactIds": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}]}, "contactIds": {"items": {"type": "string"}, "type": "array"}, "counterSignerIds": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}]}, "currency": {"anyOf": [{"enum": ["AED", "ARS", "AUD", "BRL", "BGN", "CAD", "CHF", "CLP", "CNY", "COP", "CZK", "DKK", "EGP", "EUR", "GBP", "HKD", "ILS", "INR", "ISK", "JPY", "KRW", "MXN", "NOK", "NZD", "PLN", "SAR", "SEK", "SGD", "THB", "USD", "UYU", "ZAR"], "type": "string"}, {"type": "null"}]}, "customerId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "dealType": {"anyOf": [{"enum": ["NEW_BUSINESS", "RENEWAL", "AMENDMENT"], "type": "string"}, {"type": "null"}]}, "defaultDueDateDays": {"anyOf": [{"type": "integer"}, {"type": "null"}]}, "expiryDays": {"anyOf": [{"format": "int32", "type": "integer"}, {"type": "null"}]}, "integrationIds": {"anyOf": [{"items": {"properties": {"id": {"type": "string"}, "service": {"enum": ["Amazon_Redshift", "GoCardless", "Google_BigQuery", "Google_Sheets", "HubSpot", "NetSuite", "QuickBooks_Online", "Salesforce", "Slack", "Snowflake", "Stripe", "Xero", "Avalara", "Anrok", "Attio", "Numeral", "Rillet", "Sphere"], "type": "string"}}, "required": ["id", "service"], "type": "object"}, "type": "array"}, {"type": "null"}]}, "phases": {"items": {"properties": {"discounts": {"items": {"properties": {"amount": {"type": "string"}, "message": {"type": "string"}, "restrictToPrices": {"items": {"type": "string"}, "type": "array"}, "seatDiscountType": {"anyOf": [{"enum": ["INCLUDED_SEATS_ONLY", "OVERAGE_SEATS_ONLY", "ALL_SEATS"], "type": "string"}, {"type": "null"}]}, "type": {"enum": ["PERCENTAGE", "NOMINAL"], "type": "string"}}, "required": ["amount", "message", "restrictToPrices", "type"], "type": "object"}, "type": "array"}, "duration": {"anyOf": [{"properties": {"days": {"format": "int32", "type": "integer"}, "months": {"format": "int32", "type": "integer"}, "weeks": {"format": "int32", "type": "integer"}, "years": {"format": "int32", "type": "integer"}}, "required": ["days", "months", "weeks", "years"], "type": "object"}, {"type": "null"}]}, "minimums": {"items": {"properties": {"amount": {"type": "string"}, "restrictToPrices": {"items": {"type": "string"}, "type": "array"}}, "required": ["amount", "restrictToPrices"], "type": "object"}, "type": "array"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "prices": {"items": {"properties": {"billingFrequency": {"enum": ["ON_DEMAND", "ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY", "PER_EVENT"], "type": "string"}, "billingType": {"enum": ["IN_ARREARS", "IN_ADVANCE"], "type": "string"}, "customMetricParameters": {"items": {"properties": {"parameterId": {"type": "string"}, "value": {"type": "string"}}, "required": ["parameterId", "value"], "type": "object"}, "type": "array"}, "integrationIds": {"items": {"properties": {"id": {"type": "string"}, "service": {"enum": ["Amazon_Redshift", "GoCardless", "Google_BigQuery", "Google_Sheets", "HubSpot", "NetSuite", "QuickBooks_Online", "Salesforce", "Slack", "Snowflake", "Stripe", "Xero", "Avalara", "Anrok", "Attio", "Numeral", "Rillet", "Sphere"], "type": "string"}}, "required": ["id", "service"], "type": "object"}, "type": "array"}, "listPriceId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "name": {"type": "string"}, "productId": {"type": "string"}, "structure": {"discriminator": {"propertyName": "pricingType"}, "oneOf": [{"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["ONE_TIME"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["FIXED"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"isPricePercentage": {"type": "boolean"}, "pricePerUnit": {"type": "string"}, "pricingType": {"enum": ["LINEAR"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["isPricePercentage", "pricePerUnit", "pricingType", "usageMetricId"], "type": "object"}, {"properties": {"contractedMinimumSeats": {"type": "integer"}, "overagesBillingFrequency": {"anyOf": [{"enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, {"type": "null"}]}, "pricePerSeat": {"type": "string"}, "pricingType": {"enum": ["SEAT_BASED"], "type": "string"}, "prorateFlatFees": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, "prorationStrategy": {"enum": ["USE_MAXIMUM", "PRORATE_INCREMENTS", "PRORATE_ALL_CHANGES"], "type": "string"}, "seatMetricId": {"type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["price"], "type": "object"}, "type": "array"}}, "required": ["contractedMinimumSeats", "pricePerSeat", "pricingType", "prorationStrategy", "seatMetricId", "tiers"], "type": "object"}, {"properties": {"pricingType": {"enum": ["GRADUATED"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageCalculationMode": {"enum": ["BILLING_PERIOD", "CUMULATIVE", "PERIODIC"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageCalculationMode", "usageMetricId"], "type": "object"}, {"properties": {"pricingType": {"enum": ["VOLUME"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "maxPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageMetricId"], "type": "object"}, {"properties": {"packageSize": {"type": "string"}, "pricePerPackage": {"type": "string"}, "pricingType": {"enum": ["PACKAGE"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["packageSize", "pricePerPackage", "pricingType", "usageMetricId"], "type": "object"}], "required": ["pricingType"]}, "temporaryId": {"type": "string"}}, "required": ["billingFrequency", "billingType", "customMetricParameters", "integrationIds", "name", "productId", "structure", "temporaryId"], "type": "object"}, "type": "array"}}, "required": ["discounts", "minimums", "prices"], "type": "object"}, "type": "array"}, "preliminaryBillingStartDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "purchaseOrderNumber": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "salesforceOpportunityId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "title": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["contactIds", "phases"], "type": "object"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"properties": {"acceptedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "activeErrors": {"items": {"properties": {"createdAt": {"type": "string"}, "errorCode": {"enum": ["DROPBOX_SIGNATURE_REQUEST_REJECTED", "DROPBOX_REQUEST_NOT_ACKNOWLEDGED", "PDF_GENERATION_TIMEOUT", "PDF_GENERATION_FAILED", "TASK_EXHAUSTED_RETRIES", "WEBHOOK_PROCESSING_FAILED", "AUTO_EXECUTE_FAILED", "SIGNER_AUTH_FAILED", "QUOTE_STUCK_IN_PREPARING_SIGNATURE_REQUEST_STATUS"], "type": "string"}, "errorContext": {"additionalProperties": {}, "type": "object"}, "id": {"type": "string"}, "recoveryAction": {"enum": ["REPUBLISH", "REGENERATE_PDF", "MANUAL_EXECUTE", "RESEND_SIGNING_EMAIL", "RETRY_SIGNATURE_REQUEST", "CONTACT_SUPPORT"], "type": "string"}}, "required": ["createdAt", "errorCode", "errorContext", "id", "recoveryAction"], "type": "object"}, "type": "array"}, "amendment": {"anyOf": [{"additionalProperties": false, "properties": {"adjustmentTotal": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "amended": {"anyOf": [{"properties": {"phases": {"items": {"properties": {"discounts": {"items": {"properties": {"amount": {"type": "string"}, "discountCalculationType": {"enum": ["PERCENTAGE", "NOMINAL"], "type": "string"}, "message": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}, "seatDiscountType": {"anyOf": [{"enum": ["INCLUDED_SEATS_ONLY", "OVERAGE_SEATS_ONLY", "ALL_SEATS"], "type": "string"}, {"type": "null"}]}}, "required": ["amount", "discountCalculationType", "message", "productIds"], "type": "object"}, "type": "array"}, "endDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minimums": {"items": {"properties": {"amount": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}}, "required": ["amount", "productIds"], "type": "object"}, "type": "array"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "prices": {"items": {"properties": {"billingFrequency": {"enum": ["ON_DEMAND", "ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY", "PER_EVENT"], "type": "string"}, "billingType": {"enum": ["IN_ARREARS", "IN_ADVANCE"], "type": "string"}, "customMetricParameters": {"items": {"properties": {"parameterId": {"type": "string"}, "value": {"type": "string"}}, "required": ["parameterId", "value"], "type": "object"}, "type": "array"}, "name": {"type": "string"}, "productId": {"type": "string"}, "structure": {"discriminator": {"propertyName": "pricingType"}, "oneOf": [{"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["ONE_TIME"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["FIXED"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"isPricePercentage": {"type": "boolean"}, "pricePerUnit": {"type": "string"}, "pricingType": {"enum": ["LINEAR"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["isPricePercentage", "pricePerUnit", "pricingType", "usageMetricId"], "type": "object"}, {"properties": {"contractedMinimumSeats": {"type": "integer"}, "overagesBillingFrequency": {"anyOf": [{"enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, {"type": "null"}]}, "pricePerSeat": {"type": "string"}, "pricingType": {"enum": ["SEAT_BASED"], "type": "string"}, "prorateFlatFees": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, "prorationStrategy": {"enum": ["USE_MAXIMUM", "PRORATE_INCREMENTS", "PRORATE_ALL_CHANGES"], "type": "string"}, "seatMetricId": {"type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["price"], "type": "object"}, "type": "array"}}, "required": ["contractedMinimumSeats", "pricePerSeat", "pricingType", "prorationStrategy", "seatMetricId", "tiers"], "type": "object"}, {"properties": {"pricingType": {"enum": ["GRADUATED"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageCalculationMode": {"enum": ["BILLING_PERIOD", "CUMULATIVE", "PERIODIC"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageCalculationMode", "usageMetricId"], "type": "object"}, {"properties": {"pricingType": {"enum": ["VOLUME"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "maxPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageMetricId"], "type": "object"}, {"properties": {"packageSize": {"type": "string"}, "pricePerPackage": {"type": "string"}, "pricingType": {"enum": ["PACKAGE"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["packageSize", "pricePerPackage", "pricingType", "usageMetricId"], "type": "object"}], "required": ["pricingType"]}, "usageCalculationPeriod": {"anyOf": [{"properties": {"frequency": {"enum": ["MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, "interval": {"format": "int32", "type": "integer"}}, "required": ["frequency", "interval"], "type": "object"}, {"type": "null"}]}}, "required": ["billingFrequency", "billingType", "customMetricParameters", "name", "productId", "structure"], "type": "object"}, "type": "array"}, "startDate": {"type": "string"}}, "required": ["discounts", "minimums", "prices", "startDate"], "type": "object"}, "type": "array"}}, "required": ["phases"], "type": "object"}, {"type": "null"}]}, "amendedContractValue": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "appliedFrom": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "contractId": {"type": "string"}, "effectiveFrom": {"type": "string"}, "executableUntil": {"type": "string"}, "original": {"anyOf": [{"properties": {"phases": {"items": {"properties": {"discounts": {"items": {"properties": {"amount": {"type": "string"}, "discountCalculationType": {"enum": ["PERCENTAGE", "NOMINAL"], "type": "string"}, "message": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}, "seatDiscountType": {"anyOf": [{"enum": ["INCLUDED_SEATS_ONLY", "OVERAGE_SEATS_ONLY", "ALL_SEATS"], "type": "string"}, {"type": "null"}]}}, "required": ["amount", "discountCalculationType", "message", "productIds"], "type": "object"}, "type": "array"}, "endDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minimums": {"items": {"properties": {"amount": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}}, "required": ["amount", "productIds"], "type": "object"}, "type": "array"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "prices": {"items": {"properties": {"billingFrequency": {"enum": ["ON_DEMAND", "ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY", "PER_EVENT"], "type": "string"}, "billingType": {"enum": ["IN_ARREARS", "IN_ADVANCE"], "type": "string"}, "customMetricParameters": {"items": {"properties": {"parameterId": {"type": "string"}, "value": {"type": "string"}}, "required": ["parameterId", "value"], "type": "object"}, "type": "array"}, "name": {"type": "string"}, "productId": {"type": "string"}, "structure": {"discriminator": {"propertyName": "pricingType"}, "oneOf": [{"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["ONE_TIME"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["FIXED"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"isPricePercentage": {"type": "boolean"}, "pricePerUnit": {"type": "string"}, "pricingType": {"enum": ["LINEAR"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["isPricePercentage", "pricePerUnit", "pricingType", "usageMetricId"], "type": "object"}, {"properties": {"contractedMinimumSeats": {"type": "integer"}, "overagesBillingFrequency": {"anyOf": [{"enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, {"type": "null"}]}, "pricePerSeat": {"type": "string"}, "pricingType": {"enum": ["SEAT_BASED"], "type": "string"}, "prorateFlatFees": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, "prorationStrategy": {"enum": ["USE_MAXIMUM", "PRORATE_INCREMENTS", "PRORATE_ALL_CHANGES"], "type": "string"}, "seatMetricId": {"type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["price"], "type": "object"}, "type": "array"}}, "required": ["contractedMinimumSeats", "pricePerSeat", "pricingType", "prorationStrategy", "seatMetricId", "tiers"], "type": "object"}, {"properties": {"pricingType": {"enum": ["GRADUATED"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageCalculationMode": {"enum": ["BILLING_PERIOD", "CUMULATIVE", "PERIODIC"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageCalculationMode", "usageMetricId"], "type": "object"}, {"properties": {"pricingType": {"enum": ["VOLUME"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "maxPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageMetricId"], "type": "object"}, {"properties": {"packageSize": {"type": "string"}, "pricePerPackage": {"type": "string"}, "pricingType": {"enum": ["PACKAGE"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["packageSize", "pricePerPackage", "pricingType", "usageMetricId"], "type": "object"}], "required": ["pricingType"]}, "usageCalculationPeriod": {"anyOf": [{"properties": {"frequency": {"enum": ["MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, "interval": {"format": "int32", "type": "integer"}}, "required": ["frequency", "interval"], "type": "object"}, {"type": "null"}]}}, "required": ["billingFrequency", "billingType", "customMetricParameters", "name", "productId", "structure"], "type": "object"}, "type": "array"}, "startDate": {"type": "string"}}, "required": ["discounts", "minimums", "prices", "startDate"], "type": "object"}, "type": "array"}}, "required": ["phases"], "type": "object"}, {"type": "null"}]}, "originalContractValue": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "outForSignatureQuoteId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "supersededByQuoteId": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["contractId", "effectiveFrom", "executableUntil"], "type": "object"}, {"type": "null"}]}, "approvalWorkflowId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "archivedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "attachmentAssets": {"items": {"properties": {"createdAt": {"type": "string"}, "createdBy": {"type": "string"}, "createdByType": {"enum": ["SEQUENCE_USER", "API_CLIENT"], "type": "string"}, "fileName": {"type": "string"}, "fileSizeBytes": {"format": "int32", "type": "integer"}, "format": {"enum": ["JPEG", "JPG", "PNG", "PDF", "CSV", "TXT", "RTF", "MD", "XLS", "XLSX", "XLSM", "DOC", "DOCX", "ZIP", "ODT", "ODS"], "type": "string"}, "id": {"type": "string"}, "type": {"enum": ["IMAGE", "DOCUMENT", "BINARY"], "type": "string"}, "url": {"type": "string"}}, "required": ["createdAt", "createdBy", "createdByType", "fileName", "fileSizeBytes", "format", "id", "type", "url"], "type": "object"}, "type": "array"}, "ccContactIds": {"items": {"type": "string"}, "type": "array"}, "ccContacts": {"items": {"properties": {"contactId": {"type": "string"}, "email": {"type": "string"}, "name": {"type": "string"}, "notificationHistory": {"items": {"properties": {"notifiedAt": {"type": "string"}, "trigger": {"enum": ["PUBLISH", "READY_TO_SIGN", "SEND_REMINDERS", "NOTIFY_RECIPIENTS"], "type": "string"}}, "required": ["notifiedAt", "trigger"], "type": "object"}, "type": "array"}}, "required": ["contactId", "email", "name", "notificationHistory"], "type": "object"}, "type": "array"}, "contactIds": {"items": {"type": "string"}, "type": "array"}, "contacts": {"items": {"properties": {"contactId": {"type": "string"}, "email": {"type": "string"}, "name": {"type": "string"}, "notificationHistory": {"items": {"properties": {"notifiedAt": {"type": "string"}, "trigger": {"enum": ["PUBLISH", "READY_TO_SIGN", "SEND_REMINDERS", "NOTIFY_RECIPIENTS"], "type": "string"}}, "required": ["notifiedAt", "trigger"], "type": "object"}, "type": "array"}, "signedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["contactId", "email", "name", "notificationHistory"], "type": "object"}, "type": "array"}, "contractId": {"description": "Created contract ID after execution, or the target contract ID for an amendment; null when neither exists. Older idempotency replays may omit this field; GET returns the current reference.", "type": ["string", "null"]}, "counterSigners": {"items": {"properties": {"email": {"type": "string"}, "id": {"type": "string"}, "name": {"type": "string"}, "notificationHistory": {"items": {"properties": {"notifiedAt": {"type": "string"}, "trigger": {"enum": ["PUBLISH", "READY_TO_SIGN", "SEND_REMINDERS", "NOTIFY_RECIPIENTS"], "type": "string"}}, "required": ["notifiedAt", "trigger"], "type": "object"}, "type": "array"}, "signedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["email", "id", "name", "notificationHistory"], "type": "object"}, "type": "array"}, "createdAt": {"type": "string"}, "createdBy": {"type": "string"}, "createdFrom": {"anyOf": [{"properties": {"entityId": {"type": "string"}, "entityType": {"enum": ["BILLING_SCHEDULE", "BILLING_SCHEDULE_DISCOUNT", "BILLING_SCHEDULE_MINIMUM", "BILLING_SCHEDULE_PHASE", "BILLING_SCHEDULE_PRICE", "CONTACT", "CREDIT_NOTE", "CREDIT_NOTE_APPLICATION", "CUSTOMER", "FILE", "INVOICE", "LEDGER_ACCOUNT", "LIST_PRICE", "OVERPAYMENT", "PAYMENT", "PAYMENT_APPLICATION", "PRICE", "PRODUCT", "QUOTE", "QUOTE_DISCOUNT", "QUOTE_MINIMUM", "QUOTE_PHASE", "QUOTE_PRICE", "QUOTE_PRICE_TIER", "QUOTE_TEMPLATE_PRICE", "TAX_CATEGORY", "TAX_CODE"], "type": "string"}}, "required": ["entityId", "entityType"], "type": "object"}, {"type": "null"}]}, "currency": {"anyOf": [{"enum": ["AED", "ARS", "AUD", "BRL", "BGN", "CAD", "CHF", "CLP", "CNY", "COP", "CZK", "DKK", "EGP", "EUR", "GBP", "HKD", "ILS", "INR", "ISK", "JPY", "KRW", "MXN", "NOK", "NZD", "PLN", "SAR", "SEK", "SGD", "THB", "USD", "UYU", "ZAR", "CLF"], "type": "string"}, {"type": "null"}], "description": "Quote currency, including CLF (Unidad de Fomento)."}, "customerAddress": {"anyOf": [{"properties": {"country": {"enum": ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW"], "type": "string"}, "line1": {"type": "string"}, "line2": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "postcode": {"type": "string"}, "state": {"anyOf": [{"enum": ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AB", "BC", "MB", "NB", "NL", "NS", "NT", "NU", "ON", "PE", "QC", "SK", "YT"], "type": "string"}, {"type": "null"}]}, "town": {"type": "string"}}, "required": ["country", "line1", "postcode", "town"], "type": "object"}, {"type": "null"}]}, "customerId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "customerLegalName": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "dealType": {"anyOf": [{"enum": ["NEW_BUSINESS", "RENEWAL", "AMENDMENT"], "type": "string"}, {"type": "null"}]}, "defaultDueDateDays": {"anyOf": [{"type": "integer"}, {"type": "null"}]}, "executedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "expiresAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "expiryDays": {"anyOf": [{"format": "int32", "type": "integer"}, {"type": "null"}]}, "id": {"type": "string"}, "integrationIds": {"items": {"properties": {"id": {"type": "string"}, "isPending": {"type": "boolean"}, "service": {"enum": ["Amazon_Redshift", "GoCardless", "Google_BigQuery", "Google_Sheets", "HubSpot", "NetSuite", "QuickBooks_Online", "Salesforce", "Slack", "Snowflake", "Stripe", "Xero", "Avalara", "Anrok", "Attio", "Numeral", "Rillet", "Sphere"], "type": "string"}}, "required": ["id", "isPending", "service"], "type": "object"}, "type": "array"}, "isExpired": {"type": "boolean"}, "isSignaturesEnabled": {"type": "boolean"}, "merchantBranding": {"properties": {"address": {"properties": {"country": {"enum": ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW"], "type": "string"}, "line1": {"type": "string"}, "line2": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "postcode": {"type": "string"}, "state": {"anyOf": [{"enum": ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AB", "BC", "MB", "NB", "NL", "NS", "NT", "NU", "ON", "PE", "QC", "SK", "YT"], "type": "string"}, {"type": "null"}]}, "town": {"type": "string"}}, "required": ["country", "line1", "postcode", "town"], "type": "object"}, "email": {"type": "string"}, "legalCompanyName": {"type": "string"}, "logoUrl": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "primaryColour": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "showUsageInCustomerPortal": {"type": "boolean"}, "supportEmail": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "supportUrl": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "url": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["address", "email", "legalCompanyName", "showUsageInCustomerPortal"], "type": "object"}, "pdfStatus": {"enum": ["NOT_YET_REQUESTED", "REQUESTED", "IN_PROGRESS", "FAILED", "GENERATED"], "type": "string"}, "phases": {"items": {"properties": {"createdAt": {"type": "string"}, "discounts": {"items": {"properties": {"amount": {"type": "string"}, "createdAt": {"type": "string"}, "discountCalculationType": {"enum": ["PERCENTAGE", "NOMINAL"], "type": "string"}, "id": {"type": "string"}, "message": {"type": "string"}, "restrictToPrices": {"items": {"type": "string"}, "type": "array"}, "seatDiscountType": {"anyOf": [{"enum": ["INCLUDED_SEATS_ONLY", "OVERAGE_SEATS_ONLY", "ALL_SEATS"], "type": "string"}, {"type": "null"}]}, "updatedAt": {"type": "string"}}, "required": ["amount", "createdAt", "discountCalculationType", "id", "message", "restrictToPrices", "updatedAt"], "type": "object"}, "type": "array"}, "duration": {"anyOf": [{"properties": {"days": {"format": "int32", "type": "integer"}, "months": {"format": "int32", "type": "integer"}, "weeks": {"format": "int32", "type": "integer"}, "years": {"format": "int32", "type": "integer"}}, "required": ["days", "months", "weeks", "years"], "type": "object"}, {"type": "null"}]}, "id": {"type": "string"}, "minimums": {"items": {"properties": {"amount": {"type": "string"}, "createdAt": {"type": "string"}, "id": {"type": "string"}, "restrictToPrices": {"items": {"type": "string"}, "type": "array"}, "updatedAt": {"type": "string"}}, "required": ["amount", "createdAt", "id", "restrictToPrices", "updatedAt"], "type": "object"}, "type": "array"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "prices": {"items": {"properties": {"billingFrequency": {"enum": ["ON_DEMAND", "ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY", "PER_EVENT"], "type": "string"}, "billingType": {"enum": ["IN_ARREARS", "IN_ADVANCE"], "type": "string"}, "createdAt": {"type": "string"}, "customMetricParameters": {"items": {"properties": {"parameterId": {"type": "string"}, "value": {"type": "string"}}, "required": ["parameterId", "value"], "type": "object"}, "type": "array"}, "id": {"type": "string"}, "integrationIds": {"items": {"properties": {"id": {"type": "string"}, "isPending": {"type": "boolean"}, "service": {"enum": ["Amazon_Redshift", "GoCardless", "Google_BigQuery", "Google_Sheets", "HubSpot", "NetSuite", "QuickBooks_Online", "Salesforce", "Slack", "Snowflake", "Stripe", "Xero", "Avalara", "Anrok", "Attio", "Numeral", "Rillet", "Sphere"], "type": "string"}}, "required": ["id", "isPending", "service"], "type": "object"}, "type": "array"}, "listPriceId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "name": {"type": "string"}, "productId": {"type": "string"}, "structure": {"discriminator": {"propertyName": "pricingType"}, "oneOf": [{"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["ONE_TIME"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["FIXED"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"isPricePercentage": {"type": "boolean"}, "pricePerUnit": {"type": "string"}, "pricingType": {"enum": ["LINEAR"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["isPricePercentage", "pricePerUnit", "pricingType", "usageMetricId"], "type": "object"}, {"properties": {"contractedMinimumSeats": {"type": "integer"}, "overagesBillingFrequency": {"anyOf": [{"enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, {"type": "null"}]}, "pricePerSeat": {"type": "string"}, "pricingType": {"enum": ["SEAT_BASED"], "type": "string"}, "prorateFlatFees": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, "prorationStrategy": {"enum": ["USE_MAXIMUM", "PRORATE_INCREMENTS", "PRORATE_ALL_CHANGES"], "type": "string"}, "seatMetricId": {"type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["price"], "type": "object"}, "type": "array"}}, "required": ["contractedMinimumSeats", "pricePerSeat", "pricingType", "prorationStrategy", "seatMetricId", "tiers"], "type": "object"}, {"properties": {"pricingType": {"enum": ["GRADUATED"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageCalculationMode": {"enum": ["BILLING_PERIOD", "CUMULATIVE", "PERIODIC"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageCalculationMode", "usageMetricId"], "type": "object"}, {"properties": {"pricingType": {"enum": ["VOLUME"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "maxPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageMetricId"], "type": "object"}, {"properties": {"packageSize": {"type": "string"}, "pricePerPackage": {"type": "string"}, "pricingType": {"enum": ["PACKAGE"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["packageSize", "pricePerPackage", "pricingType", "usageMetricId"], "type": "object"}], "required": ["pricingType"]}, "updatedAt": {"type": "string"}}, "required": ["billingFrequency", "billingType", "createdAt", "customMetricParameters", "id", "integrationIds", "name", "productId", "structure", "updatedAt"], "type": "object"}, "type": "array"}}, "required": ["createdAt", "discounts", "id", "minimums", "prices"], "type": "object"}, "type": "array"}, "preliminaryBillingStartDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "preparingSignatureRequestAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "publishedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "purchaseOrderNumber": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "quoteNumber": {"type": "string"}, "readyToSignAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "salesforceOpportunityId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "signatureMode": {"anyOf": [{"enum": ["EMBEDDED", "NON_EMBEDDED"], "type": "string"}, {"type": "null"}]}, "status": {"enum": ["DRAFT", "PUBLISHED", "PREPARING_SIGNATURE_REQUEST", "READY_TO_SIGN", "ACCEPTED", "EXECUTED"], "type": "string"}, "title": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "updatedAt": {"type": "string"}}, "required": ["activeErrors", "attachmentAssets", "ccContactIds", "ccContacts", "contactIds", "contacts", "counterSigners", "createdAt", "createdBy", "id", "integrationIds", "isExpired", "isSignaturesEnabled", "merchantBranding", "pdfStatus", "phases", "quoteNumber", "status", "updatedAt"], "type": "object"}}}, "description": "The updated quote.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["full_access"]}], "summary": "Update a quote", "tags": ["Quotes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["full_access"]}}, "/api/v1/sandbox/quotes/{quote_id}/accept": {"post": {"description": "Attest that an external acceptance occurred for the exact published offer. Requires an external-acceptance policy; signing and email-code confirmation must use their configured flow. Records the authenticated operator and the reviewed package as immutable evidence. This does not create a customer signature or execute a contract. Omission/null preserves the published PO number; a different number requires reviewing and publishing a revised offer (409).\n\n**Required scope:** `full_access`", "operationId": "acceptQuote", "parameters": [{"description": "Id of the quote.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "quote_id", "required": true, "schema": {"format": "uuid", "title": "Quote Id", "type": "string"}}, {"description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "in": "header", "name": "sequence-version", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "title": "Sequence-Version"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"properties": {"purchaseOrderNumber": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "type": "object"}}}, "required": false}, "responses": {"200": {"content": {"application/json": {"schema": {"properties": {"acceptedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "amendment": {"anyOf": [{"additionalProperties": false, "properties": {"adjustmentTotal": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "amended": {"anyOf": [{"properties": {"phases": {"items": {"properties": {"discounts": {"items": {"properties": {"amount": {"type": "string"}, "discountCalculationType": {"enum": ["PERCENTAGE", "NOMINAL"], "type": "string"}, "message": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}, "seatDiscountType": {"anyOf": [{"enum": ["INCLUDED_SEATS_ONLY", "OVERAGE_SEATS_ONLY", "ALL_SEATS"], "type": "string"}, {"type": "null"}]}}, "required": ["amount", "discountCalculationType", "message", "productIds"], "type": "object"}, "type": "array"}, "endDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minimums": {"items": {"properties": {"amount": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}}, "required": ["amount", "productIds"], "type": "object"}, "type": "array"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "prices": {"items": {"properties": {"billingFrequency": {"enum": ["ON_DEMAND", "ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY", "PER_EVENT"], "type": "string"}, "billingType": {"enum": ["IN_ARREARS", "IN_ADVANCE"], "type": "string"}, "customMetricParameters": {"items": {"properties": {"parameterId": {"type": "string"}, "value": {"type": "string"}}, "required": ["parameterId", "value"], "type": "object"}, "type": "array"}, "name": {"type": "string"}, "productId": {"type": "string"}, "structure": {"discriminator": {"propertyName": "pricingType"}, "oneOf": [{"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["ONE_TIME"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["FIXED"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"isPricePercentage": {"type": "boolean"}, "pricePerUnit": {"type": "string"}, "pricingType": {"enum": ["LINEAR"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["isPricePercentage", "pricePerUnit", "pricingType", "usageMetricId"], "type": "object"}, {"properties": {"contractedMinimumSeats": {"type": "integer"}, "overagesBillingFrequency": {"anyOf": [{"enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, {"type": "null"}]}, "pricePerSeat": {"type": "string"}, "pricingType": {"enum": ["SEAT_BASED"], "type": "string"}, "prorateFlatFees": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, "prorationStrategy": {"enum": ["USE_MAXIMUM", "PRORATE_INCREMENTS", "PRORATE_ALL_CHANGES"], "type": "string"}, "seatMetricId": {"type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["price"], "type": "object"}, "type": "array"}}, "required": ["contractedMinimumSeats", "pricePerSeat", "pricingType", "prorationStrategy", "seatMetricId", "tiers"], "type": "object"}, {"properties": {"pricingType": {"enum": ["GRADUATED"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageCalculationMode": {"enum": ["BILLING_PERIOD", "CUMULATIVE", "PERIODIC"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageCalculationMode", "usageMetricId"], "type": "object"}, {"properties": {"pricingType": {"enum": ["VOLUME"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "maxPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageMetricId"], "type": "object"}, {"properties": {"packageSize": {"type": "string"}, "pricePerPackage": {"type": "string"}, "pricingType": {"enum": ["PACKAGE"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["packageSize", "pricePerPackage", "pricingType", "usageMetricId"], "type": "object"}], "required": ["pricingType"]}, "usageCalculationPeriod": {"anyOf": [{"properties": {"frequency": {"enum": ["MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, "interval": {"format": "int32", "type": "integer"}}, "required": ["frequency", "interval"], "type": "object"}, {"type": "null"}]}}, "required": ["billingFrequency", "billingType", "customMetricParameters", "name", "productId", "structure"], "type": "object"}, "type": "array"}, "startDate": {"type": "string"}}, "required": ["discounts", "minimums", "prices", "startDate"], "type": "object"}, "type": "array"}}, "required": ["phases"], "type": "object"}, {"type": "null"}]}, "amendedContractValue": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "appliedFrom": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "contractId": {"type": "string"}, "effectiveFrom": {"type": "string"}, "executableUntil": {"type": "string"}, "original": {"anyOf": [{"properties": {"phases": {"items": {"properties": {"discounts": {"items": {"properties": {"amount": {"type": "string"}, "discountCalculationType": {"enum": ["PERCENTAGE", "NOMINAL"], "type": "string"}, "message": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}, "seatDiscountType": {"anyOf": [{"enum": ["INCLUDED_SEATS_ONLY", "OVERAGE_SEATS_ONLY", "ALL_SEATS"], "type": "string"}, {"type": "null"}]}}, "required": ["amount", "discountCalculationType", "message", "productIds"], "type": "object"}, "type": "array"}, "endDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minimums": {"items": {"properties": {"amount": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}}, "required": ["amount", "productIds"], "type": "object"}, "type": "array"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "prices": {"items": {"properties": {"billingFrequency": {"enum": ["ON_DEMAND", "ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY", "PER_EVENT"], "type": "string"}, "billingType": {"enum": ["IN_ARREARS", "IN_ADVANCE"], "type": "string"}, "customMetricParameters": {"items": {"properties": {"parameterId": {"type": "string"}, "value": {"type": "string"}}, "required": ["parameterId", "value"], "type": "object"}, "type": "array"}, "name": {"type": "string"}, "productId": {"type": "string"}, "structure": {"discriminator": {"propertyName": "pricingType"}, "oneOf": [{"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["ONE_TIME"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["FIXED"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"isPricePercentage": {"type": "boolean"}, "pricePerUnit": {"type": "string"}, "pricingType": {"enum": ["LINEAR"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["isPricePercentage", "pricePerUnit", "pricingType", "usageMetricId"], "type": "object"}, {"properties": {"contractedMinimumSeats": {"type": "integer"}, "overagesBillingFrequency": {"anyOf": [{"enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, {"type": "null"}]}, "pricePerSeat": {"type": "string"}, "pricingType": {"enum": ["SEAT_BASED"], "type": "string"}, "prorateFlatFees": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, "prorationStrategy": {"enum": ["USE_MAXIMUM", "PRORATE_INCREMENTS", "PRORATE_ALL_CHANGES"], "type": "string"}, "seatMetricId": {"type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["price"], "type": "object"}, "type": "array"}}, "required": ["contractedMinimumSeats", "pricePerSeat", "pricingType", "prorationStrategy", "seatMetricId", "tiers"], "type": "object"}, {"properties": {"pricingType": {"enum": ["GRADUATED"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageCalculationMode": {"enum": ["BILLING_PERIOD", "CUMULATIVE", "PERIODIC"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageCalculationMode", "usageMetricId"], "type": "object"}, {"properties": {"pricingType": {"enum": ["VOLUME"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "maxPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageMetricId"], "type": "object"}, {"properties": {"packageSize": {"type": "string"}, "pricePerPackage": {"type": "string"}, "pricingType": {"enum": ["PACKAGE"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["packageSize", "pricePerPackage", "pricingType", "usageMetricId"], "type": "object"}], "required": ["pricingType"]}, "usageCalculationPeriod": {"anyOf": [{"properties": {"frequency": {"enum": ["MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, "interval": {"format": "int32", "type": "integer"}}, "required": ["frequency", "interval"], "type": "object"}, {"type": "null"}]}}, "required": ["billingFrequency", "billingType", "customMetricParameters", "name", "productId", "structure"], "type": "object"}, "type": "array"}, "startDate": {"type": "string"}}, "required": ["discounts", "minimums", "prices", "startDate"], "type": "object"}, "type": "array"}}, "required": ["phases"], "type": "object"}, {"type": "null"}]}, "originalContractValue": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "outForSignatureQuoteId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "supersededByQuoteId": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["contractId", "effectiveFrom", "executableUntil"], "type": "object"}, {"type": "null"}]}, "archivedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "attachmentAssets": {"items": {"properties": {"createdAt": {"type": "string"}, "createdBy": {"type": "string"}, "createdByType": {"enum": ["SEQUENCE_USER", "API_CLIENT"], "type": "string"}, "fileName": {"type": "string"}, "fileSizeBytes": {"format": "int32", "type": "integer"}, "format": {"enum": ["JPEG", "JPG", "PNG", "PDF", "CSV", "TXT", "RTF", "MD", "XLS", "XLSX", "XLSM", "DOC", "DOCX", "ZIP", "ODT", "ODS"], "type": "string"}, "id": {"type": "string"}, "type": {"enum": ["IMAGE", "DOCUMENT", "BINARY"], "type": "string"}, "url": {"type": "string"}}, "required": ["createdAt", "createdBy", "createdByType", "fileName", "fileSizeBytes", "format", "id", "type", "url"], "type": "object"}, "type": "array"}, "ccContacts": {"items": {"properties": {"contactId": {"type": "string"}, "email": {"type": "string"}, "name": {"type": "string"}, "notificationHistory": {"items": {"properties": {"notifiedAt": {"type": "string"}, "trigger": {"enum": ["PUBLISH", "READY_TO_SIGN", "SEND_REMINDERS", "NOTIFY_RECIPIENTS"], "type": "string"}}, "required": ["notifiedAt", "trigger"], "type": "object"}, "type": "array"}}, "required": ["contactId", "email", "name", "notificationHistory"], "type": "object"}, "type": "array"}, "contacts": {"items": {"properties": {"contactId": {"type": "string"}, "email": {"type": "string"}, "name": {"type": "string"}, "notificationHistory": {"items": {"properties": {"notifiedAt": {"type": "string"}, "trigger": {"enum": ["PUBLISH", "READY_TO_SIGN", "SEND_REMINDERS", "NOTIFY_RECIPIENTS"], "type": "string"}}, "required": ["notifiedAt", "trigger"], "type": "object"}, "type": "array"}, "signedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["contactId", "email", "name", "notificationHistory"], "type": "object"}, "type": "array"}, "contractId": {"description": "Created contract ID after execution, or the target contract ID for an amendment; null when neither exists. Older idempotency replays may omit this field; GET returns the current reference.", "type": ["string", "null"]}, "counterSigners": {"items": {"properties": {"email": {"type": "string"}, "id": {"type": "string"}, "name": {"type": "string"}, "notificationHistory": {"items": {"properties": {"notifiedAt": {"type": "string"}, "trigger": {"enum": ["PUBLISH", "READY_TO_SIGN", "SEND_REMINDERS", "NOTIFY_RECIPIENTS"], "type": "string"}}, "required": ["notifiedAt", "trigger"], "type": "object"}, "type": "array"}, "signedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["email", "id", "name", "notificationHistory"], "type": "object"}, "type": "array"}, "createdAt": {"type": "string"}, "createdBy": {"type": "string"}, "createdFrom": {"anyOf": [{"properties": {"entityId": {"type": "string"}, "entityType": {"enum": ["BILLING_SCHEDULE", "BILLING_SCHEDULE_DISCOUNT", "BILLING_SCHEDULE_MINIMUM", "BILLING_SCHEDULE_PHASE", "BILLING_SCHEDULE_PRICE", "CONTACT", "CREDIT_NOTE", "CREDIT_NOTE_APPLICATION", "CUSTOMER", "FILE", "INVOICE", "LEDGER_ACCOUNT", "LIST_PRICE", "OVERPAYMENT", "PAYMENT", "PAYMENT_APPLICATION", "PRICE", "PRODUCT", "QUOTE", "QUOTE_DISCOUNT", "QUOTE_MINIMUM", "QUOTE_PHASE", "QUOTE_PRICE", "QUOTE_PRICE_TIER", "QUOTE_TEMPLATE_PRICE", "TAX_CATEGORY", "TAX_CODE"], "type": "string"}}, "required": ["entityId", "entityType"], "type": "object"}, {"type": "null"}]}, "currency": {"description": "Quote currency, including CLF (Unidad de Fomento).", "enum": ["AED", "ARS", "AUD", "BRL", "BGN", "CAD", "CHF", "CLP", "CNY", "COP", "CZK", "DKK", "EGP", "EUR", "GBP", "HKD", "ILS", "INR", "ISK", "JPY", "KRW", "MXN", "NOK", "NZD", "PLN", "SAR", "SEK", "SGD", "THB", "USD", "UYU", "ZAR", "CLF"], "type": "string"}, "customerAddress": {"properties": {"country": {"enum": ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW"], "type": "string"}, "line1": {"type": "string"}, "line2": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "postcode": {"type": "string"}, "state": {"anyOf": [{"enum": ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AB", "BC", "MB", "NB", "NL", "NS", "NT", "NU", "ON", "PE", "QC", "SK", "YT"], "type": "string"}, {"type": "null"}]}, "town": {"type": "string"}}, "required": ["country", "line1", "postcode", "town"], "type": "object"}, "customerId": {"type": "string"}, "customerLegalName": {"type": "string"}, "dealType": {"enum": ["NEW_BUSINESS", "RENEWAL", "AMENDMENT"], "type": "string"}, "defaultDueDateDays": {"anyOf": [{"type": "integer"}, {"type": "null"}]}, "executedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "expiresAt": {"type": "string"}, "id": {"type": "string"}, "isExpired": {"type": "boolean"}, "isSignaturesEnabled": {"type": "boolean"}, "merchantBranding": {"properties": {"address": {"properties": {"country": {"enum": ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW"], "type": "string"}, "line1": {"type": "string"}, "line2": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "postcode": {"type": "string"}, "state": {"anyOf": [{"enum": ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AB", "BC", "MB", "NB", "NL", "NS", "NT", "NU", "ON", "PE", "QC", "SK", "YT"], "type": "string"}, {"type": "null"}]}, "town": {"type": "string"}}, "required": ["country", "line1", "postcode", "town"], "type": "object"}, "email": {"type": "string"}, "legalCompanyName": {"type": "string"}, "logoUrl": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "primaryColour": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "showUsageInCustomerPortal": {"type": "boolean"}, "supportEmail": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "supportUrl": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "url": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["address", "email", "legalCompanyName", "showUsageInCustomerPortal"], "type": "object"}, "pdfStatus": {"enum": ["NOT_YET_REQUESTED", "REQUESTED", "IN_PROGRESS", "FAILED", "GENERATED"], "type": "string"}, "phases": {"items": {"properties": {"createdAt": {"type": "string"}, "discounts": {"items": {"properties": {"amount": {"type": "string"}, "createdAt": {"type": "string"}, "discountCalculationType": {"enum": ["PERCENTAGE", "NOMINAL"], "type": "string"}, "id": {"type": "string"}, "message": {"type": "string"}, "restrictToPrices": {"items": {"type": "string"}, "type": "array"}, "seatDiscountType": {"anyOf": [{"enum": ["INCLUDED_SEATS_ONLY", "OVERAGE_SEATS_ONLY", "ALL_SEATS"], "type": "string"}, {"type": "null"}]}, "updatedAt": {"type": "string"}}, "required": ["amount", "createdAt", "discountCalculationType", "id", "message", "restrictToPrices", "updatedAt"], "type": "object"}, "type": "array"}, "duration": {"anyOf": [{"properties": {"days": {"format": "int32", "type": "integer"}, "months": {"format": "int32", "type": "integer"}, "weeks": {"format": "int32", "type": "integer"}, "years": {"format": "int32", "type": "integer"}}, "required": ["days", "months", "weeks", "years"], "type": "object"}, {"type": "null"}]}, "id": {"type": "string"}, "minimums": {"items": {"properties": {"amount": {"type": "string"}, "createdAt": {"type": "string"}, "id": {"type": "string"}, "restrictToPrices": {"items": {"type": "string"}, "type": "array"}, "updatedAt": {"type": "string"}}, "required": ["amount", "createdAt", "id", "restrictToPrices", "updatedAt"], "type": "object"}, "type": "array"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "prices": {"items": {"properties": {"billingFrequency": {"enum": ["ON_DEMAND", "ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY", "PER_EVENT"], "type": "string"}, "billingType": {"enum": ["IN_ARREARS", "IN_ADVANCE"], "type": "string"}, "createdAt": {"type": "string"}, "customMetricParameters": {"items": {"properties": {"parameterId": {"type": "string"}, "value": {"type": "string"}}, "required": ["parameterId", "value"], "type": "object"}, "type": "array"}, "id": {"type": "string"}, "integrationIds": {"items": {"properties": {"id": {"type": "string"}, "isPending": {"type": "boolean"}, "service": {"enum": ["Amazon_Redshift", "GoCardless", "Google_BigQuery", "Google_Sheets", "HubSpot", "NetSuite", "QuickBooks_Online", "Salesforce", "Slack", "Snowflake", "Stripe", "Xero", "Avalara", "Anrok", "Attio", "Numeral", "Rillet", "Sphere"], "type": "string"}}, "required": ["id", "isPending", "service"], "type": "object"}, "type": "array"}, "listPriceId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "name": {"type": "string"}, "productId": {"type": "string"}, "structure": {"discriminator": {"propertyName": "pricingType"}, "oneOf": [{"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["ONE_TIME"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["FIXED"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"isPricePercentage": {"type": "boolean"}, "pricePerUnit": {"type": "string"}, "pricingType": {"enum": ["LINEAR"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["isPricePercentage", "pricePerUnit", "pricingType", "usageMetricId"], "type": "object"}, {"properties": {"contractedMinimumSeats": {"type": "integer"}, "overagesBillingFrequency": {"anyOf": [{"enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, {"type": "null"}]}, "pricePerSeat": {"type": "string"}, "pricingType": {"enum": ["SEAT_BASED"], "type": "string"}, "prorateFlatFees": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, "prorationStrategy": {"enum": ["USE_MAXIMUM", "PRORATE_INCREMENTS", "PRORATE_ALL_CHANGES"], "type": "string"}, "seatMetricId": {"type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["price"], "type": "object"}, "type": "array"}}, "required": ["contractedMinimumSeats", "pricePerSeat", "pricingType", "prorationStrategy", "seatMetricId", "tiers"], "type": "object"}, {"properties": {"pricingType": {"enum": ["GRADUATED"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageCalculationMode": {"enum": ["BILLING_PERIOD", "CUMULATIVE", "PERIODIC"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageCalculationMode", "usageMetricId"], "type": "object"}, {"properties": {"pricingType": {"enum": ["VOLUME"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "maxPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageMetricId"], "type": "object"}, {"properties": {"packageSize": {"type": "string"}, "pricePerPackage": {"type": "string"}, "pricingType": {"enum": ["PACKAGE"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["packageSize", "pricePerPackage", "pricingType", "usageMetricId"], "type": "object"}], "required": ["pricingType"]}, "updatedAt": {"type": "string"}}, "required": ["billingFrequency", "billingType", "createdAt", "customMetricParameters", "id", "integrationIds", "name", "productId", "structure", "updatedAt"], "type": "object"}, "type": "array"}}, "required": ["createdAt", "discounts", "id", "minimums", "prices"], "type": "object"}, "type": "array"}, "preliminaryBillingStartDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "preparingSignatureRequestAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "publishedAt": {"type": "string"}, "purchaseOrderNumber": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "quoteNumber": {"type": "string"}, "readyToSignAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "salesforceOpportunityId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "signatureMode": {"anyOf": [{"enum": ["EMBEDDED", "NON_EMBEDDED"], "type": "string"}, {"type": "null"}]}, "status": {"enum": ["DRAFT", "PUBLISHED", "PREPARING_SIGNATURE_REQUEST", "READY_TO_SIGN", "ACCEPTED", "EXECUTED"], "type": "string"}, "title": {"type": "string"}, "updatedAt": {"type": "string"}}, "required": ["attachmentAssets", "ccContacts", "contacts", "counterSigners", "createdAt", "createdBy", "currency", "customerAddress", "customerId", "customerLegalName", "dealType", "expiresAt", "id", "isExpired", "isSignaturesEnabled", "merchantBranding", "pdfStatus", "phases", "publishedAt", "quoteNumber", "status", "title", "updatedAt"], "type": "object"}}}, "description": "The updated quote.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["full_access"]}], "summary": "Accept a published quote", "tags": ["Quotes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["full_access"]}}, "/api/v1/sandbox/quotes/{quote_id}/analytics": {"get": {"description": "Read recorded views and distinct visitors, grouped by UTC date. This request does not record a view.\n\n**Required scope:** `full_read`", "operationId": "getQuoteAnalytics", "parameters": [{"description": "The quote reference.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "quote_id", "required": true, "schema": {"description": "The quote reference.", "format": "uuid", "title": "Quote Id", "type": "string"}}, {"description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "in": "header", "name": "sequence-version", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "title": "Sequence-Version"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/QuoteAnalytics"}}}, "description": "Recorded quote engagement.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["full_read"]}], "summary": "Get quote analytics", "tags": ["Quotes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["full_read"]}}, "/api/v1/sandbox/quotes/{quote_id}/archive": {"post": {"description": "**Required scope:** `full_access`", "operationId": "archiveQuote", "parameters": [{"description": "Id of the quote.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "quote_id", "required": true, "schema": {"format": "uuid", "title": "Quote Id", "type": "string"}}, {"description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "in": "header", "name": "sequence-version", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "title": "Sequence-Version"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"properties": {"acceptedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "activeErrors": {"items": {"properties": {"createdAt": {"type": "string"}, "errorCode": {"enum": ["DROPBOX_SIGNATURE_REQUEST_REJECTED", "DROPBOX_REQUEST_NOT_ACKNOWLEDGED", "PDF_GENERATION_TIMEOUT", "PDF_GENERATION_FAILED", "TASK_EXHAUSTED_RETRIES", "WEBHOOK_PROCESSING_FAILED", "AUTO_EXECUTE_FAILED", "SIGNER_AUTH_FAILED", "QUOTE_STUCK_IN_PREPARING_SIGNATURE_REQUEST_STATUS"], "type": "string"}, "errorContext": {"additionalProperties": {}, "type": "object"}, "id": {"type": "string"}, "recoveryAction": {"enum": ["REPUBLISH", "REGENERATE_PDF", "MANUAL_EXECUTE", "RESEND_SIGNING_EMAIL", "RETRY_SIGNATURE_REQUEST", "CONTACT_SUPPORT"], "type": "string"}}, "required": ["createdAt", "errorCode", "errorContext", "id", "recoveryAction"], "type": "object"}, "type": "array"}, "amendment": {"anyOf": [{"additionalProperties": false, "properties": {"adjustmentTotal": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "amended": {"anyOf": [{"properties": {"phases": {"items": {"properties": {"discounts": {"items": {"properties": {"amount": {"type": "string"}, "discountCalculationType": {"enum": ["PERCENTAGE", "NOMINAL"], "type": "string"}, "message": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}, "seatDiscountType": {"anyOf": [{"enum": ["INCLUDED_SEATS_ONLY", "OVERAGE_SEATS_ONLY", "ALL_SEATS"], "type": "string"}, {"type": "null"}]}}, "required": ["amount", "discountCalculationType", "message", "productIds"], "type": "object"}, "type": "array"}, "endDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minimums": {"items": {"properties": {"amount": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}}, "required": ["amount", "productIds"], "type": "object"}, "type": "array"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "prices": {"items": {"properties": {"billingFrequency": {"enum": ["ON_DEMAND", "ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY", "PER_EVENT"], "type": "string"}, "billingType": {"enum": ["IN_ARREARS", "IN_ADVANCE"], "type": "string"}, "customMetricParameters": {"items": {"properties": {"parameterId": {"type": "string"}, "value": {"type": "string"}}, "required": ["parameterId", "value"], "type": "object"}, "type": "array"}, "name": {"type": "string"}, "productId": {"type": "string"}, "structure": {"discriminator": {"propertyName": "pricingType"}, "oneOf": [{"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["ONE_TIME"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["FIXED"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"isPricePercentage": {"type": "boolean"}, "pricePerUnit": {"type": "string"}, "pricingType": {"enum": ["LINEAR"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["isPricePercentage", "pricePerUnit", "pricingType", "usageMetricId"], "type": "object"}, {"properties": {"contractedMinimumSeats": {"type": "integer"}, "overagesBillingFrequency": {"anyOf": [{"enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, {"type": "null"}]}, "pricePerSeat": {"type": "string"}, "pricingType": {"enum": ["SEAT_BASED"], "type": "string"}, "prorateFlatFees": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, "prorationStrategy": {"enum": ["USE_MAXIMUM", "PRORATE_INCREMENTS", "PRORATE_ALL_CHANGES"], "type": "string"}, "seatMetricId": {"type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["price"], "type": "object"}, "type": "array"}}, "required": ["contractedMinimumSeats", "pricePerSeat", "pricingType", "prorationStrategy", "seatMetricId", "tiers"], "type": "object"}, {"properties": {"pricingType": {"enum": ["GRADUATED"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageCalculationMode": {"enum": ["BILLING_PERIOD", "CUMULATIVE", "PERIODIC"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageCalculationMode", "usageMetricId"], "type": "object"}, {"properties": {"pricingType": {"enum": ["VOLUME"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "maxPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageMetricId"], "type": "object"}, {"properties": {"packageSize": {"type": "string"}, "pricePerPackage": {"type": "string"}, "pricingType": {"enum": ["PACKAGE"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["packageSize", "pricePerPackage", "pricingType", "usageMetricId"], "type": "object"}], "required": ["pricingType"]}, "usageCalculationPeriod": {"anyOf": [{"properties": {"frequency": {"enum": ["MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, "interval": {"format": "int32", "type": "integer"}}, "required": ["frequency", "interval"], "type": "object"}, {"type": "null"}]}}, "required": ["billingFrequency", "billingType", "customMetricParameters", "name", "productId", "structure"], "type": "object"}, "type": "array"}, "startDate": {"type": "string"}}, "required": ["discounts", "minimums", "prices", "startDate"], "type": "object"}, "type": "array"}}, "required": ["phases"], "type": "object"}, {"type": "null"}]}, "amendedContractValue": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "appliedFrom": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "contractId": {"type": "string"}, "effectiveFrom": {"type": "string"}, "executableUntil": {"type": "string"}, "original": {"anyOf": [{"properties": {"phases": {"items": {"properties": {"discounts": {"items": {"properties": {"amount": {"type": "string"}, "discountCalculationType": {"enum": ["PERCENTAGE", "NOMINAL"], "type": "string"}, "message": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}, "seatDiscountType": {"anyOf": [{"enum": ["INCLUDED_SEATS_ONLY", "OVERAGE_SEATS_ONLY", "ALL_SEATS"], "type": "string"}, {"type": "null"}]}}, "required": ["amount", "discountCalculationType", "message", "productIds"], "type": "object"}, "type": "array"}, "endDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minimums": {"items": {"properties": {"amount": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}}, "required": ["amount", "productIds"], "type": "object"}, "type": "array"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "prices": {"items": {"properties": {"billingFrequency": {"enum": ["ON_DEMAND", "ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY", "PER_EVENT"], "type": "string"}, "billingType": {"enum": ["IN_ARREARS", "IN_ADVANCE"], "type": "string"}, "customMetricParameters": {"items": {"properties": {"parameterId": {"type": "string"}, "value": {"type": "string"}}, "required": ["parameterId", "value"], "type": "object"}, "type": "array"}, "name": {"type": "string"}, "productId": {"type": "string"}, "structure": {"discriminator": {"propertyName": "pricingType"}, "oneOf": [{"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["ONE_TIME"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["FIXED"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"isPricePercentage": {"type": "boolean"}, "pricePerUnit": {"type": "string"}, "pricingType": {"enum": ["LINEAR"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["isPricePercentage", "pricePerUnit", "pricingType", "usageMetricId"], "type": "object"}, {"properties": {"contractedMinimumSeats": {"type": "integer"}, "overagesBillingFrequency": {"anyOf": [{"enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, {"type": "null"}]}, "pricePerSeat": {"type": "string"}, "pricingType": {"enum": ["SEAT_BASED"], "type": "string"}, "prorateFlatFees": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, "prorationStrategy": {"enum": ["USE_MAXIMUM", "PRORATE_INCREMENTS", "PRORATE_ALL_CHANGES"], "type": "string"}, "seatMetricId": {"type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["price"], "type": "object"}, "type": "array"}}, "required": ["contractedMinimumSeats", "pricePerSeat", "pricingType", "prorationStrategy", "seatMetricId", "tiers"], "type": "object"}, {"properties": {"pricingType": {"enum": ["GRADUATED"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageCalculationMode": {"enum": ["BILLING_PERIOD", "CUMULATIVE", "PERIODIC"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageCalculationMode", "usageMetricId"], "type": "object"}, {"properties": {"pricingType": {"enum": ["VOLUME"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "maxPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageMetricId"], "type": "object"}, {"properties": {"packageSize": {"type": "string"}, "pricePerPackage": {"type": "string"}, "pricingType": {"enum": ["PACKAGE"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["packageSize", "pricePerPackage", "pricingType", "usageMetricId"], "type": "object"}], "required": ["pricingType"]}, "usageCalculationPeriod": {"anyOf": [{"properties": {"frequency": {"enum": ["MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, "interval": {"format": "int32", "type": "integer"}}, "required": ["frequency", "interval"], "type": "object"}, {"type": "null"}]}}, "required": ["billingFrequency", "billingType", "customMetricParameters", "name", "productId", "structure"], "type": "object"}, "type": "array"}, "startDate": {"type": "string"}}, "required": ["discounts", "minimums", "prices", "startDate"], "type": "object"}, "type": "array"}}, "required": ["phases"], "type": "object"}, {"type": "null"}]}, "originalContractValue": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "outForSignatureQuoteId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "supersededByQuoteId": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["contractId", "effectiveFrom", "executableUntil"], "type": "object"}, {"type": "null"}]}, "approvalWorkflowId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "archivedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "attachmentAssets": {"items": {"properties": {"createdAt": {"type": "string"}, "createdBy": {"type": "string"}, "createdByType": {"enum": ["SEQUENCE_USER", "API_CLIENT"], "type": "string"}, "fileName": {"type": "string"}, "fileSizeBytes": {"format": "int32", "type": "integer"}, "format": {"enum": ["JPEG", "JPG", "PNG", "PDF", "CSV", "TXT", "RTF", "MD", "XLS", "XLSX", "XLSM", "DOC", "DOCX", "ZIP", "ODT", "ODS"], "type": "string"}, "id": {"type": "string"}, "type": {"enum": ["IMAGE", "DOCUMENT", "BINARY"], "type": "string"}, "url": {"type": "string"}}, "required": ["createdAt", "createdBy", "createdByType", "fileName", "fileSizeBytes", "format", "id", "type", "url"], "type": "object"}, "type": "array"}, "ccContactIds": {"items": {"type": "string"}, "type": "array"}, "ccContacts": {"items": {"properties": {"contactId": {"type": "string"}, "email": {"type": "string"}, "name": {"type": "string"}, "notificationHistory": {"items": {"properties": {"notifiedAt": {"type": "string"}, "trigger": {"enum": ["PUBLISH", "READY_TO_SIGN", "SEND_REMINDERS", "NOTIFY_RECIPIENTS"], "type": "string"}}, "required": ["notifiedAt", "trigger"], "type": "object"}, "type": "array"}}, "required": ["contactId", "email", "name", "notificationHistory"], "type": "object"}, "type": "array"}, "contactIds": {"items": {"type": "string"}, "type": "array"}, "contacts": {"items": {"properties": {"contactId": {"type": "string"}, "email": {"type": "string"}, "name": {"type": "string"}, "notificationHistory": {"items": {"properties": {"notifiedAt": {"type": "string"}, "trigger": {"enum": ["PUBLISH", "READY_TO_SIGN", "SEND_REMINDERS", "NOTIFY_RECIPIENTS"], "type": "string"}}, "required": ["notifiedAt", "trigger"], "type": "object"}, "type": "array"}, "signedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["contactId", "email", "name", "notificationHistory"], "type": "object"}, "type": "array"}, "contractId": {"description": "Created contract ID after execution, or the target contract ID for an amendment; null when neither exists. Older idempotency replays may omit this field; GET returns the current reference.", "type": ["string", "null"]}, "counterSigners": {"items": {"properties": {"email": {"type": "string"}, "id": {"type": "string"}, "name": {"type": "string"}, "notificationHistory": {"items": {"properties": {"notifiedAt": {"type": "string"}, "trigger": {"enum": ["PUBLISH", "READY_TO_SIGN", "SEND_REMINDERS", "NOTIFY_RECIPIENTS"], "type": "string"}}, "required": ["notifiedAt", "trigger"], "type": "object"}, "type": "array"}, "signedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["email", "id", "name", "notificationHistory"], "type": "object"}, "type": "array"}, "createdAt": {"type": "string"}, "createdBy": {"type": "string"}, "createdFrom": {"anyOf": [{"properties": {"entityId": {"type": "string"}, "entityType": {"enum": ["BILLING_SCHEDULE", "BILLING_SCHEDULE_DISCOUNT", "BILLING_SCHEDULE_MINIMUM", "BILLING_SCHEDULE_PHASE", "BILLING_SCHEDULE_PRICE", "CONTACT", "CREDIT_NOTE", "CREDIT_NOTE_APPLICATION", "CUSTOMER", "FILE", "INVOICE", "LEDGER_ACCOUNT", "LIST_PRICE", "OVERPAYMENT", "PAYMENT", "PAYMENT_APPLICATION", "PRICE", "PRODUCT", "QUOTE", "QUOTE_DISCOUNT", "QUOTE_MINIMUM", "QUOTE_PHASE", "QUOTE_PRICE", "QUOTE_PRICE_TIER", "QUOTE_TEMPLATE_PRICE", "TAX_CATEGORY", "TAX_CODE"], "type": "string"}}, "required": ["entityId", "entityType"], "type": "object"}, {"type": "null"}]}, "currency": {"anyOf": [{"enum": ["AED", "ARS", "AUD", "BRL", "BGN", "CAD", "CHF", "CLP", "CNY", "COP", "CZK", "DKK", "EGP", "EUR", "GBP", "HKD", "ILS", "INR", "ISK", "JPY", "KRW", "MXN", "NOK", "NZD", "PLN", "SAR", "SEK", "SGD", "THB", "USD", "UYU", "ZAR", "CLF"], "type": "string"}, {"type": "null"}], "description": "Quote currency, including CLF (Unidad de Fomento)."}, "customerAddress": {"anyOf": [{"properties": {"country": {"enum": ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW"], "type": "string"}, "line1": {"type": "string"}, "line2": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "postcode": {"type": "string"}, "state": {"anyOf": [{"enum": ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AB", "BC", "MB", "NB", "NL", "NS", "NT", "NU", "ON", "PE", "QC", "SK", "YT"], "type": "string"}, {"type": "null"}]}, "town": {"type": "string"}}, "required": ["country", "line1", "postcode", "town"], "type": "object"}, {"type": "null"}]}, "customerId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "customerLegalName": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "dealType": {"anyOf": [{"enum": ["NEW_BUSINESS", "RENEWAL", "AMENDMENT"], "type": "string"}, {"type": "null"}]}, "defaultDueDateDays": {"anyOf": [{"type": "integer"}, {"type": "null"}]}, "executedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "expiresAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "expiryDays": {"anyOf": [{"format": "int32", "type": "integer"}, {"type": "null"}]}, "id": {"type": "string"}, "integrationIds": {"items": {"properties": {"id": {"type": "string"}, "isPending": {"type": "boolean"}, "service": {"enum": ["Amazon_Redshift", "GoCardless", "Google_BigQuery", "Google_Sheets", "HubSpot", "NetSuite", "QuickBooks_Online", "Salesforce", "Slack", "Snowflake", "Stripe", "Xero", "Avalara", "Anrok", "Attio", "Numeral", "Rillet", "Sphere"], "type": "string"}}, "required": ["id", "isPending", "service"], "type": "object"}, "type": "array"}, "isExpired": {"type": "boolean"}, "isSignaturesEnabled": {"type": "boolean"}, "merchantBranding": {"properties": {"address": {"properties": {"country": {"enum": ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW"], "type": "string"}, "line1": {"type": "string"}, "line2": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "postcode": {"type": "string"}, "state": {"anyOf": [{"enum": ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AB", "BC", "MB", "NB", "NL", "NS", "NT", "NU", "ON", "PE", "QC", "SK", "YT"], "type": "string"}, {"type": "null"}]}, "town": {"type": "string"}}, "required": ["country", "line1", "postcode", "town"], "type": "object"}, "email": {"type": "string"}, "legalCompanyName": {"type": "string"}, "logoUrl": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "primaryColour": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "showUsageInCustomerPortal": {"type": "boolean"}, "supportEmail": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "supportUrl": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "url": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["address", "email", "legalCompanyName", "showUsageInCustomerPortal"], "type": "object"}, "pdfStatus": {"enum": ["NOT_YET_REQUESTED", "REQUESTED", "IN_PROGRESS", "FAILED", "GENERATED"], "type": "string"}, "phases": {"items": {"properties": {"createdAt": {"type": "string"}, "discounts": {"items": {"properties": {"amount": {"type": "string"}, "createdAt": {"type": "string"}, "discountCalculationType": {"enum": ["PERCENTAGE", "NOMINAL"], "type": "string"}, "id": {"type": "string"}, "message": {"type": "string"}, "restrictToPrices": {"items": {"type": "string"}, "type": "array"}, "seatDiscountType": {"anyOf": [{"enum": ["INCLUDED_SEATS_ONLY", "OVERAGE_SEATS_ONLY", "ALL_SEATS"], "type": "string"}, {"type": "null"}]}, "updatedAt": {"type": "string"}}, "required": ["amount", "createdAt", "discountCalculationType", "id", "message", "restrictToPrices", "updatedAt"], "type": "object"}, "type": "array"}, "duration": {"anyOf": [{"properties": {"days": {"format": "int32", "type": "integer"}, "months": {"format": "int32", "type": "integer"}, "weeks": {"format": "int32", "type": "integer"}, "years": {"format": "int32", "type": "integer"}}, "required": ["days", "months", "weeks", "years"], "type": "object"}, {"type": "null"}]}, "id": {"type": "string"}, "minimums": {"items": {"properties": {"amount": {"type": "string"}, "createdAt": {"type": "string"}, "id": {"type": "string"}, "restrictToPrices": {"items": {"type": "string"}, "type": "array"}, "updatedAt": {"type": "string"}}, "required": ["amount", "createdAt", "id", "restrictToPrices", "updatedAt"], "type": "object"}, "type": "array"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "prices": {"items": {"properties": {"billingFrequency": {"enum": ["ON_DEMAND", "ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY", "PER_EVENT"], "type": "string"}, "billingType": {"enum": ["IN_ARREARS", "IN_ADVANCE"], "type": "string"}, "createdAt": {"type": "string"}, "customMetricParameters": {"items": {"properties": {"parameterId": {"type": "string"}, "value": {"type": "string"}}, "required": ["parameterId", "value"], "type": "object"}, "type": "array"}, "id": {"type": "string"}, "integrationIds": {"items": {"properties": {"id": {"type": "string"}, "isPending": {"type": "boolean"}, "service": {"enum": ["Amazon_Redshift", "GoCardless", "Google_BigQuery", "Google_Sheets", "HubSpot", "NetSuite", "QuickBooks_Online", "Salesforce", "Slack", "Snowflake", "Stripe", "Xero", "Avalara", "Anrok", "Attio", "Numeral", "Rillet", "Sphere"], "type": "string"}}, "required": ["id", "isPending", "service"], "type": "object"}, "type": "array"}, "listPriceId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "name": {"type": "string"}, "productId": {"type": "string"}, "structure": {"discriminator": {"propertyName": "pricingType"}, "oneOf": [{"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["ONE_TIME"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["FIXED"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"isPricePercentage": {"type": "boolean"}, "pricePerUnit": {"type": "string"}, "pricingType": {"enum": ["LINEAR"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["isPricePercentage", "pricePerUnit", "pricingType", "usageMetricId"], "type": "object"}, {"properties": {"contractedMinimumSeats": {"type": "integer"}, "overagesBillingFrequency": {"anyOf": [{"enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, {"type": "null"}]}, "pricePerSeat": {"type": "string"}, "pricingType": {"enum": ["SEAT_BASED"], "type": "string"}, "prorateFlatFees": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, "prorationStrategy": {"enum": ["USE_MAXIMUM", "PRORATE_INCREMENTS", "PRORATE_ALL_CHANGES"], "type": "string"}, "seatMetricId": {"type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["price"], "type": "object"}, "type": "array"}}, "required": ["contractedMinimumSeats", "pricePerSeat", "pricingType", "prorationStrategy", "seatMetricId", "tiers"], "type": "object"}, {"properties": {"pricingType": {"enum": ["GRADUATED"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageCalculationMode": {"enum": ["BILLING_PERIOD", "CUMULATIVE", "PERIODIC"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageCalculationMode", "usageMetricId"], "type": "object"}, {"properties": {"pricingType": {"enum": ["VOLUME"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "maxPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageMetricId"], "type": "object"}, {"properties": {"packageSize": {"type": "string"}, "pricePerPackage": {"type": "string"}, "pricingType": {"enum": ["PACKAGE"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["packageSize", "pricePerPackage", "pricingType", "usageMetricId"], "type": "object"}], "required": ["pricingType"]}, "updatedAt": {"type": "string"}}, "required": ["billingFrequency", "billingType", "createdAt", "customMetricParameters", "id", "integrationIds", "name", "productId", "structure", "updatedAt"], "type": "object"}, "type": "array"}}, "required": ["createdAt", "discounts", "id", "minimums", "prices"], "type": "object"}, "type": "array"}, "preliminaryBillingStartDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "preparingSignatureRequestAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "presentation": {"items": {}, "type": "array"}, "publishedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "purchaseOrderNumber": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "quoteNumber": {"type": "string"}, "readyToSignAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "salesforceOpportunityId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "signatureMode": {"anyOf": [{"enum": ["EMBEDDED", "NON_EMBEDDED"], "type": "string"}, {"type": "null"}]}, "status": {"enum": ["DRAFT", "PUBLISHED", "PREPARING_SIGNATURE_REQUEST", "READY_TO_SIGN", "ACCEPTED", "EXECUTED"], "type": "string"}, "title": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "updatedAt": {"type": "string"}}, "required": ["activeErrors", "attachmentAssets", "ccContactIds", "ccContacts", "contactIds", "contacts", "counterSigners", "createdAt", "createdBy", "id", "integrationIds", "isExpired", "isSignaturesEnabled", "merchantBranding", "pdfStatus", "phases", "presentation", "quoteNumber", "status", "updatedAt"], "type": "object"}}}, "description": "The updated quote.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["full_access"]}], "summary": "Archive a quote", "tags": ["Quotes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["full_access"]}}, "/api/v1/sandbox/quotes/{quote_id}/download": {"get": {"description": "Download the exact PDF from the latest published quote. Working draft edits do not change this document. The download does not record a view.\n\n**Required scope:** `full_read`", "operationId": "downloadQuotePdf", "parameters": [{"description": "The quote reference.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "quote_id", "required": true, "schema": {"description": "The quote reference.", "format": "uuid", "title": "Quote Id", "type": "string"}}, {"description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "in": "header", "name": "sequence-version", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "title": "Sequence-Version"}}], "responses": {"200": {"content": {"application/pdf": {"schema": {"format": "binary", "type": "string"}}}, "description": "The published quote PDF.", "headers": {"ETag": {"description": "SHA-256 checksum of the published PDF bytes.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`quote_not_published`, `quote_pdf_unavailable` or `quote_pdf_too_large`: the retained PDF cannot be served.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "503": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`quote_pdf_read_failed`: document storage is temporarily unavailable.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["full_read"]}], "summary": "Download a quote PDF", "tags": ["Quotes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["full_read"]}}, "/api/v1/sandbox/quotes/{quote_id}/execute": {"post": {"description": "Supports CREATE_NEW for accepted prepare-for-finance quotes using one pricing/invoice currency and no credit schedules. Creates a native DRAFT Contract for finance review; it does not activate billing. Omitted/null startDate preserves the accepted date; a different date requires a revised agreement (409). AMEND_EXISTING, ADD_TO_EXISTING, REPLACE_EXISTING, automatic activation, FX and credits return 409. Contracts commits before Quote acknowledgment. A recording failure returns 503: retry the identical request with its original key. Permanent source evidence prevents another contract after a crash or retry. Current authority is checked before every replay.\n\n**Required scope:** `full_access`", "operationId": "executeQuote", "parameters": [{"description": "Id of the quote.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "quote_id", "required": true, "schema": {"format": "uuid", "title": "Quote Id", "type": "string"}}, {"description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "in": "header", "name": "sequence-version", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "title": "Sequence-Version"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"additionalProperties": false, "properties": {"contractAction": {"discriminator": {"propertyName": "mode"}, "oneOf": [{"additionalProperties": false, "properties": {"contractId": {"type": "string"}, "mode": {"enum": ["ADD_TO_EXISTING"], "type": "string"}, "phaseRecurrencePreference": {"enum": ["CONTINUE_FROM_PREVIOUS_PHASE", "RESET"], "type": "string"}}, "required": ["contractId", "mode", "phaseRecurrencePreference"], "type": "object"}, {"properties": {"mode": {"enum": ["AMEND_EXISTING"], "type": "string"}, "phaseRecurrencePreference": {"anyOf": [{"enum": ["CONTINUE_FROM_PREVIOUS_PHASE", "RESET"], "type": "string"}, {"type": "null"}]}, "whenEffectiveDatePassed": {"anyOf": [{"enum": ["REFUSE", "TAKE_EFFECT_TODAY"], "type": "string"}, {"type": "null"}]}}, "required": ["mode"], "type": "object"}, {"properties": {"mode": {"enum": ["CREATE_NEW"], "type": "string"}, "startDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["mode"], "type": "object"}, {"additionalProperties": false, "properties": {"contractId": {"type": "string"}, "mode": {"enum": ["REPLACE_EXISTING"], "type": "string"}}, "required": ["contractId", "mode"], "type": "object"}]}}, "required": ["contractAction"], "type": "object"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"properties": {"acceptedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "amendment": {"anyOf": [{"additionalProperties": false, "properties": {"adjustmentTotal": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "amended": {"anyOf": [{"properties": {"phases": {"items": {"properties": {"discounts": {"items": {"properties": {"amount": {"type": "string"}, "discountCalculationType": {"enum": ["PERCENTAGE", "NOMINAL"], "type": "string"}, "message": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}, "seatDiscountType": {"anyOf": [{"enum": ["INCLUDED_SEATS_ONLY", "OVERAGE_SEATS_ONLY", "ALL_SEATS"], "type": "string"}, {"type": "null"}]}}, "required": ["amount", "discountCalculationType", "message", "productIds"], "type": "object"}, "type": "array"}, "endDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minimums": {"items": {"properties": {"amount": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}}, "required": ["amount", "productIds"], "type": "object"}, "type": "array"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "prices": {"items": {"properties": {"billingFrequency": {"enum": ["ON_DEMAND", "ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY", "PER_EVENT"], "type": "string"}, "billingType": {"enum": ["IN_ARREARS", "IN_ADVANCE"], "type": "string"}, "customMetricParameters": {"items": {"properties": {"parameterId": {"type": "string"}, "value": {"type": "string"}}, "required": ["parameterId", "value"], "type": "object"}, "type": "array"}, "name": {"type": "string"}, "productId": {"type": "string"}, "structure": {"discriminator": {"propertyName": "pricingType"}, "oneOf": [{"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["ONE_TIME"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["FIXED"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"isPricePercentage": {"type": "boolean"}, "pricePerUnit": {"type": "string"}, "pricingType": {"enum": ["LINEAR"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["isPricePercentage", "pricePerUnit", "pricingType", "usageMetricId"], "type": "object"}, {"properties": {"contractedMinimumSeats": {"type": "integer"}, "overagesBillingFrequency": {"anyOf": [{"enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, {"type": "null"}]}, "pricePerSeat": {"type": "string"}, "pricingType": {"enum": ["SEAT_BASED"], "type": "string"}, "prorateFlatFees": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, "prorationStrategy": {"enum": ["USE_MAXIMUM", "PRORATE_INCREMENTS", "PRORATE_ALL_CHANGES"], "type": "string"}, "seatMetricId": {"type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["price"], "type": "object"}, "type": "array"}}, "required": ["contractedMinimumSeats", "pricePerSeat", "pricingType", "prorationStrategy", "seatMetricId", "tiers"], "type": "object"}, {"properties": {"pricingType": {"enum": ["GRADUATED"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageCalculationMode": {"enum": ["BILLING_PERIOD", "CUMULATIVE", "PERIODIC"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageCalculationMode", "usageMetricId"], "type": "object"}, {"properties": {"pricingType": {"enum": ["VOLUME"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "maxPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageMetricId"], "type": "object"}, {"properties": {"packageSize": {"type": "string"}, "pricePerPackage": {"type": "string"}, "pricingType": {"enum": ["PACKAGE"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["packageSize", "pricePerPackage", "pricingType", "usageMetricId"], "type": "object"}], "required": ["pricingType"]}, "usageCalculationPeriod": {"anyOf": [{"properties": {"frequency": {"enum": ["MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, "interval": {"format": "int32", "type": "integer"}}, "required": ["frequency", "interval"], "type": "object"}, {"type": "null"}]}}, "required": ["billingFrequency", "billingType", "customMetricParameters", "name", "productId", "structure"], "type": "object"}, "type": "array"}, "startDate": {"type": "string"}}, "required": ["discounts", "minimums", "prices", "startDate"], "type": "object"}, "type": "array"}}, "required": ["phases"], "type": "object"}, {"type": "null"}]}, "amendedContractValue": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "appliedFrom": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "contractId": {"type": "string"}, "effectiveFrom": {"type": "string"}, "executableUntil": {"type": "string"}, "original": {"anyOf": [{"properties": {"phases": {"items": {"properties": {"discounts": {"items": {"properties": {"amount": {"type": "string"}, "discountCalculationType": {"enum": ["PERCENTAGE", "NOMINAL"], "type": "string"}, "message": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}, "seatDiscountType": {"anyOf": [{"enum": ["INCLUDED_SEATS_ONLY", "OVERAGE_SEATS_ONLY", "ALL_SEATS"], "type": "string"}, {"type": "null"}]}}, "required": ["amount", "discountCalculationType", "message", "productIds"], "type": "object"}, "type": "array"}, "endDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minimums": {"items": {"properties": {"amount": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}}, "required": ["amount", "productIds"], "type": "object"}, "type": "array"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "prices": {"items": {"properties": {"billingFrequency": {"enum": ["ON_DEMAND", "ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY", "PER_EVENT"], "type": "string"}, "billingType": {"enum": ["IN_ARREARS", "IN_ADVANCE"], "type": "string"}, "customMetricParameters": {"items": {"properties": {"parameterId": {"type": "string"}, "value": {"type": "string"}}, "required": ["parameterId", "value"], "type": "object"}, "type": "array"}, "name": {"type": "string"}, "productId": {"type": "string"}, "structure": {"discriminator": {"propertyName": "pricingType"}, "oneOf": [{"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["ONE_TIME"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["FIXED"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"isPricePercentage": {"type": "boolean"}, "pricePerUnit": {"type": "string"}, "pricingType": {"enum": ["LINEAR"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["isPricePercentage", "pricePerUnit", "pricingType", "usageMetricId"], "type": "object"}, {"properties": {"contractedMinimumSeats": {"type": "integer"}, "overagesBillingFrequency": {"anyOf": [{"enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, {"type": "null"}]}, "pricePerSeat": {"type": "string"}, "pricingType": {"enum": ["SEAT_BASED"], "type": "string"}, "prorateFlatFees": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, "prorationStrategy": {"enum": ["USE_MAXIMUM", "PRORATE_INCREMENTS", "PRORATE_ALL_CHANGES"], "type": "string"}, "seatMetricId": {"type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["price"], "type": "object"}, "type": "array"}}, "required": ["contractedMinimumSeats", "pricePerSeat", "pricingType", "prorationStrategy", "seatMetricId", "tiers"], "type": "object"}, {"properties": {"pricingType": {"enum": ["GRADUATED"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageCalculationMode": {"enum": ["BILLING_PERIOD", "CUMULATIVE", "PERIODIC"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageCalculationMode", "usageMetricId"], "type": "object"}, {"properties": {"pricingType": {"enum": ["VOLUME"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "maxPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageMetricId"], "type": "object"}, {"properties": {"packageSize": {"type": "string"}, "pricePerPackage": {"type": "string"}, "pricingType": {"enum": ["PACKAGE"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["packageSize", "pricePerPackage", "pricingType", "usageMetricId"], "type": "object"}], "required": ["pricingType"]}, "usageCalculationPeriod": {"anyOf": [{"properties": {"frequency": {"enum": ["MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, "interval": {"format": "int32", "type": "integer"}}, "required": ["frequency", "interval"], "type": "object"}, {"type": "null"}]}}, "required": ["billingFrequency", "billingType", "customMetricParameters", "name", "productId", "structure"], "type": "object"}, "type": "array"}, "startDate": {"type": "string"}}, "required": ["discounts", "minimums", "prices", "startDate"], "type": "object"}, "type": "array"}}, "required": ["phases"], "type": "object"}, {"type": "null"}]}, "originalContractValue": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "outForSignatureQuoteId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "supersededByQuoteId": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["contractId", "effectiveFrom", "executableUntil"], "type": "object"}, {"type": "null"}]}, "archivedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "attachmentAssets": {"items": {"properties": {"createdAt": {"type": "string"}, "createdBy": {"type": "string"}, "createdByType": {"enum": ["SEQUENCE_USER", "API_CLIENT"], "type": "string"}, "fileName": {"type": "string"}, "fileSizeBytes": {"format": "int32", "type": "integer"}, "format": {"enum": ["JPEG", "JPG", "PNG", "PDF", "CSV", "TXT", "RTF", "MD", "XLS", "XLSX", "XLSM", "DOC", "DOCX", "ZIP", "ODT", "ODS"], "type": "string"}, "id": {"type": "string"}, "type": {"enum": ["IMAGE", "DOCUMENT", "BINARY"], "type": "string"}, "url": {"type": "string"}}, "required": ["createdAt", "createdBy", "createdByType", "fileName", "fileSizeBytes", "format", "id", "type", "url"], "type": "object"}, "type": "array"}, "ccContacts": {"items": {"properties": {"contactId": {"type": "string"}, "email": {"type": "string"}, "name": {"type": "string"}, "notificationHistory": {"items": {"properties": {"notifiedAt": {"type": "string"}, "trigger": {"enum": ["PUBLISH", "READY_TO_SIGN", "SEND_REMINDERS", "NOTIFY_RECIPIENTS"], "type": "string"}}, "required": ["notifiedAt", "trigger"], "type": "object"}, "type": "array"}}, "required": ["contactId", "email", "name", "notificationHistory"], "type": "object"}, "type": "array"}, "contacts": {"items": {"properties": {"contactId": {"type": "string"}, "email": {"type": "string"}, "name": {"type": "string"}, "notificationHistory": {"items": {"properties": {"notifiedAt": {"type": "string"}, "trigger": {"enum": ["PUBLISH", "READY_TO_SIGN", "SEND_REMINDERS", "NOTIFY_RECIPIENTS"], "type": "string"}}, "required": ["notifiedAt", "trigger"], "type": "object"}, "type": "array"}, "signedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["contactId", "email", "name", "notificationHistory"], "type": "object"}, "type": "array"}, "contractId": {"description": "Created contract ID after execution, or the target contract ID for an amendment; null when neither exists. Older idempotency replays may omit this field; GET returns the current reference.", "type": ["string", "null"]}, "counterSigners": {"items": {"properties": {"email": {"type": "string"}, "id": {"type": "string"}, "name": {"type": "string"}, "notificationHistory": {"items": {"properties": {"notifiedAt": {"type": "string"}, "trigger": {"enum": ["PUBLISH", "READY_TO_SIGN", "SEND_REMINDERS", "NOTIFY_RECIPIENTS"], "type": "string"}}, "required": ["notifiedAt", "trigger"], "type": "object"}, "type": "array"}, "signedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["email", "id", "name", "notificationHistory"], "type": "object"}, "type": "array"}, "createdAt": {"type": "string"}, "createdBy": {"type": "string"}, "createdFrom": {"anyOf": [{"properties": {"entityId": {"type": "string"}, "entityType": {"enum": ["BILLING_SCHEDULE", "BILLING_SCHEDULE_DISCOUNT", "BILLING_SCHEDULE_MINIMUM", "BILLING_SCHEDULE_PHASE", "BILLING_SCHEDULE_PRICE", "CONTACT", "CREDIT_NOTE", "CREDIT_NOTE_APPLICATION", "CUSTOMER", "FILE", "INVOICE", "LEDGER_ACCOUNT", "LIST_PRICE", "OVERPAYMENT", "PAYMENT", "PAYMENT_APPLICATION", "PRICE", "PRODUCT", "QUOTE", "QUOTE_DISCOUNT", "QUOTE_MINIMUM", "QUOTE_PHASE", "QUOTE_PRICE", "QUOTE_PRICE_TIER", "QUOTE_TEMPLATE_PRICE", "TAX_CATEGORY", "TAX_CODE"], "type": "string"}}, "required": ["entityId", "entityType"], "type": "object"}, {"type": "null"}]}, "currency": {"description": "Quote currency, including CLF (Unidad de Fomento).", "enum": ["AED", "ARS", "AUD", "BRL", "BGN", "CAD", "CHF", "CLP", "CNY", "COP", "CZK", "DKK", "EGP", "EUR", "GBP", "HKD", "ILS", "INR", "ISK", "JPY", "KRW", "MXN", "NOK", "NZD", "PLN", "SAR", "SEK", "SGD", "THB", "USD", "UYU", "ZAR", "CLF"], "type": "string"}, "customerAddress": {"properties": {"country": {"enum": ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW"], "type": "string"}, "line1": {"type": "string"}, "line2": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "postcode": {"type": "string"}, "state": {"anyOf": [{"enum": ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AB", "BC", "MB", "NB", "NL", "NS", "NT", "NU", "ON", "PE", "QC", "SK", "YT"], "type": "string"}, {"type": "null"}]}, "town": {"type": "string"}}, "required": ["country", "line1", "postcode", "town"], "type": "object"}, "customerId": {"type": "string"}, "customerLegalName": {"type": "string"}, "dealType": {"enum": ["NEW_BUSINESS", "RENEWAL", "AMENDMENT"], "type": "string"}, "defaultDueDateDays": {"anyOf": [{"type": "integer"}, {"type": "null"}]}, "executedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "expiresAt": {"type": "string"}, "id": {"type": "string"}, "isExpired": {"type": "boolean"}, "isSignaturesEnabled": {"type": "boolean"}, "merchantBranding": {"properties": {"address": {"properties": {"country": {"enum": ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW"], "type": "string"}, "line1": {"type": "string"}, "line2": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "postcode": {"type": "string"}, "state": {"anyOf": [{"enum": ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AB", "BC", "MB", "NB", "NL", "NS", "NT", "NU", "ON", "PE", "QC", "SK", "YT"], "type": "string"}, {"type": "null"}]}, "town": {"type": "string"}}, "required": ["country", "line1", "postcode", "town"], "type": "object"}, "email": {"type": "string"}, "legalCompanyName": {"type": "string"}, "logoUrl": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "primaryColour": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "showUsageInCustomerPortal": {"type": "boolean"}, "supportEmail": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "supportUrl": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "url": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["address", "email", "legalCompanyName", "showUsageInCustomerPortal"], "type": "object"}, "pdfStatus": {"enum": ["NOT_YET_REQUESTED", "REQUESTED", "IN_PROGRESS", "FAILED", "GENERATED"], "type": "string"}, "phases": {"items": {"properties": {"createdAt": {"type": "string"}, "discounts": {"items": {"properties": {"amount": {"type": "string"}, "createdAt": {"type": "string"}, "discountCalculationType": {"enum": ["PERCENTAGE", "NOMINAL"], "type": "string"}, "id": {"type": "string"}, "message": {"type": "string"}, "restrictToPrices": {"items": {"type": "string"}, "type": "array"}, "seatDiscountType": {"anyOf": [{"enum": ["INCLUDED_SEATS_ONLY", "OVERAGE_SEATS_ONLY", "ALL_SEATS"], "type": "string"}, {"type": "null"}]}, "updatedAt": {"type": "string"}}, "required": ["amount", "createdAt", "discountCalculationType", "id", "message", "restrictToPrices", "updatedAt"], "type": "object"}, "type": "array"}, "duration": {"anyOf": [{"properties": {"days": {"format": "int32", "type": "integer"}, "months": {"format": "int32", "type": "integer"}, "weeks": {"format": "int32", "type": "integer"}, "years": {"format": "int32", "type": "integer"}}, "required": ["days", "months", "weeks", "years"], "type": "object"}, {"type": "null"}]}, "id": {"type": "string"}, "minimums": {"items": {"properties": {"amount": {"type": "string"}, "createdAt": {"type": "string"}, "id": {"type": "string"}, "restrictToPrices": {"items": {"type": "string"}, "type": "array"}, "updatedAt": {"type": "string"}}, "required": ["amount", "createdAt", "id", "restrictToPrices", "updatedAt"], "type": "object"}, "type": "array"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "prices": {"items": {"properties": {"billingFrequency": {"enum": ["ON_DEMAND", "ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY", "PER_EVENT"], "type": "string"}, "billingType": {"enum": ["IN_ARREARS", "IN_ADVANCE"], "type": "string"}, "createdAt": {"type": "string"}, "customMetricParameters": {"items": {"properties": {"parameterId": {"type": "string"}, "value": {"type": "string"}}, "required": ["parameterId", "value"], "type": "object"}, "type": "array"}, "id": {"type": "string"}, "integrationIds": {"items": {"properties": {"id": {"type": "string"}, "isPending": {"type": "boolean"}, "service": {"enum": ["Amazon_Redshift", "GoCardless", "Google_BigQuery", "Google_Sheets", "HubSpot", "NetSuite", "QuickBooks_Online", "Salesforce", "Slack", "Snowflake", "Stripe", "Xero", "Avalara", "Anrok", "Attio", "Numeral", "Rillet", "Sphere"], "type": "string"}}, "required": ["id", "isPending", "service"], "type": "object"}, "type": "array"}, "listPriceId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "name": {"type": "string"}, "productId": {"type": "string"}, "structure": {"discriminator": {"propertyName": "pricingType"}, "oneOf": [{"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["ONE_TIME"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["FIXED"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"isPricePercentage": {"type": "boolean"}, "pricePerUnit": {"type": "string"}, "pricingType": {"enum": ["LINEAR"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["isPricePercentage", "pricePerUnit", "pricingType", "usageMetricId"], "type": "object"}, {"properties": {"contractedMinimumSeats": {"type": "integer"}, "overagesBillingFrequency": {"anyOf": [{"enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, {"type": "null"}]}, "pricePerSeat": {"type": "string"}, "pricingType": {"enum": ["SEAT_BASED"], "type": "string"}, "prorateFlatFees": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, "prorationStrategy": {"enum": ["USE_MAXIMUM", "PRORATE_INCREMENTS", "PRORATE_ALL_CHANGES"], "type": "string"}, "seatMetricId": {"type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["price"], "type": "object"}, "type": "array"}}, "required": ["contractedMinimumSeats", "pricePerSeat", "pricingType", "prorationStrategy", "seatMetricId", "tiers"], "type": "object"}, {"properties": {"pricingType": {"enum": ["GRADUATED"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageCalculationMode": {"enum": ["BILLING_PERIOD", "CUMULATIVE", "PERIODIC"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageCalculationMode", "usageMetricId"], "type": "object"}, {"properties": {"pricingType": {"enum": ["VOLUME"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "maxPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageMetricId"], "type": "object"}, {"properties": {"packageSize": {"type": "string"}, "pricePerPackage": {"type": "string"}, "pricingType": {"enum": ["PACKAGE"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["packageSize", "pricePerPackage", "pricingType", "usageMetricId"], "type": "object"}], "required": ["pricingType"]}, "updatedAt": {"type": "string"}}, "required": ["billingFrequency", "billingType", "createdAt", "customMetricParameters", "id", "integrationIds", "name", "productId", "structure", "updatedAt"], "type": "object"}, "type": "array"}}, "required": ["createdAt", "discounts", "id", "minimums", "prices"], "type": "object"}, "type": "array"}, "preliminaryBillingStartDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "preparingSignatureRequestAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "publishedAt": {"type": "string"}, "purchaseOrderNumber": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "quoteNumber": {"type": "string"}, "readyToSignAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "salesforceOpportunityId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "signatureMode": {"anyOf": [{"enum": ["EMBEDDED", "NON_EMBEDDED"], "type": "string"}, {"type": "null"}]}, "status": {"enum": ["DRAFT", "PUBLISHED", "PREPARING_SIGNATURE_REQUEST", "READY_TO_SIGN", "ACCEPTED", "EXECUTED"], "type": "string"}, "title": {"type": "string"}, "updatedAt": {"type": "string"}}, "required": ["attachmentAssets", "ccContacts", "contacts", "counterSigners", "createdAt", "createdBy", "currency", "customerAddress", "customerId", "customerLegalName", "dealType", "expiresAt", "id", "isExpired", "isSignaturesEnabled", "merchantBranding", "pdfStatus", "phases", "publishedAt", "quoteNumber", "status", "title", "updatedAt"], "type": "object"}}}, "description": "The updated quote.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["full_access"]}], "summary": "Create a contract from an accepted quote", "tags": ["Quotes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["full_access"]}}, "/api/v1/sandbox/quotes/{quote_id}/notify-recipients": {"post": {"description": "Queue an email with the exact published PDF and frozen attachments, for external-acceptance quotes only. Requires a live organization and verified email sender. Signing-link flows return 409. All selected addresses are visible together in To; select one address per request for separate envelopes. Already accepted signers are skipped. Pending changes, archived/expired offers and pending delivery are refused. Maximum 50 recipients, 10000 message characters, 10 files and 20 MiB combined attachments. The acknowledgment means queued, not delivered. Enqueued content is immutable and is not recalled by later quote edits. The Quote version is unchanged. Repeated notifications share a 60-second contact cooldown.\n\n**Required scope:** `full_access`", "operationId": "notifyQuoteRecipients", "parameters": [{"description": "Id of the quote.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "quote_id", "required": true, "schema": {"format": "uuid", "title": "Quote Id", "type": "string"}}, {"description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "in": "header", "name": "sequence-version", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "title": "Sequence-Version"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"properties": {"emailMessage": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "recipients": {"items": {"type": "string"}, "type": "array"}}, "required": ["recipients"], "type": "object"}}}, "required": true}, "responses": {"202": {"description": "Accepted for asynchronous processing. The body is the quote.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["full_access"]}], "summary": "Notify quote recipients", "tags": ["Quotes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["full_access"]}}, "/api/v1/sandbox/quotes/{quote_id}/publish": {"post": {"description": "Publish an immutable PDF under the current organization publication policy. Supports external acceptance, explicit offer validity and policies requiring no review. Signing and approval continuation return 409 while unavailable. PDF storage, publication and requested email queuing recover with the original idempotency key.\n\n**Required scope:** `full_access`", "operationId": "publishQuote", "parameters": [{"description": "Id of the quote.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "quote_id", "required": true, "schema": {"format": "uuid", "title": "Quote Id", "type": "string"}}, {"description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "in": "header", "name": "sequence-version", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "title": "Sequence-Version"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"properties": {"emailMessage": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "makeReadyToSign": {"type": "boolean"}, "messageForApprover": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "sendRecipientsEmail": {"type": "boolean"}}, "required": ["makeReadyToSign", "sendRecipientsEmail"], "type": "object"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"properties": {"outcome": {"enum": ["PUBLISHED", "APPROVAL_REQUESTED"], "type": "string"}}, "required": ["outcome"], "type": "object"}}}, "description": "The updated quote.", "headers": {"ETag": {"description": "The resource's current version; send it back as `If-Match`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["full_access"]}], "summary": "Publish a quote", "tags": ["Quotes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["full_access"]}}, "/api/v1/sandbox/quotes/{quote_id}/published": {"get": {"description": "**Required scope:** `full_read`", "operationId": "getPublishedQuote", "parameters": [{"description": "Id of the quote.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "quote_id", "required": true, "schema": {"format": "uuid", "title": "Quote Id", "type": "string"}}, {"description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "in": "header", "name": "sequence-version", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Select 2024-07-30, or omit to use the latest captured quote contract.", "title": "Sequence-Version"}}], "responses": {"200": {"content": {"application/json": {"schema": {"properties": {"acceptedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "amendment": {"anyOf": [{"additionalProperties": false, "properties": {"adjustmentTotal": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "amended": {"anyOf": [{"properties": {"phases": {"items": {"properties": {"discounts": {"items": {"properties": {"amount": {"type": "string"}, "discountCalculationType": {"enum": ["PERCENTAGE", "NOMINAL"], "type": "string"}, "message": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}, "seatDiscountType": {"anyOf": [{"enum": ["INCLUDED_SEATS_ONLY", "OVERAGE_SEATS_ONLY", "ALL_SEATS"], "type": "string"}, {"type": "null"}]}}, "required": ["amount", "discountCalculationType", "message", "productIds"], "type": "object"}, "type": "array"}, "endDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minimums": {"items": {"properties": {"amount": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}}, "required": ["amount", "productIds"], "type": "object"}, "type": "array"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "prices": {"items": {"properties": {"billingFrequency": {"enum": ["ON_DEMAND", "ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY", "PER_EVENT"], "type": "string"}, "billingType": {"enum": ["IN_ARREARS", "IN_ADVANCE"], "type": "string"}, "customMetricParameters": {"items": {"properties": {"parameterId": {"type": "string"}, "value": {"type": "string"}}, "required": ["parameterId", "value"], "type": "object"}, "type": "array"}, "name": {"type": "string"}, "productId": {"type": "string"}, "structure": {"discriminator": {"propertyName": "pricingType"}, "oneOf": [{"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["ONE_TIME"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["FIXED"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"isPricePercentage": {"type": "boolean"}, "pricePerUnit": {"type": "string"}, "pricingType": {"enum": ["LINEAR"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["isPricePercentage", "pricePerUnit", "pricingType", "usageMetricId"], "type": "object"}, {"properties": {"contractedMinimumSeats": {"type": "integer"}, "overagesBillingFrequency": {"anyOf": [{"enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, {"type": "null"}]}, "pricePerSeat": {"type": "string"}, "pricingType": {"enum": ["SEAT_BASED"], "type": "string"}, "prorateFlatFees": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, "prorationStrategy": {"enum": ["USE_MAXIMUM", "PRORATE_INCREMENTS", "PRORATE_ALL_CHANGES"], "type": "string"}, "seatMetricId": {"type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["price"], "type": "object"}, "type": "array"}}, "required": ["contractedMinimumSeats", "pricePerSeat", "pricingType", "prorationStrategy", "seatMetricId", "tiers"], "type": "object"}, {"properties": {"pricingType": {"enum": ["GRADUATED"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageCalculationMode": {"enum": ["BILLING_PERIOD", "CUMULATIVE", "PERIODIC"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageCalculationMode", "usageMetricId"], "type": "object"}, {"properties": {"pricingType": {"enum": ["VOLUME"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "maxPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageMetricId"], "type": "object"}, {"properties": {"packageSize": {"type": "string"}, "pricePerPackage": {"type": "string"}, "pricingType": {"enum": ["PACKAGE"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["packageSize", "pricePerPackage", "pricingType", "usageMetricId"], "type": "object"}], "required": ["pricingType"]}, "usageCalculationPeriod": {"anyOf": [{"properties": {"frequency": {"enum": ["MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, "interval": {"format": "int32", "type": "integer"}}, "required": ["frequency", "interval"], "type": "object"}, {"type": "null"}]}}, "required": ["billingFrequency", "billingType", "customMetricParameters", "name", "productId", "structure"], "type": "object"}, "type": "array"}, "startDate": {"type": "string"}}, "required": ["discounts", "minimums", "prices", "startDate"], "type": "object"}, "type": "array"}}, "required": ["phases"], "type": "object"}, {"type": "null"}]}, "amendedContractValue": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "appliedFrom": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "contractId": {"type": "string"}, "effectiveFrom": {"type": "string"}, "executableUntil": {"type": "string"}, "original": {"anyOf": [{"properties": {"phases": {"items": {"properties": {"discounts": {"items": {"properties": {"amount": {"type": "string"}, "discountCalculationType": {"enum": ["PERCENTAGE", "NOMINAL"], "type": "string"}, "message": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}, "seatDiscountType": {"anyOf": [{"enum": ["INCLUDED_SEATS_ONLY", "OVERAGE_SEATS_ONLY", "ALL_SEATS"], "type": "string"}, {"type": "null"}]}}, "required": ["amount", "discountCalculationType", "message", "productIds"], "type": "object"}, "type": "array"}, "endDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minimums": {"items": {"properties": {"amount": {"type": "string"}, "productIds": {"items": {"type": "string"}, "type": "array"}}, "required": ["amount", "productIds"], "type": "object"}, "type": "array"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "prices": {"items": {"properties": {"billingFrequency": {"enum": ["ON_DEMAND", "ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY", "PER_EVENT"], "type": "string"}, "billingType": {"enum": ["IN_ARREARS", "IN_ADVANCE"], "type": "string"}, "customMetricParameters": {"items": {"properties": {"parameterId": {"type": "string"}, "value": {"type": "string"}}, "required": ["parameterId", "value"], "type": "object"}, "type": "array"}, "name": {"type": "string"}, "productId": {"type": "string"}, "structure": {"discriminator": {"propertyName": "pricingType"}, "oneOf": [{"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["ONE_TIME"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["FIXED"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"isPricePercentage": {"type": "boolean"}, "pricePerUnit": {"type": "string"}, "pricingType": {"enum": ["LINEAR"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["isPricePercentage", "pricePerUnit", "pricingType", "usageMetricId"], "type": "object"}, {"properties": {"contractedMinimumSeats": {"type": "integer"}, "overagesBillingFrequency": {"anyOf": [{"enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, {"type": "null"}]}, "pricePerSeat": {"type": "string"}, "pricingType": {"enum": ["SEAT_BASED"], "type": "string"}, "prorateFlatFees": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, "prorationStrategy": {"enum": ["USE_MAXIMUM", "PRORATE_INCREMENTS", "PRORATE_ALL_CHANGES"], "type": "string"}, "seatMetricId": {"type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["price"], "type": "object"}, "type": "array"}}, "required": ["contractedMinimumSeats", "pricePerSeat", "pricingType", "prorationStrategy", "seatMetricId", "tiers"], "type": "object"}, {"properties": {"pricingType": {"enum": ["GRADUATED"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageCalculationMode": {"enum": ["BILLING_PERIOD", "CUMULATIVE", "PERIODIC"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageCalculationMode", "usageMetricId"], "type": "object"}, {"properties": {"pricingType": {"enum": ["VOLUME"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "maxPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageMetricId"], "type": "object"}, {"properties": {"packageSize": {"type": "string"}, "pricePerPackage": {"type": "string"}, "pricingType": {"enum": ["PACKAGE"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["packageSize", "pricePerPackage", "pricingType", "usageMetricId"], "type": "object"}], "required": ["pricingType"]}, "usageCalculationPeriod": {"anyOf": [{"properties": {"frequency": {"enum": ["MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, "interval": {"format": "int32", "type": "integer"}}, "required": ["frequency", "interval"], "type": "object"}, {"type": "null"}]}}, "required": ["billingFrequency", "billingType", "customMetricParameters", "name", "productId", "structure"], "type": "object"}, "type": "array"}, "startDate": {"type": "string"}}, "required": ["discounts", "minimums", "prices", "startDate"], "type": "object"}, "type": "array"}}, "required": ["phases"], "type": "object"}, {"type": "null"}]}, "originalContractValue": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "outForSignatureQuoteId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "supersededByQuoteId": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["contractId", "effectiveFrom", "executableUntil"], "type": "object"}, {"type": "null"}]}, "archivedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "attachmentAssets": {"items": {"properties": {"createdAt": {"type": "string"}, "createdBy": {"type": "string"}, "createdByType": {"enum": ["SEQUENCE_USER", "API_CLIENT"], "type": "string"}, "fileName": {"type": "string"}, "fileSizeBytes": {"format": "int32", "type": "integer"}, "format": {"enum": ["JPEG", "JPG", "PNG", "PDF", "CSV", "TXT", "RTF", "MD", "XLS", "XLSX", "XLSM", "DOC", "DOCX", "ZIP", "ODT", "ODS"], "type": "string"}, "id": {"type": "string"}, "type": {"enum": ["IMAGE", "DOCUMENT", "BINARY"], "type": "string"}, "url": {"type": "string"}}, "required": ["createdAt", "createdBy", "createdByType", "fileName", "fileSizeBytes", "format", "id", "type", "url"], "type": "object"}, "type": "array"}, "ccContacts": {"items": {"properties": {"contactId": {"type": "string"}, "email": {"type": "string"}, "name": {"type": "string"}, "notificationHistory": {"items": {"properties": {"notifiedAt": {"type": "string"}, "trigger": {"enum": ["PUBLISH", "READY_TO_SIGN", "SEND_REMINDERS", "NOTIFY_RECIPIENTS"], "type": "string"}}, "required": ["notifiedAt", "trigger"], "type": "object"}, "type": "array"}}, "required": ["contactId", "email", "name", "notificationHistory"], "type": "object"}, "type": "array"}, "contacts": {"items": {"properties": {"contactId": {"type": "string"}, "email": {"type": "string"}, "name": {"type": "string"}, "notificationHistory": {"items": {"properties": {"notifiedAt": {"type": "string"}, "trigger": {"enum": ["PUBLISH", "READY_TO_SIGN", "SEND_REMINDERS", "NOTIFY_RECIPIENTS"], "type": "string"}}, "required": ["notifiedAt", "trigger"], "type": "object"}, "type": "array"}, "signedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["contactId", "email", "name", "notificationHistory"], "type": "object"}, "type": "array"}, "contractId": {"description": "Created contract ID after execution, or the target contract ID for an amendment; null when neither exists. Older idempotency replays may omit this field; GET returns the current reference.", "type": ["string", "null"]}, "counterSigners": {"items": {"properties": {"email": {"type": "string"}, "id": {"type": "string"}, "name": {"type": "string"}, "notificationHistory": {"items": {"properties": {"notifiedAt": {"type": "string"}, "trigger": {"enum": ["PUBLISH", "READY_TO_SIGN", "SEND_REMINDERS", "NOTIFY_RECIPIENTS"], "type": "string"}}, "required": ["notifiedAt", "trigger"], "type": "object"}, "type": "array"}, "signedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["email", "id", "name", "notificationHistory"], "type": "object"}, "type": "array"}, "createdAt": {"type": "string"}, "createdBy": {"type": "string"}, "createdFrom": {"anyOf": [{"properties": {"entityId": {"type": "string"}, "entityType": {"enum": ["BILLING_SCHEDULE", "BILLING_SCHEDULE_DISCOUNT", "BILLING_SCHEDULE_MINIMUM", "BILLING_SCHEDULE_PHASE", "BILLING_SCHEDULE_PRICE", "CONTACT", "CREDIT_NOTE", "CREDIT_NOTE_APPLICATION", "CUSTOMER", "FILE", "INVOICE", "LEDGER_ACCOUNT", "LIST_PRICE", "OVERPAYMENT", "PAYMENT", "PAYMENT_APPLICATION", "PRICE", "PRODUCT", "QUOTE", "QUOTE_DISCOUNT", "QUOTE_MINIMUM", "QUOTE_PHASE", "QUOTE_PRICE", "QUOTE_PRICE_TIER", "QUOTE_TEMPLATE_PRICE", "TAX_CATEGORY", "TAX_CODE"], "type": "string"}}, "required": ["entityId", "entityType"], "type": "object"}, {"type": "null"}]}, "currency": {"description": "Quote currency, including CLF (Unidad de Fomento).", "enum": ["AED", "ARS", "AUD", "BRL", "BGN", "CAD", "CHF", "CLP", "CNY", "COP", "CZK", "DKK", "EGP", "EUR", "GBP", "HKD", "ILS", "INR", "ISK", "JPY", "KRW", "MXN", "NOK", "NZD", "PLN", "SAR", "SEK", "SGD", "THB", "USD", "UYU", "ZAR", "CLF"], "type": "string"}, "customerAddress": {"properties": {"country": {"enum": ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW"], "type": "string"}, "line1": {"type": "string"}, "line2": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "postcode": {"type": "string"}, "state": {"anyOf": [{"enum": ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AB", "BC", "MB", "NB", "NL", "NS", "NT", "NU", "ON", "PE", "QC", "SK", "YT"], "type": "string"}, {"type": "null"}]}, "town": {"type": "string"}}, "required": ["country", "line1", "postcode", "town"], "type": "object"}, "customerId": {"type": "string"}, "customerLegalName": {"type": "string"}, "dealType": {"enum": ["NEW_BUSINESS", "RENEWAL", "AMENDMENT"], "type": "string"}, "defaultDueDateDays": {"anyOf": [{"type": "integer"}, {"type": "null"}]}, "executedAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "expiresAt": {"type": "string"}, "id": {"type": "string"}, "isExpired": {"type": "boolean"}, "isSignaturesEnabled": {"type": "boolean"}, "merchantBranding": {"properties": {"address": {"properties": {"country": {"enum": ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW"], "type": "string"}, "line1": {"type": "string"}, "line2": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "postcode": {"type": "string"}, "state": {"anyOf": [{"enum": ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AB", "BC", "MB", "NB", "NL", "NS", "NT", "NU", "ON", "PE", "QC", "SK", "YT"], "type": "string"}, {"type": "null"}]}, "town": {"type": "string"}}, "required": ["country", "line1", "postcode", "town"], "type": "object"}, "email": {"type": "string"}, "legalCompanyName": {"type": "string"}, "logoUrl": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "primaryColour": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "showUsageInCustomerPortal": {"type": "boolean"}, "supportEmail": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "supportUrl": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "url": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["address", "email", "legalCompanyName", "showUsageInCustomerPortal"], "type": "object"}, "pdfStatus": {"enum": ["NOT_YET_REQUESTED", "REQUESTED", "IN_PROGRESS", "FAILED", "GENERATED"], "type": "string"}, "phases": {"items": {"properties": {"createdAt": {"type": "string"}, "discounts": {"items": {"properties": {"amount": {"type": "string"}, "createdAt": {"type": "string"}, "discountCalculationType": {"enum": ["PERCENTAGE", "NOMINAL"], "type": "string"}, "id": {"type": "string"}, "message": {"type": "string"}, "restrictToPrices": {"items": {"type": "string"}, "type": "array"}, "seatDiscountType": {"anyOf": [{"enum": ["INCLUDED_SEATS_ONLY", "OVERAGE_SEATS_ONLY", "ALL_SEATS"], "type": "string"}, {"type": "null"}]}, "updatedAt": {"type": "string"}}, "required": ["amount", "createdAt", "discountCalculationType", "id", "message", "restrictToPrices", "updatedAt"], "type": "object"}, "type": "array"}, "duration": {"anyOf": [{"properties": {"days": {"format": "int32", "type": "integer"}, "months": {"format": "int32", "type": "integer"}, "weeks": {"format": "int32", "type": "integer"}, "years": {"format": "int32", "type": "integer"}}, "required": ["days", "months", "weeks", "years"], "type": "object"}, {"type": "null"}]}, "id": {"type": "string"}, "minimums": {"items": {"properties": {"amount": {"type": "string"}, "createdAt": {"type": "string"}, "id": {"type": "string"}, "restrictToPrices": {"items": {"type": "string"}, "type": "array"}, "updatedAt": {"type": "string"}}, "required": ["amount", "createdAt", "id", "restrictToPrices", "updatedAt"], "type": "object"}, "type": "array"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "prices": {"items": {"properties": {"billingFrequency": {"enum": ["ON_DEMAND", "ONE_TIME", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY", "PER_EVENT"], "type": "string"}, "billingType": {"enum": ["IN_ARREARS", "IN_ADVANCE"], "type": "string"}, "createdAt": {"type": "string"}, "customMetricParameters": {"items": {"properties": {"parameterId": {"type": "string"}, "value": {"type": "string"}}, "required": ["parameterId", "value"], "type": "object"}, "type": "array"}, "id": {"type": "string"}, "integrationIds": {"items": {"properties": {"id": {"type": "string"}, "isPending": {"type": "boolean"}, "service": {"enum": ["Amazon_Redshift", "GoCardless", "Google_BigQuery", "Google_Sheets", "HubSpot", "NetSuite", "QuickBooks_Online", "Salesforce", "Slack", "Snowflake", "Stripe", "Xero", "Avalara", "Anrok", "Attio", "Numeral", "Rillet", "Sphere"], "type": "string"}}, "required": ["id", "isPending", "service"], "type": "object"}, "type": "array"}, "listPriceId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "name": {"type": "string"}, "productId": {"type": "string"}, "structure": {"discriminator": {"propertyName": "pricingType"}, "oneOf": [{"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["ONE_TIME"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"price": {"type": "string"}, "pricingType": {"enum": ["FIXED"], "type": "string"}}, "required": ["price", "pricingType"], "type": "object"}, {"properties": {"isPricePercentage": {"type": "boolean"}, "pricePerUnit": {"type": "string"}, "pricingType": {"enum": ["LINEAR"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["isPricePercentage", "pricePerUnit", "pricingType", "usageMetricId"], "type": "object"}, {"properties": {"contractedMinimumSeats": {"type": "integer"}, "overagesBillingFrequency": {"anyOf": [{"enum": ["NONE", "MONTHLY", "QUARTERLY", "HALF_YEARLY", "YEARLY"], "type": "string"}, {"type": "null"}]}, "pricePerSeat": {"type": "string"}, "pricingType": {"enum": ["SEAT_BASED"], "type": "string"}, "prorateFlatFees": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, "prorationStrategy": {"enum": ["USE_MAXIMUM", "PRORATE_INCREMENTS", "PRORATE_ALL_CHANGES"], "type": "string"}, "seatMetricId": {"type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["price"], "type": "object"}, "type": "array"}}, "required": ["contractedMinimumSeats", "pricePerSeat", "pricingType", "prorationStrategy", "seatMetricId", "tiers"], "type": "object"}, {"properties": {"pricingType": {"enum": ["GRADUATED"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageCalculationMode": {"enum": ["BILLING_PERIOD", "CUMULATIVE", "PERIODIC"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageCalculationMode", "usageMetricId"], "type": "object"}, {"properties": {"pricingType": {"enum": ["VOLUME"], "type": "string"}, "tiers": {"items": {"properties": {"fee": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "isPricePercentage": {"type": "boolean"}, "maxPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "minPrice": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "price": {"type": "string"}, "upperBound": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, "required": ["isPricePercentage", "price"], "type": "object"}, "type": "array"}, "usageMetricId": {"type": "string"}}, "required": ["pricingType", "tiers", "usageMetricId"], "type": "object"}, {"properties": {"packageSize": {"type": "string"}, "pricePerPackage": {"type": "string"}, "pricingType": {"enum": ["PACKAGE"], "type": "string"}, "usageMetricId": {"type": "string"}}, "required": ["packageSize", "pricePerPackage", "pricingType", "usageMetricId"], "type": "object"}], "required": ["pricingType"]}, "updatedAt": {"type": "string"}}, "required": ["billingFrequency", "billingType", "createdAt", "customMetricParameters", "id", "integrationIds", "name", "productId", "structure", "updatedAt"], "type": "object"}, "type": "array"}}, "required": ["createdAt", "discounts", "id", "minimums", "prices"], "type": "object"}, "type": "array"}, "preliminaryBillingStartDate": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "preparingSignatureRequestAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "publishedAt": {"type": "string"}, "purchaseOrderNumber": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "quoteNumber": {"type": "string"}, "readyToSignAt": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "salesforceOpportunityId": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "signatureMode": {"anyOf": [{"enum": ["EMBEDDED", "NON_EMBEDDED"], "type": "string"}, {"type": "null"}]}, "status": {"enum": ["DRAFT", "PUBLISHED", "PREPARING_SIGNATURE_REQUEST", "READY_TO_SIGN", "ACCEPTED", "EXECUTED"], "type": "string"}, "title": {"type": "string"}, "updatedAt": {"type": "string"}}, "required": ["attachmentAssets", "ccContacts", "contacts", "counterSigners", "createdAt", "createdBy", "currency", "customerAddress", "customerId", "customerLegalName", "dealType", "expiresAt", "id", "isExpired", "isSignaturesEnabled", "merchantBranding", "pdfStatus", "phases", "publishedAt", "quoteNumber", "status", "title", "updatedAt"], "type": "object"}}}, "description": "The quote.", "headers": {"ETag": {"description": "Current quote version for If-Match on quote changes.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["full_read"]}], "summary": "Get a published quote", "tags": ["Quotes"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["full_read"]}}, "/api/v1/sandbox/reconciliation/unmatched-receipts": {"get": {"description": "List the money received in your bank accounts that is not yet matched to any invoice (*pagos sin identificar*), newest posting first (`posted_on` desc, then id desc). Only incoming movements count; a reversed movement, or one excluded as not customer money (a bank fee, an internal transfer), never appears. A receipt leaves this list once a reconciliation matches it. Pass `next_cursor` back as `cursor` with the same filters until it is null. Filters combine with AND.\n\n**Required scope:** `reconciliation:read`", "operationId": "listUnmatchedReceipts", "parameters": [{"description": "Only receipts in this ISO 4217 currency.", "in": "query", "name": "currency", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "Only receipts in this ISO 4217 currency.", "title": "Currency"}}, {"description": "Only receipts posted on or after this day (inclusive).", "example": "2026-01-31", "in": "query", "name": "posted_on_from", "required": false, "schema": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Only receipts posted on or after this day (inclusive).", "title": "Posted On From"}}, {"description": "Only receipts posted on or before this day (inclusive).", "example": "2026-01-31", "in": "query", "name": "posted_on_to", "required": false, "schema": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Only receipts posted on or before this day (inclusive).", "title": "Posted On To"}}, {"description": "Only receipts from this payer tax id. Punctuation and case are ignored, so `76.123.456-k` and `76123456K` match the same receipts.", "in": "query", "name": "counterparty_tax_id", "required": false, "schema": {"anyOf": [{"maxLength": 32, "type": "string"}, {"type": "null"}], "description": "Only receipts from this payer tax id. Punctuation and case are ignored, so `76.123.456-k` and `76123456K` match the same receipts.", "title": "Counterparty Tax Id"}}, {"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UnmatchedReceiptPage"}}}, "description": "One page of unmatched receipts.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "`posted_on_from` is after `posted_on_to` (`invalid_range`), a `counterparty_tax_id` with no letter or digit (`validation_failed` with `params.field` = `counterparty_tax_id`), or a schema violation (`validation_failed`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["reconciliation:read"]}], "summary": "List unmatched receipts", "tags": ["Reconciliation"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["reconciliation:read"]}}, "/api/v1/sandbox/reconciliation/unmatched-receipts/by-counterparty": {"get": {"description": "The unmatched receipts summed per payer tax id and currency, ordered by tax id then currency. Use it to see who sent money that no invoice explains yet. A receipt whose bank movement carries no tax id is in the list but in no summary here. Pass `next_cursor` back as `cursor` until it is null.\n\n**Required scope:** `reconciliation:read`", "operationId": "listUnmatchedReceiptsByCounterparty", "parameters": [{"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UnmatchedReceiptCounterpartyPage"}}}, "description": "One page of unmatched receipt counterparties.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "A schema violation (`validation_failed`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["reconciliation:read"]}], "summary": "List unmatched receipts by counterparty", "tags": ["Reconciliation"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["reconciliation:read"]}}, "/api/v1/sandbox/reconciliation/unmatched-receipts/totals": {"get": {"description": "How much unmatched money there is, per currency: the count and sum of every receipt the list returns. Amounts in different currencies are never added together.\n\n**Required scope:** `reconciliation:read`", "operationId": "getUnmatchedReceiptTotals", "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UnmatchedReceiptTotals"}}}, "description": "The unmatched receipt totals.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["reconciliation:read"]}], "summary": "Get unmatched receipt totals", "tags": ["Reconciliation"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["reconciliation:read"]}}, "/api/v1/sandbox/reports/active-contracts": {"get": {"description": "Contracts active at the end of `as_of`.\n\n**Required scope:** `reports:read`", "operationId": "getActiveContractsReport", "parameters": [{"description": "Calendar day of the snapshot, read at end of day.", "example": "2026-01-31", "in": "query", "name": "as_of", "required": true, "schema": {"description": "Calendar day of the snapshot, read at end of day.", "format": "date", "title": "As Of", "type": "string"}}, {"description": "Repeatable customer filter.", "in": "query", "name": "customer_id", "required": false, "schema": {"anyOf": [{"items": {"format": "uuid", "type": "string"}, "maxItems": 100, "type": "array"}, {"type": "null"}], "description": "Repeatable customer filter.", "title": "Customer Id"}}, {"description": "Only count documents billed in this ISO 4217 currency.", "in": "query", "name": "currency", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "Only count documents billed in this ISO 4217 currency.", "title": "Currency"}}, {"description": "IANA timezone that calendar days are evaluated in; an unknown zone is a 422.", "in": "query", "name": "timezone", "required": false, "schema": {"default": "UTC", "description": "IANA timezone that calendar days are evaluated in; an unknown zone is a 422.", "examples": ["America/Santiago"], "title": "Timezone", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CountSnapshotReport"}}}, "description": "The count snapshot report.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: a header, parameter or body value was rejected (`bad_request`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "A parameter is invalid (`validation_failed`): an unknown enum value or timezone, `date_from` after `date_to`, or a limit out of range.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "500": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The report could not be computed (`report_unavailable`). A server-side defect, not something the request can fix; retrying is safe.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["reports:read"]}], "summary": "Get active contract count", "tags": ["Reports"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["reports:read"]}}, "/api/v1/sandbox/reports/active-customers": {"get": {"description": "Customers with at least one active contract at the end of `as_of`.\n\n**Required scope:** `reports:read`", "operationId": "getActiveCustomersReport", "parameters": [{"description": "Calendar day of the snapshot, read at end of day.", "example": "2026-01-31", "in": "query", "name": "as_of", "required": true, "schema": {"description": "Calendar day of the snapshot, read at end of day.", "format": "date", "title": "As Of", "type": "string"}}, {"description": "Repeatable customer filter.", "in": "query", "name": "customer_id", "required": false, "schema": {"anyOf": [{"items": {"format": "uuid", "type": "string"}, "maxItems": 100, "type": "array"}, {"type": "null"}], "description": "Repeatable customer filter.", "title": "Customer Id"}}, {"description": "Only count documents billed in this ISO 4217 currency.", "in": "query", "name": "currency", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "Only count documents billed in this ISO 4217 currency.", "title": "Currency"}}, {"description": "IANA timezone that calendar days are evaluated in; an unknown zone is a 422.", "in": "query", "name": "timezone", "required": false, "schema": {"default": "UTC", "description": "IANA timezone that calendar days are evaluated in; an unknown zone is a 422.", "examples": ["America/Santiago"], "title": "Timezone", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CountSnapshotReport"}}}, "description": "The count snapshot report.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: a header, parameter or body value was rejected (`bad_request`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "A parameter is invalid (`validation_failed`): an unknown enum value or timezone, `date_from` after `date_to`, or a limit out of range.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "500": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The report could not be computed (`report_unavailable`). A server-side defect, not something the request can fix; retrying is safe.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["reports:read"]}], "summary": "Get active customer count", "tags": ["Reports"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["reports:read"]}}, "/api/v1/sandbox/reports/arr": {"get": {"description": "Annual recurring revenue (12 x MRR) from active contracts at the end of `as_of`.\n\n**Required scope:** `reports:read`", "operationId": "getArrReport", "parameters": [{"description": "Calendar day of the snapshot, read at end of day.", "example": "2026-01-31", "in": "query", "name": "as_of", "required": true, "schema": {"description": "Calendar day of the snapshot, read at end of day.", "format": "date", "title": "As Of", "type": "string"}}, {"description": "Convert the result into this ISO 4217 currency. Omit to report per billing currency.", "in": "query", "name": "reporting_currency", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "Convert the result into this ISO 4217 currency. Omit to report per billing currency.", "title": "Reporting Currency"}}, {"description": "Repeatable customer filter.", "in": "query", "name": "customer_id", "required": false, "schema": {"anyOf": [{"items": {"format": "uuid", "type": "string"}, "maxItems": 100, "type": "array"}, {"type": "null"}], "description": "Repeatable customer filter.", "title": "Customer Id"}}, {"description": "Only count documents billed in this ISO 4217 currency.", "in": "query", "name": "currency", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "Only count documents billed in this ISO 4217 currency.", "title": "Currency"}}, {"description": "IANA timezone that calendar days are evaluated in; an unknown zone is a 422.", "in": "query", "name": "timezone", "required": false, "schema": {"default": "UTC", "description": "IANA timezone that calendar days are evaluated in; an unknown zone is a 422.", "examples": ["America/Santiago"], "title": "Timezone", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/MoneySnapshotReport"}}}, "description": "The money snapshot report.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: a header, parameter or body value was rejected (`bad_request`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "A parameter is invalid (`validation_failed`): an unknown enum value or timezone, `date_from` after `date_to`, or a limit out of range.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "500": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The report could not be computed (`report_unavailable`). A server-side defect, not something the request can fix; retrying is safe.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["reports:read"]}], "summary": "Get annual recurring revenue", "tags": ["Reports"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["reports:read"]}}, "/api/v1/sandbox/reports/average-revenue": {"get": {"description": "Invoiced revenue in `date_from`..`date_to` (inclusive) divided per customer or per contract.\n\n**Required scope:** `reports:read`", "operationId": "getAverageRevenueReport", "parameters": [{"description": "First calendar day of the range (inclusive).", "example": "2026-01-31", "in": "query", "name": "date_from", "required": true, "schema": {"description": "First calendar day of the range (inclusive).", "format": "date", "title": "Date From", "type": "string"}}, {"description": "Last calendar day of the range (inclusive).", "example": "2026-01-31", "in": "query", "name": "date_to", "required": true, "schema": {"description": "Last calendar day of the range (inclusive).", "format": "date", "title": "Date To", "type": "string"}}, {"description": "Divide per customer or per contract.", "in": "query", "name": "unit", "required": true, "schema": {"$ref": "#/components/schemas/AverageRevenueUnit", "description": "Divide per customer or per contract."}}, {"description": "Restrict to one kind of price; `all` includes every kind.", "in": "query", "name": "price_type", "required": false, "schema": {"$ref": "#/components/schemas/ReportPriceType", "default": "all", "description": "Restrict to one kind of price; `all` includes every kind."}}, {"description": "Convert the result into this ISO 4217 currency. Omit to report per billing currency.", "in": "query", "name": "reporting_currency", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "Convert the result into this ISO 4217 currency. Omit to report per billing currency.", "title": "Reporting Currency"}}, {"description": "IANA timezone that calendar days are evaluated in; an unknown zone is a 422.", "in": "query", "name": "timezone", "required": false, "schema": {"default": "UTC", "description": "IANA timezone that calendar days are evaluated in; an unknown zone is a 422.", "examples": ["America/Santiago"], "title": "Timezone", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/AverageRevenueReport"}}}, "description": "The average revenue report.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: a header, parameter or body value was rejected (`bad_request`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "A parameter is invalid (`validation_failed`): an unknown enum value or timezone, `date_from` after `date_to`, or a limit out of range.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "500": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The report could not be computed (`report_unavailable`). A server-side defect, not something the request can fix; retrying is safe.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["reports:read"]}], "summary": "Get average invoiced revenue", "tags": ["Reports"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["reports:read"]}}, "/api/v1/sandbox/reports/invoice-count": {"get": {"description": "Number of issued, still-standing invoices issued in `date_from`..`date_to` (inclusive).\n\n**Required scope:** `reports:read`", "operationId": "getInvoiceCountReport", "parameters": [{"description": "First calendar day of the range (inclusive).", "example": "2026-01-31", "in": "query", "name": "date_from", "required": true, "schema": {"description": "First calendar day of the range (inclusive).", "format": "date", "title": "Date From", "type": "string"}}, {"description": "Last calendar day of the range (inclusive).", "example": "2026-01-31", "in": "query", "name": "date_to", "required": true, "schema": {"description": "Last calendar day of the range (inclusive).", "format": "date", "title": "Date To", "type": "string"}}, {"description": "IANA timezone that calendar days are evaluated in; an unknown zone is a 422.", "in": "query", "name": "timezone", "required": false, "schema": {"default": "UTC", "description": "IANA timezone that calendar days are evaluated in; an unknown zone is a 422.", "examples": ["America/Santiago"], "title": "Timezone", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CountRangeReport"}}}, "description": "The count range report.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: a header, parameter or body value was rejected (`bad_request`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "A parameter is invalid (`validation_failed`): an unknown enum value or timezone, `date_from` after `date_to`, or a limit out of range.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "500": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The report could not be computed (`report_unavailable`). A server-side defect, not something the request can fix; retrying is safe.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["reports:read"]}], "summary": "Get invoice count", "tags": ["Reports"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["reports:read"]}}, "/api/v1/sandbox/reports/invoiced-revenue": {"get": {"description": "Net revenue on issued, still-standing invoices whose issue date falls in `date_from`..`date_to` (inclusive), net of credit and debit notes.\n\n**Required scope:** `reports:read`", "operationId": "getInvoicedRevenueReport", "parameters": [{"description": "First calendar day of the range (inclusive).", "example": "2026-01-31", "in": "query", "name": "date_from", "required": true, "schema": {"description": "First calendar day of the range (inclusive).", "format": "date", "title": "Date From", "type": "string"}}, {"description": "Last calendar day of the range (inclusive).", "example": "2026-01-31", "in": "query", "name": "date_to", "required": true, "schema": {"description": "Last calendar day of the range (inclusive).", "format": "date", "title": "Date To", "type": "string"}}, {"description": "Restrict to one kind of price; `all` includes every kind.", "in": "query", "name": "price_type", "required": false, "schema": {"$ref": "#/components/schemas/ReportPriceType", "default": "all", "description": "Restrict to one kind of price; `all` includes every kind."}}, {"description": "Convert the result into this ISO 4217 currency. Omit to report per billing currency.", "in": "query", "name": "reporting_currency", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "Convert the result into this ISO 4217 currency. Omit to report per billing currency.", "title": "Reporting Currency"}}, {"description": "Repeatable customer filter.", "in": "query", "name": "customer_id", "required": false, "schema": {"anyOf": [{"items": {"format": "uuid", "type": "string"}, "maxItems": 100, "type": "array"}, {"type": "null"}], "description": "Repeatable customer filter.", "title": "Customer Id"}}, {"description": "Repeatable contract filter.", "in": "query", "name": "contract_id", "required": false, "schema": {"anyOf": [{"items": {"format": "uuid", "type": "string"}, "maxItems": 100, "type": "array"}, {"type": "null"}], "description": "Repeatable contract filter.", "title": "Contract Id"}}, {"description": "Repeatable billable metric code filter.", "in": "query", "name": "billable_metric_code", "required": false, "schema": {"anyOf": [{"items": {"type": "string"}, "maxItems": 100, "type": "array"}, {"type": "null"}], "description": "Repeatable billable metric code filter.", "title": "Billable Metric Code"}}, {"description": "Only count documents billed in this ISO 4217 currency.", "in": "query", "name": "currency", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "Only count documents billed in this ISO 4217 currency.", "title": "Currency"}}, {"description": "IANA timezone that calendar days are evaluated in; an unknown zone is a 422.", "in": "query", "name": "timezone", "required": false, "schema": {"default": "UTC", "description": "IANA timezone that calendar days are evaluated in; an unknown zone is a 422.", "examples": ["America/Santiago"], "title": "Timezone", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/MoneyRangeReport"}}}, "description": "The money range report.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: a header, parameter or body value was rejected (`bad_request`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "A parameter is invalid (`validation_failed`): an unknown enum value or timezone, `date_from` after `date_to`, or a limit out of range.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "500": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The report could not be computed (`report_unavailable`). A server-side defect, not something the request can fix; retrying is safe.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["reports:read"]}], "summary": "Get invoiced revenue", "tags": ["Reports"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["reports:read"]}}, "/api/v1/sandbox/reports/mrr": {"get": {"description": "Monthly recurring revenue from active contracts at the end of `as_of`. Filter by customer and billing currency; set `reporting_currency` to convert.\n\n**Required scope:** `reports:read`", "operationId": "getMrrReport", "parameters": [{"description": "Calendar day of the snapshot, read at end of day.", "example": "2026-01-31", "in": "query", "name": "as_of", "required": true, "schema": {"description": "Calendar day of the snapshot, read at end of day.", "format": "date", "title": "As Of", "type": "string"}}, {"description": "Convert the result into this ISO 4217 currency. Omit to report per billing currency.", "in": "query", "name": "reporting_currency", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "Convert the result into this ISO 4217 currency. Omit to report per billing currency.", "title": "Reporting Currency"}}, {"description": "Repeatable customer filter.", "in": "query", "name": "customer_id", "required": false, "schema": {"anyOf": [{"items": {"format": "uuid", "type": "string"}, "maxItems": 100, "type": "array"}, {"type": "null"}], "description": "Repeatable customer filter.", "title": "Customer Id"}}, {"description": "Only count documents billed in this ISO 4217 currency.", "in": "query", "name": "currency", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "Only count documents billed in this ISO 4217 currency.", "title": "Currency"}}, {"description": "IANA timezone that calendar days are evaluated in; an unknown zone is a 422.", "in": "query", "name": "timezone", "required": false, "schema": {"default": "UTC", "description": "IANA timezone that calendar days are evaluated in; an unknown zone is a 422.", "examples": ["America/Santiago"], "title": "Timezone", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/MoneySnapshotReport"}}}, "description": "The money snapshot report.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: a header, parameter or body value was rejected (`bad_request`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "A parameter is invalid (`validation_failed`): an unknown enum value or timezone, `date_from` after `date_to`, or a limit out of range.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "500": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The report could not be computed (`report_unavailable`). A server-side defect, not something the request can fix; retrying is safe.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["reports:read"]}], "summary": "Get monthly recurring revenue", "tags": ["Reports"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["reports:read"]}}, "/api/v1/sandbox/reports/receivables-aging/customers": {"get": {"description": "What each customer owes at the end of `as_of`, split into aging buckets, ordered by customer name. Cursor-paginated.\n\n**Required scope:** `reports:read`", "operationId": "listReceivablesAgingCustomers", "parameters": [{"description": "Calendar day of the snapshot, read at end of day.", "example": "2026-01-31", "in": "query", "name": "as_of", "required": true, "schema": {"description": "Calendar day of the snapshot, read at end of day.", "format": "date", "title": "As Of", "type": "string"}}, {"description": "Convert the result into this ISO 4217 currency. Omit to report per billing currency.", "in": "query", "name": "reporting_currency", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "Convert the result into this ISO 4217 currency. Omit to report per billing currency.", "title": "Reporting Currency"}}, {"description": "Repeatable contract filter.", "in": "query", "name": "contract_id", "required": false, "schema": {"anyOf": [{"items": {"format": "uuid", "type": "string"}, "maxItems": 100, "type": "array"}, {"type": "null"}], "description": "Repeatable contract filter.", "title": "Contract Id"}}, {"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReceivablesAgingCustomerPage"}}}, "description": "One page of receivables aging customers.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "A parameter is invalid (`validation_failed`): an unknown enum value or timezone, `date_from` after `date_to`, or a limit out of range.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "500": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The report could not be computed (`report_unavailable`). A server-side defect, not something the request can fix; retrying is safe.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["reports:read"]}], "summary": "List receivables aging by customer", "tags": ["Reports"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["reports:read"]}}, "/api/v1/sandbox/reports/receivables-aging/customers/{customer_id}/invoices": {"get": {"description": "The open invoices of the customer in the path at the end of `as_of`, oldest issued first. Pass a row's `group_key` to list only that receivables-aging row's invoices of this customer: across all pages their open amounts sum to the row's total when every invoice in the row belongs to this customer. Results are always limited to the path customer, so a row without a `customer_id` cannot be drilled into here. Cursor-paginated.\n\n**Required scope:** `reports:read`", "operationId": "listReceivablesAgingInvoices", "parameters": [{"description": "Id of the customer.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "customer_id", "required": true, "schema": {"format": "uuid", "title": "Customer Id", "type": "string"}}, {"description": "Calendar day of the snapshot, read at end of day.", "example": "2026-01-31", "in": "query", "name": "as_of", "required": true, "schema": {"description": "Calendar day of the snapshot, read at end of day.", "format": "date", "title": "As Of", "type": "string"}}, {"description": "A receivables-aging row's `group_key`: list only that row's invoices.", "in": "query", "name": "group_key", "required": false, "schema": {"anyOf": [{"maxLength": 300, "minLength": 1, "type": "string"}, {"type": "null"}], "description": "A receivables-aging row's `group_key`: list only that row's invoices.", "title": "Group Key"}}, {"description": "Convert the result into this ISO 4217 currency. Omit to report per billing currency.", "in": "query", "name": "reporting_currency", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "Convert the result into this ISO 4217 currency. Omit to report per billing currency.", "title": "Reporting Currency"}}, {"description": "Repeatable contract filter.", "in": "query", "name": "contract_id", "required": false, "schema": {"anyOf": [{"items": {"format": "uuid", "type": "string"}, "maxItems": 100, "type": "array"}, {"type": "null"}], "description": "Repeatable contract filter.", "title": "Contract Id"}}, {"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReceivablesAgingInvoicePage"}}}, "description": "One page of receivables aging invoices.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "A parameter is invalid (`validation_failed`): an unknown enum value or timezone, `date_from` after `date_to`, or a limit out of range.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "500": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The report could not be computed (`report_unavailable`). A server-side defect, not something the request can fix; retrying is safe.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["reports:read"]}], "summary": "List one customer's aging invoices", "tags": ["Reports"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["reports:read"]}}, "/api/v1/sandbox/reports/revenue-concentration": {"get": {"description": "Share of invoiced revenue held by the largest groups in `date_from`..`date_to` (inclusive). Percentages are decimal strings.\n\n**Required scope:** `reports:read`", "operationId": "getRevenueConcentrationReport", "parameters": [{"description": "First calendar day of the range (inclusive).", "example": "2026-01-31", "in": "query", "name": "date_from", "required": true, "schema": {"description": "First calendar day of the range (inclusive).", "format": "date", "title": "Date From", "type": "string"}}, {"description": "Last calendar day of the range (inclusive).", "example": "2026-01-31", "in": "query", "name": "date_to", "required": true, "schema": {"description": "Last calendar day of the range (inclusive).", "format": "date", "title": "Date To", "type": "string"}}, {"description": "Dimension to rank.", "in": "query", "name": "group_by", "required": true, "schema": {"$ref": "#/components/schemas/RevenueGroupBy", "description": "Dimension to rank."}}, {"description": "Maximum rows returned.", "in": "query", "name": "limit", "required": false, "schema": {"default": 5, "description": "Maximum rows returned.", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Convert the result into this ISO 4217 currency. Omit to report per billing currency.", "in": "query", "name": "reporting_currency", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "Convert the result into this ISO 4217 currency. Omit to report per billing currency.", "title": "Reporting Currency"}}, {"description": "Repeatable customer filter.", "in": "query", "name": "customer_id", "required": false, "schema": {"anyOf": [{"items": {"format": "uuid", "type": "string"}, "maxItems": 100, "type": "array"}, {"type": "null"}], "description": "Repeatable customer filter.", "title": "Customer Id"}}, {"description": "Repeatable contract filter.", "in": "query", "name": "contract_id", "required": false, "schema": {"anyOf": [{"items": {"format": "uuid", "type": "string"}, "maxItems": 100, "type": "array"}, {"type": "null"}], "description": "Repeatable contract filter.", "title": "Contract Id"}}, {"description": "Repeatable billable metric code filter.", "in": "query", "name": "billable_metric_code", "required": false, "schema": {"anyOf": [{"items": {"type": "string"}, "maxItems": 100, "type": "array"}, {"type": "null"}], "description": "Repeatable billable metric code filter.", "title": "Billable Metric Code"}}, {"description": "Only count documents billed in this ISO 4217 currency.", "in": "query", "name": "currency", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "Only count documents billed in this ISO 4217 currency.", "title": "Currency"}}, {"description": "IANA timezone that calendar days are evaluated in; an unknown zone is a 422.", "in": "query", "name": "timezone", "required": false, "schema": {"default": "UTC", "description": "IANA timezone that calendar days are evaluated in; an unknown zone is a 422.", "examples": ["America/Santiago"], "title": "Timezone", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/RevenueConcentrationReport"}}}, "description": "The revenue concentration report.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: a header, parameter or body value was rejected (`bad_request`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "A parameter is invalid (`validation_failed`): an unknown enum value or timezone, `date_from` after `date_to`, or a limit out of range.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "500": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The report could not be computed (`report_unavailable`). A server-side defect, not something the request can fix; retrying is safe.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["reports:read"]}], "summary": "Get revenue concentration", "tags": ["Reports"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["reports:read"]}}, "/api/v1/sandbox/reports/revenue-trend": {"get": {"description": "Invoiced revenue bucketed by `grain` over `date_from`..`date_to` (inclusive).\n\n**Required scope:** `reports:read`", "operationId": "getRevenueTrendReport", "parameters": [{"description": "First calendar day of the range (inclusive).", "example": "2026-01-31", "in": "query", "name": "date_from", "required": true, "schema": {"description": "First calendar day of the range (inclusive).", "format": "date", "title": "Date From", "type": "string"}}, {"description": "Last calendar day of the range (inclusive).", "example": "2026-01-31", "in": "query", "name": "date_to", "required": true, "schema": {"description": "Last calendar day of the range (inclusive).", "format": "date", "title": "Date To", "type": "string"}}, {"description": "Bucket size.", "in": "query", "name": "grain", "required": false, "schema": {"$ref": "#/components/schemas/ReportTimeGrain", "default": "month", "description": "Bucket size."}}, {"description": "Restrict to one kind of price; `all` includes every kind.", "in": "query", "name": "price_type", "required": false, "schema": {"$ref": "#/components/schemas/ReportPriceType", "default": "all", "description": "Restrict to one kind of price; `all` includes every kind."}}, {"description": "Convert the result into this ISO 4217 currency. Omit to report per billing currency.", "in": "query", "name": "reporting_currency", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "Convert the result into this ISO 4217 currency. Omit to report per billing currency.", "title": "Reporting Currency"}}, {"description": "Repeatable customer filter.", "in": "query", "name": "customer_id", "required": false, "schema": {"anyOf": [{"items": {"format": "uuid", "type": "string"}, "maxItems": 100, "type": "array"}, {"type": "null"}], "description": "Repeatable customer filter.", "title": "Customer Id"}}, {"description": "Repeatable contract filter.", "in": "query", "name": "contract_id", "required": false, "schema": {"anyOf": [{"items": {"format": "uuid", "type": "string"}, "maxItems": 100, "type": "array"}, {"type": "null"}], "description": "Repeatable contract filter.", "title": "Contract Id"}}, {"description": "Repeatable billable metric code filter.", "in": "query", "name": "billable_metric_code", "required": false, "schema": {"anyOf": [{"items": {"type": "string"}, "maxItems": 100, "type": "array"}, {"type": "null"}], "description": "Repeatable billable metric code filter.", "title": "Billable Metric Code"}}, {"description": "Only count documents billed in this ISO 4217 currency.", "in": "query", "name": "currency", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "Only count documents billed in this ISO 4217 currency.", "title": "Currency"}}, {"description": "IANA timezone that calendar days are evaluated in; an unknown zone is a 422.", "in": "query", "name": "timezone", "required": false, "schema": {"default": "UTC", "description": "IANA timezone that calendar days are evaluated in; an unknown zone is a 422.", "examples": ["America/Santiago"], "title": "Timezone", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/RevenueTrendReport"}}}, "description": "The revenue trend report.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: a header, parameter or body value was rejected (`bad_request`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "A parameter is invalid (`validation_failed`): an unknown enum value or timezone, `date_from` after `date_to`, or a limit out of range.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "500": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The report could not be computed (`report_unavailable`). A server-side defect, not something the request can fix; retrying is safe.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["reports:read"]}], "summary": "Get invoiced revenue trend", "tags": ["Reports"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["reports:read"]}}, "/api/v1/sandbox/reports/top-revenue": {"get": {"description": "The largest invoiced-revenue groups (customers, items or billable metrics) in `date_from`..`date_to` (inclusive), largest first.\n\n**Required scope:** `reports:read`", "operationId": "getTopRevenueReport", "parameters": [{"description": "First calendar day of the range (inclusive).", "example": "2026-01-31", "in": "query", "name": "date_from", "required": true, "schema": {"description": "First calendar day of the range (inclusive).", "format": "date", "title": "Date From", "type": "string"}}, {"description": "Last calendar day of the range (inclusive).", "example": "2026-01-31", "in": "query", "name": "date_to", "required": true, "schema": {"description": "Last calendar day of the range (inclusive).", "format": "date", "title": "Date To", "type": "string"}}, {"description": "Dimension to rank.", "in": "query", "name": "group_by", "required": true, "schema": {"$ref": "#/components/schemas/RevenueGroupBy", "description": "Dimension to rank."}}, {"description": "Maximum rows returned.", "in": "query", "name": "limit", "required": false, "schema": {"default": 5, "description": "Maximum rows returned.", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Convert the result into this ISO 4217 currency. Omit to report per billing currency.", "in": "query", "name": "reporting_currency", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "Convert the result into this ISO 4217 currency. Omit to report per billing currency.", "title": "Reporting Currency"}}, {"description": "Repeatable customer filter.", "in": "query", "name": "customer_id", "required": false, "schema": {"anyOf": [{"items": {"format": "uuid", "type": "string"}, "maxItems": 100, "type": "array"}, {"type": "null"}], "description": "Repeatable customer filter.", "title": "Customer Id"}}, {"description": "Repeatable contract filter.", "in": "query", "name": "contract_id", "required": false, "schema": {"anyOf": [{"items": {"format": "uuid", "type": "string"}, "maxItems": 100, "type": "array"}, {"type": "null"}], "description": "Repeatable contract filter.", "title": "Contract Id"}}, {"description": "Repeatable billable metric code filter.", "in": "query", "name": "billable_metric_code", "required": false, "schema": {"anyOf": [{"items": {"type": "string"}, "maxItems": 100, "type": "array"}, {"type": "null"}], "description": "Repeatable billable metric code filter.", "title": "Billable Metric Code"}}, {"description": "Only count documents billed in this ISO 4217 currency.", "in": "query", "name": "currency", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/CurrencyCodeEnum"}, {"type": "null"}], "description": "Only count documents billed in this ISO 4217 currency.", "title": "Currency"}}, {"description": "IANA timezone that calendar days are evaluated in; an unknown zone is a 422.", "in": "query", "name": "timezone", "required": false, "schema": {"default": "UTC", "description": "IANA timezone that calendar days are evaluated in; an unknown zone is a 422.", "examples": ["America/Santiago"], "title": "Timezone", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/TopRevenueReport"}}}, "description": "The top revenue report.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: a header, parameter or body value was rejected (`bad_request`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "A parameter is invalid (`validation_failed`): an unknown enum value or timezone, `date_from` after `date_to`, or a limit out of range.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "500": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The report could not be computed (`report_unavailable`). A server-side defect, not something the request can fix; retrying is safe.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["reports:read"]}], "summary": "Get top revenue contributors", "tags": ["Reports"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["reports:read"]}}, "/api/v1/sandbox/seat-events": {"get": {"description": "List recorded seat changes, newest `timestamp` first. This is an audit view: cancelled changes are included and carry `cancelled_at`. `timestamp_from`/`timestamp_to` are inclusive bounds on the change `timestamp`. `customer_id` matches the changes of every contract of that customer.\n\n**Required scope:** `seat_events:read`", "operationId": "listSeatEvents", "parameters": [{"description": "Only changes of this contract.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "contract_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Only changes of this contract.", "title": "Contract Id"}}, {"description": "Only changes of this customer's contracts.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "customer_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Only changes of this customer's contracts.", "title": "Customer Id"}}, {"description": "Only changes of this seat metric.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "seat_metric_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Only changes of this seat metric.", "title": "Seat Metric Id"}}, {"description": "Changes at or after this instant.", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "timestamp_from", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Changes at or after this instant.", "title": "Timestamp From"}}, {"description": "Changes at or before this instant.", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "timestamp_to", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Changes at or before this instant.", "title": "Timestamp To"}}, {"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/SeatEventPage"}}}, "description": "One page of seat events.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `cursor` tampered with, issued by another list, or replayed with different filters (`invalid_cursor`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "A timestamp has no UTC offset (`invalid_timestamp`), or `timestamp_from` is after `timestamp_to` (`invalid_range`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["seat_events:read"]}], "summary": "List seat events", "tags": ["Seat Events"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["seat_events:read"]}, "post": {"description": "Synchronously ingest a batch of 1 to 500 seat changes. Each change is validated on its own: an invalid one (timestamp more than 24 hours in the future, invalid `idempotency_key`, unknown contract or seat metric) is listed in `validation_failed` and the rest are ingested. Re-sending an already ingested key with the same body is a safe replay: it is listed in `duplicate_idempotency_keys` and nothing new is recorded. Re-sending it with a different body is rejected for that change only, in `validation_failed`, with an error starting `idempotency_key_reused`; the stored change is untouched. Each change carries its own `idempotency_key`, so no `Idempotency-Key` header is needed.\n\n**Required scope:** `seat_events:write`", "operationId": "ingestSeatEvents", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/IngestSeatEventsRequest"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/SeatEventIngestResult"}}}, "description": "The seat event ingest result.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The same `idempotency_key` appears twice in the batch with different bodies (`idempotency_key_reused`); nothing in the batch is ingested.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "429": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "More than 100 seat event requests per second for this organization; retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["seat_events:write"]}], "summary": "Ingest seat events in batch", "tags": ["Seat Events"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["seat_events:write"]}}, "/api/v1/sandbox/seat-events/count": {"get": {"description": "Return the seat count of one contract seat metric on a calendar day, resolved from the recorded seat changes by the same rule billing uses. Use it to check what Relvo holds before sending a `set`, or to reconcile against your own system. `as_of` defaults to today in the contract's billing timezone; a future `as_of` includes the changes already scheduled up to that day.\n\n**Required scope:** `seat_events:read`", "operationId": "getSeatCount", "parameters": [{"description": "Contract to read the count of: its id or the id of any of its revisions.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "contract_id", "required": true, "schema": {"description": "Contract to read the count of: its id or the id of any of its revisions.", "format": "uuid", "title": "Contract Id", "type": "string"}}, {"description": "Seat metric to read the count of.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "seat_metric_id", "required": true, "schema": {"description": "Seat metric to read the count of.", "format": "uuid", "title": "Seat Metric Id", "type": "string"}}, {"description": "Calendar day (YYYY-MM-DD) to resolve the count for. Defaults to today in the contract's billing timezone.", "example": "2026-01-31", "in": "query", "name": "as_of", "required": false, "schema": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "description": "Calendar day (YYYY-MM-DD) to resolve the count for. Defaults to today in the contract's billing timezone.", "title": "As Of"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/SeatCount"}}}, "description": "The seat count.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The seat metric is not defined on that contract in this organization (`seat_metric_not_on_contract`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["seat_events:read"]}], "summary": "Get the seat count", "tags": ["Seat Events"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["seat_events:read"]}}, "/api/v1/sandbox/seat-events/{seat_event_id}": {"get": {"description": "Return one recorded seat change, cancelled or not. Changes of another organization return 404.\n\n**Required scope:** `seat_events:read`", "operationId": "getSeatEvent", "parameters": [{"description": "Id of the seat event.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "seat_event_id", "required": true, "schema": {"format": "uuid", "title": "Seat Event Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/SeatEvent"}}}, "description": "The seat event.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No seat event with this id in this organization (`seat_event_not_found`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["seat_events:read"]}], "summary": "Get a seat event", "tags": ["Seat Events"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["seat_events:read"]}}, "/api/v1/sandbox/usage-event-receipts": {"get": {"description": "Return the receipts for the given idempotency keys (repeat `idempotency_key`, up to 200). Use it to recover receipt ids after a lost ingest response. Keys that were never accepted are absent. `next_cursor` is always `null`: this collection is bounded (at most 200 idempotency keys per request).\n\n**Required scope:** `usage_events:read`", "operationId": "listUsageEventReceipts", "parameters": [{"description": "Idempotency key; repeat for several.", "in": "query", "name": "idempotency_key", "required": true, "schema": {"description": "Idempotency key; repeat for several.", "items": {"type": "string"}, "maxItems": 200, "minItems": 1, "title": "Idempotency Key", "type": "array"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UsageEventReceiptPage"}}}, "description": "One page of usage event receipts.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["usage_events:read"]}], "summary": "List usage event receipts by idempotency key", "tags": ["Usage Events"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["usage_events:read"]}}, "/api/v1/sandbox/usage-event-receipts/{receipt_id}": {"get": {"description": "Return the processing state of one accepted event. The receipt id is not the usage event id: `usage_event_id` is set once `status` is `processed`.\n\n**Required scope:** `usage_events:read`", "operationId": "getUsageEventReceipt", "parameters": [{"description": "Id of the usage-event receipt (one ingested batch).", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "receipt_id", "required": true, "schema": {"format": "uuid", "title": "Receipt Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UsageEventReceipt"}}}, "description": "The usage event receipt.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No receipt with this id exists in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["usage_events:read"]}], "summary": "Get a usage event receipt", "tags": ["Usage Events"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["usage_events:read"]}}, "/api/v1/sandbox/usage-events": {"get": {"description": "List recorded usage events, newest first. This is an audit view: `voided` and `superseded` events are included unless `status` narrows the list (repeat it to match several statuses); anything computing money should ask for `status=active`. `timestamp_from`/`timestamp_to` are inclusive bounds on the event timestamp.\n\n**Required scope:** `usage_events:read`", "operationId": "listUsageEvents", "parameters": [{"description": "Case-insensitive substring match on idempotency key, event name, customer code, customer name and properties.", "in": "query", "name": "query", "required": false, "schema": {"anyOf": [{"maxLength": 200, "type": "string"}, {"type": "null"}], "description": "Case-insensitive substring match on idempotency key, event name, customer code, customer name and properties.", "title": "Query"}}, {"description": "Exact event name (case-sensitive).", "in": "query", "name": "event_name", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Exact event name (case-sensitive).", "title": "Event Name"}}, {"description": "Relvo customer id.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "query", "name": "customer_id", "required": false, "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Relvo customer id.", "title": "Customer Id"}}, {"description": "Customer code (case-insensitive exact match).", "in": "query", "name": "external_customer_id", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Customer code (case-insensitive exact match).", "title": "External Customer Id"}}, {"description": "Lifecycle status. Repeat the parameter to match any of several (`status=voided&status=superseded`); omit it for every status.", "in": "query", "name": "status", "required": false, "schema": {"anyOf": [{"items": {"$ref": "#/components/schemas/UsageEventStatus"}, "type": "array"}, {"type": "null"}], "description": "Lifecycle status. Repeat the parameter to match any of several (`status=voided&status=superseded`); omit it for every status.", "title": "Status"}}, {"description": "Events at or after this instant.", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "timestamp_from", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Events at or after this instant.", "title": "Timestamp From"}}, {"description": "Events at or before this instant.", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "timestamp_to", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Events at or before this instant.", "title": "Timestamp To"}}, {"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UsageEventPage"}}}, "description": "One page of usage events.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["usage_events:read"]}], "summary": "List usage events", "tags": ["Usage Events"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["usage_events:read"]}, "post": {"description": "Accept a batch of 1 to 500 usage events for asynchronous processing (202). Each event carries its own `idempotency_key`, so no `Idempotency-Key` header is needed.\n\n`receipts` holds one receipt per event that was queued now or had already been accepted with the same body; poll `GET /usage-event-receipts/{receipt_id}` until `status` is `processed`, then read the event with `GET /usage-events/{usage_event_id}`. A lost response can be recovered with `GET /usage-event-receipts?idempotency_key=...`.\n\nEvents are validated one by one: an invalid event (timestamp more than 1 hour in the future, invalid `idempotency_key`, negative or non-numeric quantity) is listed in `validation_failed` and the rest are queued. Re-using a key with a different body, inside the batch or against an earlier accepted event, rejects the whole batch with 409 and queues nothing; use the corrections endpoint to change an event. A full processing queue is 429 with `Retry-After`.\n\nAn event dated inside an already-billed period is still accepted and stored: a draft invoice for that period is recomputed, while an issued invoice is never rewritten and the difference is flagged for a credit or debit note.\n\n**Required scope:** `usage_events:write`", "operationId": "ingestUsageEvents", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/IngestUsageEventsRequest"}}}, "required": true}, "responses": {"202": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UsageEventIngestResult"}}}, "description": "Accepted for asynchronous processing. The body is the usage event ingest result.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "An event's `idempotency_key` was already used with a different body, inside the batch or by an earlier accepted event (`idempotency_key_reused`); nothing was queued.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "429": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The processing queue is full; retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["usage_events:write"]}], "summary": "Ingest usage events", "tags": ["Usage Events"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["usage_events:write"]}}, "/api/v1/sandbox/usage-events/schema": {"get": {"description": "Return the event names and property keys seen for this organization, and, per event name, the property keys a billable metric reads as a number. Ingestion rejects a non-numeric value for those keys.\n\n**Required scope:** `usage_events:read`", "operationId": "getUsageEventSchema", "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UsageSchema"}}}, "description": "The usage schema.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["usage_events:read"]}], "summary": "Get the usage event schema", "tags": ["Usage Events"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["usage_events:read"]}}, "/api/v1/sandbox/usage-events/volume": {"get": {"description": "Count recorded usage events per event-time hour between `timestamp_from` and `timestamp_to` (both inclusive; the window must be shorter than 31 days). Counts include `active`, `voided` and `superseded` events: this is raw volume, not billable usage. Empty hours are returned with `event_count` 0.\n\n**Required scope:** `usage_event_volume:read`", "operationId": "listUsageEventVolume", "parameters": [{"description": "First instant of the window (inclusive, UTC offset required).", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "timestamp_from", "required": true, "schema": {"description": "First instant of the window (inclusive, UTC offset required).", "format": "date-time", "title": "Timestamp From", "type": "string"}}, {"description": "Last instant of the window (inclusive).", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "timestamp_to", "required": true, "schema": {"description": "Last instant of the window (inclusive).", "format": "date-time", "title": "Timestamp To", "type": "string"}}, {"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UsageEventVolumeBucketPage"}}}, "description": "One page of usage event volume buckets.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["usage_event_volume:read"]}], "summary": "List usage event volume", "tags": ["Usage Events"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["usage_event_volume:read"]}}, "/api/v1/sandbox/usage-events/{usage_event_id}": {"get": {"description": "Return one recorded usage event. Events of another organization return 404.\n\n**Required scope:** `usage_events:read`", "operationId": "getUsageEvent", "parameters": [{"description": "Id of the usage event.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "usage_event_id", "required": true, "schema": {"format": "uuid", "title": "Usage Event Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UsageEvent"}}}, "description": "The usage event.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No usage event with this id exists in this organization.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["usage_events:read"]}], "summary": "Get a usage event", "tags": ["Usage Events"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["usage_events:read"]}}, "/api/v1/sandbox/usage-events/{usage_event_id}/corrections": {"post": {"description": "Correct a recorded usage event without editing it. `void` retires the event; `replace` supersedes it with a new event built from the original plus the fields sent in `replacement_event`. Requires an `Idempotency-Key` header; a retry with the same key returns the original outcome. 409 when the event is no longer `active`.\n\n**Required scope:** `usage_events:correct`", "operationId": "createUsageEventCorrection", "parameters": [{"description": "Id of the usage event.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "usage_event_id", "required": true, "schema": {"format": "uuid", "title": "Usage Event Id", "type": "string"}}, {"description": "Client-generated unique key (for example a UUID) that makes this write safe to retry: 8 to 128 characters from `A-Z a-z 0-9 . _ -`. Retrying with the same key and the same request returns the original result instead of repeating the write; reusing a key with a different request, or while the first attempt is still running, returns `409`. Keys are scoped to the organization and this operation.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CorrectUsageEventRequest"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UsageEventCorrection"}}}, "description": "The usage event correction.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The usage event or the replacement customer was not found.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The usage event is no longer `active`: it was already voided or replaced (`metering_usage_correction_original_already_corrected`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "A numeric property of the corrected event is not a number (`metering_usage_event_property_not_numeric`), not finite (`metering_usage_event_property_not_finite`), out of range (`metering_usage_event_property_out_of_range`) or negative (`metering_usage_event_property_negative`); or the correction request is invalid (`validation_failed`; `params.field` names `operation` or `replacement_event`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["usage_events:correct"]}], "summary": "Correct a usage event", "tags": ["Usage Events"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["usage_events:correct"]}}, "/api/v1/sandbox/webhook-endpoints": {"get": {"description": "List the organization's webhook endpoints in every status, oldest first. Signing secrets and verification challenges are never included. Requires `webhooks:read`.\n\n**Required scope:** `webhooks:read`", "operationId": "listWebhookEndpoints", "parameters": [{"description": "Only endpoints changed at or after this instant (inclusive, RFC 3339). Bound into the cursor: keep it unchanged while paging.", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "updated_since", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Only endpoints changed at or after this instant (inclusive, RFC 3339). Bound into the cursor: keep it unchanged while paging.", "title": "Updated Since"}}, {"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookEndpointPage"}}}, "description": "One page of webhook endpoints.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["webhooks:read"]}], "summary": "List webhook endpoints", "tags": ["Webhooks"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["webhooks:read"]}, "post": {"description": "Register an HTTPS endpoint and its subscriptions. It starts `pending_verification` and receives nothing until `verify` succeeds. The response carries `signing_secret` and `verification_challenge` **only on the first response**; an idempotent replay returns them as `null`. Requires `webhooks:write`.\n\n**Required scope:** `webhooks:write`", "operationId": "createWebhookEndpoint", "parameters": [{"description": "Required client-generated unique key (for example a UUID) that makes this POST safe to retry. Replaying the same key with the same request returns the original outcome without repeating the side effect; reusing it with a different request returns 409.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"description": "Required client-generated unique key (for example a UUID) that makes this POST safe to retry. Replaying the same key with the same request returns the original outcome without repeating the side effect; reusing it with a different request returns 409.", "title": "Idempotency-Key", "type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateWebhookEndpointRequest"}}}, "required": true}, "responses": {"201": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreatedWebhookEndpoint"}}}, "description": "Created.", "headers": {"ETag": {"description": "Weak ETag `W/\"<version>\"`.", "schema": {"type": "string"}}, "Location": {"schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "A live endpoint already uses this URL (`webhook_endpoint_url_taken`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Invalid URL or subscriptions (`validation_failed`; `params.field` names `endpoint_url`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["webhooks:write"]}], "summary": "Create a webhook endpoint", "tags": ["Webhooks"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["webhooks:write"]}}, "/api/v1/sandbox/webhook-endpoints/{endpoint_id}": {"delete": {"description": "Delete an endpoint in any status: it stops receiving deliveries, queued deliveries are cancelled, and its URL can be registered again. Requires `webhooks:write`.\n\n**Required scope:** `webhooks:write`", "operationId": "deleteWebhookEndpoint", "parameters": [{"description": "Id of the webhook endpoint.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "endpoint_id", "required": true, "schema": {"format": "uuid", "title": "Endpoint Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"204": {"description": "Deleted.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such webhook endpoint in the token's organization (`webhook_endpoint_not_found`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["webhooks:write"]}], "summary": "Delete a webhook endpoint", "tags": ["Webhooks"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["webhooks:write"]}, "get": {"description": "Fetch one webhook endpoint. Requires `webhooks:read`.\n\n**Required scope:** `webhooks:read`", "operationId": "getWebhookEndpoint", "parameters": [{"description": "Id of the webhook endpoint.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "endpoint_id", "required": true, "schema": {"format": "uuid", "title": "Endpoint Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookEndpoint"}}}, "description": "The endpoint.", "headers": {"ETag": {"description": "Weak ETag `W/\"<version>\"`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such webhook endpoint in the token's organization (`webhook_endpoint_not_found`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["webhooks:read"]}], "summary": "Get a webhook endpoint", "tags": ["Webhooks"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["webhooks:read"]}}, "/api/v1/sandbox/webhook-endpoints/{endpoint_id}/deliveries": {"get": {"description": "List the endpoint's deliveries, newest first. Filters combine with AND; a repeated filter matches any of its values; `created_from`/`created_to` are inclusive. Requires `webhooks:read`.\n\n**Required scope:** `webhooks:read`", "operationId": "listWebhookDeliveries", "parameters": [{"description": "Id of the webhook endpoint.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "endpoint_id", "required": true, "schema": {"format": "uuid", "title": "Endpoint Id", "type": "string"}}, {"description": "Delivery status; repeat to match several.", "in": "query", "name": "status", "required": false, "schema": {"anyOf": [{"items": {"$ref": "#/components/schemas/WebhookDeliveryStatus"}, "type": "array"}, {"type": "null"}], "description": "Delivery status; repeat to match several.", "title": "Status"}}, {"description": "Event type; repeat to match several.", "in": "query", "name": "event_type", "required": false, "schema": {"anyOf": [{"items": {"$ref": "#/components/schemas/WebhookEventType"}, "type": "array"}, {"type": "null"}], "description": "Event type; repeat to match several.", "title": "Event Type"}}, {"description": "Created at or after (RFC 3339).", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "created_from", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Created at or after (RFC 3339).", "title": "Created From"}}, {"description": "Created at or before (RFC 3339).", "example": "2026-01-31T15:04:05Z", "in": "query", "name": "created_to", "required": false, "schema": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "description": "Created at or before (RFC 3339).", "title": "Created To"}}, {"description": "Maximum number of items to return (1-200).", "in": "query", "name": "limit", "required": false, "schema": {"default": 50, "description": "Maximum number of items to return (1-200).", "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer"}}, {"description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "in": "query", "name": "cursor", "required": false, "schema": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "description": "Opaque cursor from a previous page's `next_cursor`. Bound to the filters that produced it.", "title": "Cursor"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookDeliveryPage"}}}, "description": "One page of webhook deliveries.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such webhook endpoint in the token's organization (`webhook_endpoint_not_found`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["webhooks:read"]}], "summary": "List webhook deliveries", "tags": ["Webhooks"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["webhooks:read"]}}, "/api/v1/sandbox/webhook-endpoints/{endpoint_id}/deliveries/{delivery_id}": {"get": {"description": "Fetch one delivery of the endpoint. Requires `webhooks:read`.\n\n**Required scope:** `webhooks:read`", "operationId": "getWebhookDelivery", "parameters": [{"description": "Id of the webhook endpoint.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "endpoint_id", "required": true, "schema": {"format": "uuid", "title": "Endpoint Id", "type": "string"}}, {"description": "Id of the webhook delivery.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "delivery_id", "required": true, "schema": {"format": "uuid", "title": "Delivery Id", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookDelivery"}}}, "description": "The webhook delivery.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The endpoint does not exist, or the delivery does not belong to it (`webhook_endpoint_not_found`, `webhook_delivery_not_found`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["webhooks:read"]}], "summary": "Get a webhook delivery", "tags": ["Webhooks"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["webhooks:read"]}}, "/api/v1/sandbox/webhook-endpoints/{endpoint_id}/deliveries/{delivery_id}/redeliver": {"post": {"description": "Schedule one more attempt of a `delivered`, `dead` or `cancelled` delivery. The frozen body is resent unchanged (same envelope `id`, so receivers deduplicate) and signed with the secret the delivery was created with. Deliveries carry no version, so no `If-Match` is needed. Requires `webhooks:write`.\n\n**Required scope:** `webhooks:write`", "operationId": "redeliverWebhookDelivery", "parameters": [{"description": "Id of the webhook endpoint.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "endpoint_id", "required": true, "schema": {"format": "uuid", "title": "Endpoint Id", "type": "string"}}, {"description": "Id of the webhook delivery.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "delivery_id", "required": true, "schema": {"format": "uuid", "title": "Delivery Id", "type": "string"}}, {"description": "Required client-generated unique key (for example a UUID) that makes this POST safe to retry. Replaying the same key with the same request returns the original outcome without repeating the side effect; reusing it with a different request returns 409.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"description": "Required client-generated unique key (for example a UUID) that makes this POST safe to retry. Replaying the same key with the same request returns the original outcome without repeating the side effect; reusing it with a different request returns 409.", "title": "Idempotency-Key", "type": "string"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookDelivery"}}}, "description": "Rescheduled; the delivery is `pending`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The endpoint does not exist, or the delivery does not belong to it (`webhook_endpoint_not_found`, `webhook_delivery_not_found`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The delivery is still pending or in flight (`webhook_delivery_not_eligible`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["webhooks:write"]}], "summary": "Redeliver a webhook delivery", "tags": ["Webhooks"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["webhooks:write"]}}, "/api/v1/sandbox/webhook-endpoints/{endpoint_id}/disable": {"post": {"description": "Pause an `active` or `pending_verification` endpoint. Queued deliveries are cancelled (redeliver them later if needed). Requires `webhooks:write`.\n\n**Required scope:** `webhooks:write`", "operationId": "disableWebhookEndpoint", "parameters": [{"description": "Id of the webhook endpoint.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "endpoint_id", "required": true, "schema": {"format": "uuid", "title": "Endpoint Id", "type": "string"}}, {"description": "Required client-generated unique key (for example a UUID) that makes this POST safe to retry. Replaying the same key with the same request returns the original outcome without repeating the side effect; reusing it with a different request returns 409.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"description": "Required client-generated unique key (for example a UUID) that makes this POST safe to retry. Replaying the same key with the same request returns the original outcome without repeating the side effect; reusing it with a different request returns 409.", "title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookEndpoint"}}}, "description": "Disabled.", "headers": {"ETag": {"description": "Weak ETag `W/\"<version>\"`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such webhook endpoint in the token's organization (`webhook_endpoint_not_found`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The endpoint's status forbids this action (`webhook_endpoint_state_conflict`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["webhooks:write"]}], "summary": "Disable a webhook endpoint", "tags": ["Webhooks"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["webhooks:write"]}}, "/api/v1/sandbox/webhook-endpoints/{endpoint_id}/enable": {"post": {"description": "Resume a `disabled` endpoint. It returns to `active` when its URL ownership was already verified; otherwise it returns to `pending_verification` with a fresh challenge, so disabling never skips verification. Deliveries cancelled while it was disabled are not revived. Requires `webhooks:write`.\n\n**Required scope:** `webhooks:write`", "operationId": "enableWebhookEndpoint", "parameters": [{"description": "Id of the webhook endpoint.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "endpoint_id", "required": true, "schema": {"format": "uuid", "title": "Endpoint Id", "type": "string"}}, {"description": "Required client-generated unique key (for example a UUID) that makes this POST safe to retry. Replaying the same key with the same request returns the original outcome without repeating the side effect; reusing it with a different request returns 409.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"description": "Required client-generated unique key (for example a UUID) that makes this POST safe to retry. Replaying the same key with the same request returns the original outcome without repeating the side effect; reusing it with a different request returns 409.", "title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookEndpoint"}}}, "description": "Enabled.", "headers": {"ETag": {"description": "Weak ETag `W/\"<version>\"`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such webhook endpoint in the token's organization (`webhook_endpoint_not_found`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The endpoint's status forbids this action (`webhook_endpoint_state_conflict`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["webhooks:write"]}], "summary": "Enable a webhook endpoint", "tags": ["Webhooks"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["webhooks:write"]}}, "/api/v1/sandbox/webhook-endpoints/{endpoint_id}/reissue-challenge": {"post": {"description": "Issue a fresh verification challenge (15-minute lifetime) for a `pending_verification` endpoint, replacing the previous one. Then call `verify`. The challenge is sent to your URL during `verify`; it is not returned here. Requires `webhooks:write`.\n\n**Required scope:** `webhooks:write`", "operationId": "reissueWebhookEndpointChallenge", "parameters": [{"description": "Id of the webhook endpoint.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "endpoint_id", "required": true, "schema": {"format": "uuid", "title": "Endpoint Id", "type": "string"}}, {"description": "Required client-generated unique key (for example a UUID) that makes this POST safe to retry. Replaying the same key with the same request returns the original outcome without repeating the side effect; reusing it with a different request returns 409.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"description": "Required client-generated unique key (for example a UUID) that makes this POST safe to retry. Replaying the same key with the same request returns the original outcome without repeating the side effect; reusing it with a different request returns 409.", "title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookEndpoint"}}}, "description": "Challenge reissued.", "headers": {"ETag": {"description": "Weak ETag `W/\"<version>\"`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such webhook endpoint in the token's organization (`webhook_endpoint_not_found`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The endpoint's status forbids this action (`webhook_endpoint_state_conflict`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["webhooks:write"]}], "summary": "Reissue the verification challenge", "tags": ["Webhooks"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["webhooks:write"]}}, "/api/v1/sandbox/webhook-endpoints/{endpoint_id}/rotate-secret": {"post": {"description": "Mint a new signing secret. For an overlap window (24 hours by default) every delivery is signed with both the new and the previous secret, so `Relvo-Signature` carries several comma-separated `v1=` values: accept the request when any of them matches a secret you hold, and move your receiver to the new secret within the window. Retries of deliveries created before the rotation keep their original signature too. The new secret is returned only in this response (`null` on an idempotent replay). Requires `webhooks:write`.\n\n**Required scope:** `webhooks:write`", "operationId": "rotateWebhookEndpointSecret", "parameters": [{"description": "Id of the webhook endpoint.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "endpoint_id", "required": true, "schema": {"format": "uuid", "title": "Endpoint Id", "type": "string"}}, {"description": "Required client-generated unique key (for example a UUID) that makes this POST safe to retry. Replaying the same key with the same request returns the original outcome without repeating the side effect; reusing it with a different request returns 409.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"description": "Required client-generated unique key (for example a UUID) that makes this POST safe to retry. Replaying the same key with the same request returns the original outcome without repeating the side effect; reusing it with a different request returns 409.", "title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookEndpointWithSecret"}}}, "description": "Rotated; the new secret is in the body.", "headers": {"ETag": {"description": "Weak ETag `W/\"<version>\"`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such webhook endpoint in the token's organization (`webhook_endpoint_not_found`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The endpoint is `deleted` (`webhook_endpoint_state_conflict`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["webhooks:write"]}], "summary": "Rotate the signing secret", "tags": ["Webhooks"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["webhooks:write"]}}, "/api/v1/sandbox/webhook-endpoints/{endpoint_id}/subscriptions": {"put": {"description": "Replace the endpoint's whole subscription set (types left out are unsubscribed). Allowed in every status except `deleted`. Requires `webhooks:write`.\n\n**Required scope:** `webhooks:write`", "operationId": "replaceWebhookEndpointSubscriptions", "parameters": [{"description": "Id of the webhook endpoint.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "endpoint_id", "required": true, "schema": {"format": "uuid", "title": "Endpoint Id", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReplaceWebhookSubscriptionsRequest"}}}, "required": true}, "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookEndpoint"}}}, "description": "Subscriptions replaced.", "headers": {"ETag": {"description": "Weak ETag `W/\"<version>\"`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such webhook endpoint in the token's organization (`webhook_endpoint_not_found`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The endpoint is `deleted` (`webhook_endpoint_state_conflict`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Duplicated or unsupported subscription (`validation_failed`; `params.field` is `subscriptions`). Schema violations return `validation_failed` with `params.validation_errors`.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["webhooks:write"]}], "summary": "Replace webhook subscriptions", "tags": ["Webhooks"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["webhooks:write"]}}, "/api/v1/sandbox/webhook-endpoints/{endpoint_id}/verify": {"post": {"description": "Run the ownership handshake. Relvo POSTs `{\"type\": \"relvo.webhook.verify\", \"challenge\": \"<challenge>\"}` with header `Relvo-Verification: <challenge>`; the endpoint must answer 2xx and echo the challenge in the `Relvo-Verification` response header or a JSON body `{\"challenge\": \"<challenge>\"}`. On success the endpoint becomes `active`. A challenge expires 15 minutes after it was issued; get a new one with `reissue-challenge`. Requires `webhooks:write`.\n\n**Required scope:** `webhooks:write`", "operationId": "verifyWebhookEndpoint", "parameters": [{"description": "Id of the webhook endpoint.", "example": "0190f3c1-7c1e-7a51-b1b2-6f0c3f1d9a10", "in": "path", "name": "endpoint_id", "required": true, "schema": {"format": "uuid", "title": "Endpoint Id", "type": "string"}}, {"description": "Required client-generated unique key (for example a UUID) that makes this POST safe to retry. Replaying the same key with the same request returns the original outcome without repeating the side effect; reusing it with a different request returns 409.", "example": "8f14e45f-ceea-4672-a8d6-1b2f3c4d5e6f", "in": "header", "name": "Idempotency-Key", "required": true, "schema": {"description": "Required client-generated unique key (for example a UUID) that makes this POST safe to retry. Replaying the same key with the same request returns the original outcome without repeating the side effect; reusing it with a different request returns 409.", "title": "Idempotency-Key", "type": "string"}}, {"description": "The resource's current version, as returned in its `version` field or `ETag` header. Missing returns `428`, malformed `400`, stale `412`.", "example": "3", "in": "header", "name": "If-Match", "required": true, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookEndpoint"}}}, "description": "Verified; the endpoint is `active`.", "headers": {"ETag": {"description": "Weak ETag `W/\"<version>\"`.", "schema": {"type": "string"}}, "RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "X-Request-ID": {"description": "Echo of your `X-Request-ID`, or the id the server generated.", "schema": {"type": "string"}}}}, "400": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Bad request: `Idempotency-Key` missing (`idempotency_key_required`) or malformed (`invalid_idempotency_key`); `If-Match` malformed (`invalid_if_match`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "404": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "No such webhook endpoint in the token's organization (`webhook_endpoint_not_found`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Handshake failed or challenge expired (`webhook_verification_failed`), or the endpoint is not `pending_verification` (`webhook_endpoint_state_conflict`).\n\nThe `Idempotency-Key` was already used with a different request (`idempotency_key_reused`), or its first attempt is still running (`idempotency_key_in_progress`; retry later with the same key).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "412": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The `If-Match` version is stale (`version_conflict`). Fetch the resource again and retry with its current version.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "422": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "The request does not match this operation's schema (`validation_failed`). `params.validation_errors` lists every rejected field.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "428": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "This operation requires an `If-Match` header carrying the resource's current version (`precondition_required`).", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}}}, "default": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}, "description": "Errors any operation can return, in the error envelope:\n\n- `401`: Missing, malformed, expired or revoked API token (`unauthenticated`).\n- `403`: The token is valid but holds none of the scopes this operation lists (`insufficient_scope`), or the caller IP is not allowed (`ip_not_allowed`).\n- `429`: Rate limit exceeded (`rate_limited`). Wait the number of seconds in `Retry-After` before retrying; `RateLimit-Remaining` is `0`.\n- `500`: Unexpected server error (`internal_error`). Retrying with the same `Idempotency-Key` is safe.\n- `503`: Temporarily unavailable (`service_unavailable`, `concurrency_retry`); nothing was written. Retry after `Retry-After` seconds.", "headers": {"RateLimit-Limit": {"$ref": "#/components/headers/RateLimit-Limit"}, "RateLimit-Remaining": {"$ref": "#/components/headers/RateLimit-Remaining"}, "RateLimit-Reset": {"$ref": "#/components/headers/RateLimit-Reset"}, "Retry-After": {"description": "Seconds to wait before retrying.", "schema": {"minimum": 0, "type": "integer"}}}}}, "security": [{"BearerAuth": ["webhooks:write"]}], "summary": "Verify a webhook endpoint", "tags": ["Webhooks"], "x-relvo-audience": "public_api", "x-relvo-generate-client": false, "x-relvo-public-docs": true, "x-required-scopes": ["webhooks:write"]}}}, "security": [{"BearerAuth": []}], "servers": [{"description": "Production", "url": "https://app.relvoerp.com"}], "tags": [{"description": "Create, list, edit, and delete the customers you bill.", "name": "Customers"}, {"description": "The billing entities (legal billing profiles) attached to a customer that invoices are issued to.", "name": "Billing Entities"}, {"description": "The people reachable at a customer: their emails, phones, and roles (billing, collections, commercial reference). A contact is created under a billing entity and thereafter addressed by its own id. Channel ids are server-generated and every channel starts `active`; channels are archived rather than deleted, so who was once reachable stays auditable.", "name": "Contacts"}, {"description": "Configure payment methods — the collection rail an invoice is paid through — and assign them to a customer's billing entities.", "name": "Payment Methods"}, {"description": "The catalog of sellable things a charge or invoice line can point at, with their default descriptions and accounting mapping.", "name": "Catalog Items"}, {"description": "How raw usage events are filtered and aggregated into the quantity a usage-based charge prices.", "name": "Billable Metrics"}, {"description": "Seat-based metrics on a contract: the seat counts that Seat Events update and that per-seat charges price.", "name": "Seat Metrics"}, {"description": "Pricing definitions attached to charges — fixed, tiered, graduated, volume, package, and percentage models.", "name": "Prices"}, {"description": "Create and publish customer quotes, notify recipients, record acceptance, and create draft contracts from accepted quotes.", "name": "Quotes"}, {"description": "Create, list, amend, activate, pause, and cancel customer contracts — the commercial agreements that drive billing (recurring charges, usage-based pricing, commitments).", "name": "Contracts"}, {"description": "Read parser-created purchase-order, HES, and related commercial-reference proposals before they are explicitly recorded against an invoice.", "name": "Commercial References"}, {"description": "Upload a signed contract PDF; Relvo drafts the customer, billing entity, and contract from it for review.", "name": "Imports"}, {"description": "Stable customer and contract-phase grant configuration, refresh rules and integration identifiers at /credit-grants. Customer creation supports currency only, selects the customer's single active billing profile and issues asynchronously. For explicit billing-entity selection, metric units or a purchase invoice draft, use One-off Credits. These APIs share credit capacity; do not create the same purchase twice.", "externalDocs": {"description": "Choose the right credits API", "url": "https://app.relvoerp.com/docs/product/guides/credits/#choose-an-api"}, "name": "Credit Grants"}, {"description": "Create purchased or promotional customer credits at /credits/grants with an explicit billing entity, currency or metric capacity, and an optional purchase invoice draft. Read individual financial allowances and revoke unused capacity. Listing also includes contract allowances; filter grant_scope=customer for customer-wide credits. Contract configuration IDs belong to Credit Grants; allowance IDs belong here.", "externalDocs": {"description": "Create one-off credits", "url": "https://app.relvoerp.com/docs/product/guides/credits/#create-one-off-credits"}, "name": "One-off Credits"}, {"description": "Inspect balances, customers and immutable journal movements across one-off and contract credits. Balances stay separate by billing entity and currency or metric. These reads never issue, consume or repair credits.", "externalDocs": {"description": "Read balances and history", "url": "https://app.relvoerp.com/docs/product/guides/credits/#balances-and-history"}, "name": "Credit Balances & History"}, {"description": "Ingest general usage events — API calls, transactions, GMV, or any metered activity that feeds usage-based billable metrics on a contract. Batches are queued and processed asynchronously.", "name": "Usage Events"}, {"description": "Ingest seat changes (e.g. active-seat counts) that feed seat metrics on a contract.", "name": "Seat Events"}, {"description": "Read, edit, and issue invoices. A finalized invoice is immutable — corrections are made with credit and debit notes, never by editing it.", "name": "Invoices"}, {"description": "Fiscal corrections that reduce a finalized invoice.", "name": "Credit Notes"}, {"description": "Fiscal corrections that increase a finalized invoice.", "name": "Debit Notes"}, {"description": "Read payments received and how they were applied to invoices.", "name": "Payments"}, {"description": "Read the money that reached your bank accounts and is not yet matched to an invoice (pagos sin identificar): each receipt, per payer, and totals per currency.", "name": "Reconciliation"}, {"description": "Read the email sent and received on customer conversations.", "name": "Messages"}, {"description": "Revenue and receivables metrics — MRR, ARR, invoiced revenue, receivables aging, and concentration.", "name": "Reports"}, {"description": "Identify the test workspace bound to your integration key.", "externalDocs": {"description": "Developer sandbox", "url": "https://app.relvoerp.com/docs/product/guides/sandbox/"}, "name": "Sandbox"}, {"description": "Subscribe to platform events and manage the endpoints they are delivered to.", "externalDocs": {"description": "Webhooks guide: verification, signatures, retries", "url": "https://app.relvoerp.com/docs/product/guides/webhooks/"}, "name": "Webhooks"}, {"description": "The event log: every public event of the last 30 days, whether or not a webhook endpoint received it. Backfill or reconcile a webhook receiver.", "externalDocs": {"description": "Webhooks guide: the event log", "url": "https://app.relvoerp.com/docs/product/guides/webhooks/#event-log"}, "name": "Events"}, {"description": "Resolve official currency conversion rates for a date, as exact decimal strings — the same rates the billing and issuance paths use.", "name": "Currency"}, {"description": "Look up a taxpayer's registered fiscal identity (Chile: by RUT).", "name": "Taxpayers"}], "webhooks": {"contract.activated": {"post": {"description": "A contract was activated and now bills. Subscribe with `{\"event_type\": \"contract.activated\", \"schema_version\": 1}`.", "operationId": "onContractActivated", "parameters": [{"description": "Comma-separated list of `v1=<hex HMAC-SHA256>` values, each computed over `\"{Relvo-Timestamp}.{raw body}\"` with one of the endpoint's signing secrets. After a secret rotation, deliveries carry one value per still-valid secret (the new one and, for the overlap window, the previous one); accept the request when any value matches a secret you hold.", "in": "header", "name": "Relvo-Signature", "required": true, "schema": {"type": "string"}}, {"description": "Unix seconds when this attempt was signed. Rejecting values more than 5 minutes old is recommended.", "in": "header", "name": "Relvo-Timestamp", "required": true, "schema": {"type": "string"}}, {"description": "Equals the envelope `id`; stable across retries.", "in": "header", "name": "Relvo-Event-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "The delivery id (see `listWebhookDeliveries`).", "in": "header", "name": "Relvo-Delivery-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "Signature scheme version; currently `v1`.", "in": "header", "name": "Relvo-Webhook-Version", "required": true, "schema": {"type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"additionalProperties": false, "properties": {"data": {"additionalProperties": false, "description": "A contract changed lifecycle; read it for its current state.", "properties": {"contract_id": {"description": "The contract; read it with `GET /public/contracts/{contract_id}`.", "format": "uuid", "type": "string"}, "customer_id": {"description": "The contracted customer; read it with `GET /public/customers/{customer_id}`.", "format": "uuid", "type": "string"}}, "required": ["contract_id", "customer_id"], "type": "object"}, "id": {"description": "Event id, equal to the `Relvo-Event-Id` header and stable across retries and redeliveries; deduplicate on it. Readable with `GET /public/events/{event_id}`.", "format": "uuid", "type": "string"}, "occurred_at": {"format": "date-time", "type": "string"}, "organization_id": {"format": "uuid", "type": "string"}, "schema_version": {"const": 1, "type": "integer"}, "type": {"const": "contract.activated", "type": "string"}}, "required": ["id", "type", "schema_version", "occurred_at", "organization_id", "data"], "type": "object"}}}, "required": true}, "responses": {"2XX": {"description": "Accepted. 408, 429, 5xx, a network error or no answer within 10 s is retried (honouring `Retry-After`); any other status ends the delivery as `dead`."}}, "summary": "contract.activated", "tags": ["Webhooks"]}}, "contract.amended": {"post": {"description": "An active contract was amended; read it for the new terms. Subscribe with `{\"event_type\": \"contract.amended\", \"schema_version\": 1}`.", "operationId": "onContractAmended", "parameters": [{"description": "Comma-separated list of `v1=<hex HMAC-SHA256>` values, each computed over `\"{Relvo-Timestamp}.{raw body}\"` with one of the endpoint's signing secrets. After a secret rotation, deliveries carry one value per still-valid secret (the new one and, for the overlap window, the previous one); accept the request when any value matches a secret you hold.", "in": "header", "name": "Relvo-Signature", "required": true, "schema": {"type": "string"}}, {"description": "Unix seconds when this attempt was signed. Rejecting values more than 5 minutes old is recommended.", "in": "header", "name": "Relvo-Timestamp", "required": true, "schema": {"type": "string"}}, {"description": "Equals the envelope `id`; stable across retries.", "in": "header", "name": "Relvo-Event-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "The delivery id (see `listWebhookDeliveries`).", "in": "header", "name": "Relvo-Delivery-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "Signature scheme version; currently `v1`.", "in": "header", "name": "Relvo-Webhook-Version", "required": true, "schema": {"type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"additionalProperties": false, "properties": {"data": {"additionalProperties": false, "description": "A contract changed lifecycle; read it for its current state.", "properties": {"contract_id": {"description": "The contract; read it with `GET /public/contracts/{contract_id}`.", "format": "uuid", "type": "string"}, "customer_id": {"description": "The contracted customer; read it with `GET /public/customers/{customer_id}`.", "format": "uuid", "type": "string"}}, "required": ["contract_id", "customer_id"], "type": "object"}, "id": {"description": "Event id, equal to the `Relvo-Event-Id` header and stable across retries and redeliveries; deduplicate on it. Readable with `GET /public/events/{event_id}`.", "format": "uuid", "type": "string"}, "occurred_at": {"format": "date-time", "type": "string"}, "organization_id": {"format": "uuid", "type": "string"}, "schema_version": {"const": 1, "type": "integer"}, "type": {"const": "contract.amended", "type": "string"}}, "required": ["id", "type", "schema_version", "occurred_at", "organization_id", "data"], "type": "object"}}}, "required": true}, "responses": {"2XX": {"description": "Accepted. 408, 429, 5xx, a network error or no answer within 10 s is retried (honouring `Retry-After`); any other status ends the delivery as `dead`."}}, "summary": "contract.amended", "tags": ["Webhooks"]}}, "contract.cancelled": {"post": {"description": "A contract was cancelled. Subscribe with `{\"event_type\": \"contract.cancelled\", \"schema_version\": 1}`.", "operationId": "onContractCancelled", "parameters": [{"description": "Comma-separated list of `v1=<hex HMAC-SHA256>` values, each computed over `\"{Relvo-Timestamp}.{raw body}\"` with one of the endpoint's signing secrets. After a secret rotation, deliveries carry one value per still-valid secret (the new one and, for the overlap window, the previous one); accept the request when any value matches a secret you hold.", "in": "header", "name": "Relvo-Signature", "required": true, "schema": {"type": "string"}}, {"description": "Unix seconds when this attempt was signed. Rejecting values more than 5 minutes old is recommended.", "in": "header", "name": "Relvo-Timestamp", "required": true, "schema": {"type": "string"}}, {"description": "Equals the envelope `id`; stable across retries.", "in": "header", "name": "Relvo-Event-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "The delivery id (see `listWebhookDeliveries`).", "in": "header", "name": "Relvo-Delivery-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "Signature scheme version; currently `v1`.", "in": "header", "name": "Relvo-Webhook-Version", "required": true, "schema": {"type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"additionalProperties": false, "properties": {"data": {"additionalProperties": false, "description": "A contract changed lifecycle; read it for its current state.", "properties": {"contract_id": {"description": "The contract; read it with `GET /public/contracts/{contract_id}`.", "format": "uuid", "type": "string"}, "customer_id": {"description": "The contracted customer; read it with `GET /public/customers/{customer_id}`.", "format": "uuid", "type": "string"}}, "required": ["contract_id", "customer_id"], "type": "object"}, "id": {"description": "Event id, equal to the `Relvo-Event-Id` header and stable across retries and redeliveries; deduplicate on it. Readable with `GET /public/events/{event_id}`.", "format": "uuid", "type": "string"}, "occurred_at": {"format": "date-time", "type": "string"}, "organization_id": {"format": "uuid", "type": "string"}, "schema_version": {"const": 1, "type": "integer"}, "type": {"const": "contract.cancelled", "type": "string"}}, "required": ["id", "type", "schema_version", "occurred_at", "organization_id", "data"], "type": "object"}}}, "required": true}, "responses": {"2XX": {"description": "Accepted. 408, 429, 5xx, a network error or no answer within 10 s is retried (honouring `Retry-After`); any other status ends the delivery as `dead`."}}, "summary": "contract.cancelled", "tags": ["Webhooks"]}}, "credit_note.fiscal_rejected": {"post": {"description": "The tax authority rejected a credit note. Subscribe with `{\"event_type\": \"credit_note.fiscal_rejected\", \"schema_version\": 1}`.", "operationId": "onCreditNoteFiscalRejected", "parameters": [{"description": "Comma-separated list of `v1=<hex HMAC-SHA256>` values, each computed over `\"{Relvo-Timestamp}.{raw body}\"` with one of the endpoint's signing secrets. After a secret rotation, deliveries carry one value per still-valid secret (the new one and, for the overlap window, the previous one); accept the request when any value matches a secret you hold.", "in": "header", "name": "Relvo-Signature", "required": true, "schema": {"type": "string"}}, {"description": "Unix seconds when this attempt was signed. Rejecting values more than 5 minutes old is recommended.", "in": "header", "name": "Relvo-Timestamp", "required": true, "schema": {"type": "string"}}, {"description": "Equals the envelope `id`; stable across retries.", "in": "header", "name": "Relvo-Event-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "The delivery id (see `listWebhookDeliveries`).", "in": "header", "name": "Relvo-Delivery-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "Signature scheme version; currently `v1`.", "in": "header", "name": "Relvo-Webhook-Version", "required": true, "schema": {"type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"additionalProperties": false, "properties": {"data": {"additionalProperties": false, "description": "The tax authority rejected a credit note.", "properties": {"credit_note_id": {"description": "The credit note.", "format": "uuid", "type": "string"}, "rejection_reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Authority message explaining the rejection."}, "source_invoice_id": {"description": "The invoice the credit note corrects.", "format": "uuid", "type": "string"}}, "required": ["credit_note_id", "source_invoice_id", "rejection_reason"], "type": "object"}, "id": {"description": "Event id, equal to the `Relvo-Event-Id` header and stable across retries and redeliveries; deduplicate on it. Readable with `GET /public/events/{event_id}`.", "format": "uuid", "type": "string"}, "occurred_at": {"format": "date-time", "type": "string"}, "organization_id": {"format": "uuid", "type": "string"}, "schema_version": {"const": 1, "type": "integer"}, "type": {"const": "credit_note.fiscal_rejected", "type": "string"}}, "required": ["id", "type", "schema_version", "occurred_at", "organization_id", "data"], "type": "object"}}}, "required": true}, "responses": {"2XX": {"description": "Accepted. 408, 429, 5xx, a network error or no answer within 10 s is retried (honouring `Retry-After`); any other status ends the delivery as `dead`."}}, "summary": "credit_note.fiscal_rejected", "tags": ["Webhooks"]}}, "credit_note.issued": {"post": {"description": "The tax authority accepted a credit note. Subscribe with `{\"event_type\": \"credit_note.issued\", \"schema_version\": 1}`.", "operationId": "onCreditNoteIssued", "parameters": [{"description": "Comma-separated list of `v1=<hex HMAC-SHA256>` values, each computed over `\"{Relvo-Timestamp}.{raw body}\"` with one of the endpoint's signing secrets. After a secret rotation, deliveries carry one value per still-valid secret (the new one and, for the overlap window, the previous one); accept the request when any value matches a secret you hold.", "in": "header", "name": "Relvo-Signature", "required": true, "schema": {"type": "string"}}, {"description": "Unix seconds when this attempt was signed. Rejecting values more than 5 minutes old is recommended.", "in": "header", "name": "Relvo-Timestamp", "required": true, "schema": {"type": "string"}}, {"description": "Equals the envelope `id`; stable across retries.", "in": "header", "name": "Relvo-Event-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "The delivery id (see `listWebhookDeliveries`).", "in": "header", "name": "Relvo-Delivery-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "Signature scheme version; currently `v1`.", "in": "header", "name": "Relvo-Webhook-Version", "required": true, "schema": {"type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"additionalProperties": false, "properties": {"data": {"additionalProperties": false, "description": "The tax authority accepted a credit note.", "properties": {"credit_note_id": {"description": "The credit note.", "format": "uuid", "type": "string"}, "fiscal_uuid": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Tax authority document id, when the provider gives one."}, "folio": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Fiscal folio number."}, "source_invoice_id": {"description": "The invoice the credit note corrects.", "format": "uuid", "type": "string"}}, "required": ["credit_note_id", "source_invoice_id", "fiscal_uuid", "folio"], "type": "object"}, "id": {"description": "Event id, equal to the `Relvo-Event-Id` header and stable across retries and redeliveries; deduplicate on it. Readable with `GET /public/events/{event_id}`.", "format": "uuid", "type": "string"}, "occurred_at": {"format": "date-time", "type": "string"}, "organization_id": {"format": "uuid", "type": "string"}, "schema_version": {"const": 1, "type": "integer"}, "type": {"const": "credit_note.issued", "type": "string"}}, "required": ["id", "type", "schema_version", "occurred_at", "organization_id", "data"], "type": "object"}}}, "required": true}, "responses": {"2XX": {"description": "Accepted. 408, 429, 5xx, a network error or no answer within 10 s is retried (honouring `Retry-After`); any other status ends the delivery as `dead`."}}, "summary": "credit_note.issued", "tags": ["Webhooks"]}}, "customer.created": {"post": {"description": "A customer was created. Subscribe with `{\"event_type\": \"customer.created\", \"schema_version\": 1}`.", "operationId": "onCustomerCreated", "parameters": [{"description": "Comma-separated list of `v1=<hex HMAC-SHA256>` values, each computed over `\"{Relvo-Timestamp}.{raw body}\"` with one of the endpoint's signing secrets. After a secret rotation, deliveries carry one value per still-valid secret (the new one and, for the overlap window, the previous one); accept the request when any value matches a secret you hold.", "in": "header", "name": "Relvo-Signature", "required": true, "schema": {"type": "string"}}, {"description": "Unix seconds when this attempt was signed. Rejecting values more than 5 minutes old is recommended.", "in": "header", "name": "Relvo-Timestamp", "required": true, "schema": {"type": "string"}}, {"description": "Equals the envelope `id`; stable across retries.", "in": "header", "name": "Relvo-Event-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "The delivery id (see `listWebhookDeliveries`).", "in": "header", "name": "Relvo-Delivery-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "Signature scheme version; currently `v1`.", "in": "header", "name": "Relvo-Webhook-Version", "required": true, "schema": {"type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"additionalProperties": false, "properties": {"data": {"additionalProperties": false, "description": "A customer changed; read it for its current state.", "properties": {"customer_id": {"description": "The customer; read it with `GET /public/customers/{customer_id}`. After `customer.deleted` the read returns `404`.", "format": "uuid", "type": "string"}}, "required": ["customer_id"], "type": "object"}, "id": {"description": "Event id, equal to the `Relvo-Event-Id` header and stable across retries and redeliveries; deduplicate on it. Readable with `GET /public/events/{event_id}`.", "format": "uuid", "type": "string"}, "occurred_at": {"format": "date-time", "type": "string"}, "organization_id": {"format": "uuid", "type": "string"}, "schema_version": {"const": 1, "type": "integer"}, "type": {"const": "customer.created", "type": "string"}}, "required": ["id", "type", "schema_version", "occurred_at", "organization_id", "data"], "type": "object"}}}, "required": true}, "responses": {"2XX": {"description": "Accepted. 408, 429, 5xx, a network error or no answer within 10 s is retried (honouring `Retry-After`); any other status ends the delivery as `dead`."}}, "summary": "customer.created", "tags": ["Webhooks"]}}, "customer.deleted": {"post": {"description": "A customer was deleted. Subscribe with `{\"event_type\": \"customer.deleted\", \"schema_version\": 1}`.", "operationId": "onCustomerDeleted", "parameters": [{"description": "Comma-separated list of `v1=<hex HMAC-SHA256>` values, each computed over `\"{Relvo-Timestamp}.{raw body}\"` with one of the endpoint's signing secrets. After a secret rotation, deliveries carry one value per still-valid secret (the new one and, for the overlap window, the previous one); accept the request when any value matches a secret you hold.", "in": "header", "name": "Relvo-Signature", "required": true, "schema": {"type": "string"}}, {"description": "Unix seconds when this attempt was signed. Rejecting values more than 5 minutes old is recommended.", "in": "header", "name": "Relvo-Timestamp", "required": true, "schema": {"type": "string"}}, {"description": "Equals the envelope `id`; stable across retries.", "in": "header", "name": "Relvo-Event-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "The delivery id (see `listWebhookDeliveries`).", "in": "header", "name": "Relvo-Delivery-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "Signature scheme version; currently `v1`.", "in": "header", "name": "Relvo-Webhook-Version", "required": true, "schema": {"type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"additionalProperties": false, "properties": {"data": {"additionalProperties": false, "description": "A customer changed; read it for its current state.", "properties": {"customer_id": {"description": "The customer; read it with `GET /public/customers/{customer_id}`. After `customer.deleted` the read returns `404`.", "format": "uuid", "type": "string"}}, "required": ["customer_id"], "type": "object"}, "id": {"description": "Event id, equal to the `Relvo-Event-Id` header and stable across retries and redeliveries; deduplicate on it. Readable with `GET /public/events/{event_id}`.", "format": "uuid", "type": "string"}, "occurred_at": {"format": "date-time", "type": "string"}, "organization_id": {"format": "uuid", "type": "string"}, "schema_version": {"const": 1, "type": "integer"}, "type": {"const": "customer.deleted", "type": "string"}}, "required": ["id", "type", "schema_version", "occurred_at", "organization_id", "data"], "type": "object"}}}, "required": true}, "responses": {"2XX": {"description": "Accepted. 408, 429, 5xx, a network error or no answer within 10 s is retried (honouring `Retry-After`); any other status ends the delivery as `dead`."}}, "summary": "customer.deleted", "tags": ["Webhooks"]}}, "customer.updated": {"post": {"description": "A customer's code, name, external references or default billing entity changed. Subscribe with `{\"event_type\": \"customer.updated\", \"schema_version\": 1}`.", "operationId": "onCustomerUpdated", "parameters": [{"description": "Comma-separated list of `v1=<hex HMAC-SHA256>` values, each computed over `\"{Relvo-Timestamp}.{raw body}\"` with one of the endpoint's signing secrets. After a secret rotation, deliveries carry one value per still-valid secret (the new one and, for the overlap window, the previous one); accept the request when any value matches a secret you hold.", "in": "header", "name": "Relvo-Signature", "required": true, "schema": {"type": "string"}}, {"description": "Unix seconds when this attempt was signed. Rejecting values more than 5 minutes old is recommended.", "in": "header", "name": "Relvo-Timestamp", "required": true, "schema": {"type": "string"}}, {"description": "Equals the envelope `id`; stable across retries.", "in": "header", "name": "Relvo-Event-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "The delivery id (see `listWebhookDeliveries`).", "in": "header", "name": "Relvo-Delivery-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "Signature scheme version; currently `v1`.", "in": "header", "name": "Relvo-Webhook-Version", "required": true, "schema": {"type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"additionalProperties": false, "properties": {"data": {"additionalProperties": false, "description": "A customer changed; read it for its current state.", "properties": {"customer_id": {"description": "The customer; read it with `GET /public/customers/{customer_id}`. After `customer.deleted` the read returns `404`.", "format": "uuid", "type": "string"}}, "required": ["customer_id"], "type": "object"}, "id": {"description": "Event id, equal to the `Relvo-Event-Id` header and stable across retries and redeliveries; deduplicate on it. Readable with `GET /public/events/{event_id}`.", "format": "uuid", "type": "string"}, "occurred_at": {"format": "date-time", "type": "string"}, "organization_id": {"format": "uuid", "type": "string"}, "schema_version": {"const": 1, "type": "integer"}, "type": {"const": "customer.updated", "type": "string"}}, "required": ["id", "type", "schema_version", "occurred_at", "organization_id", "data"], "type": "object"}}}, "required": true}, "responses": {"2XX": {"description": "Accepted. 408, 429, 5xx, a network error or no answer within 10 s is retried (honouring `Retry-After`); any other status ends the delivery as `dead`."}}, "summary": "customer.updated", "tags": ["Webhooks"]}}, "debit_note.fiscal_rejected": {"post": {"description": "The tax authority rejected a debit note. Subscribe with `{\"event_type\": \"debit_note.fiscal_rejected\", \"schema_version\": 1}`.", "operationId": "onDebitNoteFiscalRejected", "parameters": [{"description": "Comma-separated list of `v1=<hex HMAC-SHA256>` values, each computed over `\"{Relvo-Timestamp}.{raw body}\"` with one of the endpoint's signing secrets. After a secret rotation, deliveries carry one value per still-valid secret (the new one and, for the overlap window, the previous one); accept the request when any value matches a secret you hold.", "in": "header", "name": "Relvo-Signature", "required": true, "schema": {"type": "string"}}, {"description": "Unix seconds when this attempt was signed. Rejecting values more than 5 minutes old is recommended.", "in": "header", "name": "Relvo-Timestamp", "required": true, "schema": {"type": "string"}}, {"description": "Equals the envelope `id`; stable across retries.", "in": "header", "name": "Relvo-Event-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "The delivery id (see `listWebhookDeliveries`).", "in": "header", "name": "Relvo-Delivery-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "Signature scheme version; currently `v1`.", "in": "header", "name": "Relvo-Webhook-Version", "required": true, "schema": {"type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"additionalProperties": false, "properties": {"data": {"additionalProperties": false, "description": "The tax authority rejected a debit note.", "properties": {"debit_note_id": {"description": "The debit note.", "format": "uuid", "type": "string"}, "rejection_reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Authority message explaining the rejection."}, "source_invoice_id": {"description": "The invoice the debit note corrects.", "format": "uuid", "type": "string"}}, "required": ["debit_note_id", "source_invoice_id", "rejection_reason"], "type": "object"}, "id": {"description": "Event id, equal to the `Relvo-Event-Id` header and stable across retries and redeliveries; deduplicate on it. Readable with `GET /public/events/{event_id}`.", "format": "uuid", "type": "string"}, "occurred_at": {"format": "date-time", "type": "string"}, "organization_id": {"format": "uuid", "type": "string"}, "schema_version": {"const": 1, "type": "integer"}, "type": {"const": "debit_note.fiscal_rejected", "type": "string"}}, "required": ["id", "type", "schema_version", "occurred_at", "organization_id", "data"], "type": "object"}}}, "required": true}, "responses": {"2XX": {"description": "Accepted. 408, 429, 5xx, a network error or no answer within 10 s is retried (honouring `Retry-After`); any other status ends the delivery as `dead`."}}, "summary": "debit_note.fiscal_rejected", "tags": ["Webhooks"]}}, "debit_note.issued": {"post": {"description": "The tax authority accepted a debit note. Subscribe with `{\"event_type\": \"debit_note.issued\", \"schema_version\": 1}`.", "operationId": "onDebitNoteIssued", "parameters": [{"description": "Comma-separated list of `v1=<hex HMAC-SHA256>` values, each computed over `\"{Relvo-Timestamp}.{raw body}\"` with one of the endpoint's signing secrets. After a secret rotation, deliveries carry one value per still-valid secret (the new one and, for the overlap window, the previous one); accept the request when any value matches a secret you hold.", "in": "header", "name": "Relvo-Signature", "required": true, "schema": {"type": "string"}}, {"description": "Unix seconds when this attempt was signed. Rejecting values more than 5 minutes old is recommended.", "in": "header", "name": "Relvo-Timestamp", "required": true, "schema": {"type": "string"}}, {"description": "Equals the envelope `id`; stable across retries.", "in": "header", "name": "Relvo-Event-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "The delivery id (see `listWebhookDeliveries`).", "in": "header", "name": "Relvo-Delivery-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "Signature scheme version; currently `v1`.", "in": "header", "name": "Relvo-Webhook-Version", "required": true, "schema": {"type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"additionalProperties": false, "properties": {"data": {"additionalProperties": false, "description": "The tax authority accepted a debit note.", "properties": {"debit_note_id": {"description": "The debit note.", "format": "uuid", "type": "string"}, "fiscal_uuid": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Tax authority document id, when the provider gives one."}, "folio": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Fiscal folio number."}, "source_invoice_id": {"description": "The invoice the debit note corrects.", "format": "uuid", "type": "string"}}, "required": ["debit_note_id", "source_invoice_id", "fiscal_uuid", "folio"], "type": "object"}, "id": {"description": "Event id, equal to the `Relvo-Event-Id` header and stable across retries and redeliveries; deduplicate on it. Readable with `GET /public/events/{event_id}`.", "format": "uuid", "type": "string"}, "occurred_at": {"format": "date-time", "type": "string"}, "organization_id": {"format": "uuid", "type": "string"}, "schema_version": {"const": 1, "type": "integer"}, "type": {"const": "debit_note.issued", "type": "string"}}, "required": ["id", "type", "schema_version", "occurred_at", "organization_id", "data"], "type": "object"}}}, "required": true}, "responses": {"2XX": {"description": "Accepted. 408, 429, 5xx, a network error or no answer within 10 s is retried (honouring `Retry-After`); any other status ends the delivery as `dead`."}}, "summary": "debit_note.issued", "tags": ["Webhooks"]}}, "invoice.drafted": {"post": {"description": "A draft invoice was created and awaits review before issuance. Subscribe with `{\"event_type\": \"invoice.drafted\", \"schema_version\": 1}`.", "operationId": "onInvoiceDrafted", "parameters": [{"description": "Comma-separated list of `v1=<hex HMAC-SHA256>` values, each computed over `\"{Relvo-Timestamp}.{raw body}\"` with one of the endpoint's signing secrets. After a secret rotation, deliveries carry one value per still-valid secret (the new one and, for the overlap window, the previous one); accept the request when any value matches a secret you hold.", "in": "header", "name": "Relvo-Signature", "required": true, "schema": {"type": "string"}}, {"description": "Unix seconds when this attempt was signed. Rejecting values more than 5 minutes old is recommended.", "in": "header", "name": "Relvo-Timestamp", "required": true, "schema": {"type": "string"}}, {"description": "Equals the envelope `id`; stable across retries.", "in": "header", "name": "Relvo-Event-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "The delivery id (see `listWebhookDeliveries`).", "in": "header", "name": "Relvo-Delivery-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "Signature scheme version; currently `v1`.", "in": "header", "name": "Relvo-Webhook-Version", "required": true, "schema": {"type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"additionalProperties": false, "properties": {"data": {"additionalProperties": false, "description": "A draft invoice was created and awaits review before issuance.", "properties": {"invoice_id": {"description": "The draft invoice; read it with `GET /public/invoices/{invoice_id}`.", "format": "uuid", "type": "string"}}, "required": ["invoice_id"], "type": "object"}, "id": {"description": "Event id, equal to the `Relvo-Event-Id` header and stable across retries and redeliveries; deduplicate on it. Readable with `GET /public/events/{event_id}`.", "format": "uuid", "type": "string"}, "occurred_at": {"format": "date-time", "type": "string"}, "organization_id": {"format": "uuid", "type": "string"}, "schema_version": {"const": 1, "type": "integer"}, "type": {"const": "invoice.drafted", "type": "string"}}, "required": ["id", "type", "schema_version", "occurred_at", "organization_id", "data"], "type": "object"}}}, "required": true}, "responses": {"2XX": {"description": "Accepted. 408, 429, 5xx, a network error or no answer within 10 s is retried (honouring `Retry-After`); any other status ends the delivery as `dead`."}}, "summary": "invoice.drafted", "tags": ["Webhooks"]}}, "invoice.fiscal_rejected": {"post": {"description": "The tax authority rejected an invoice. Subscribe with `{\"event_type\": \"invoice.fiscal_rejected\", \"schema_version\": 1}`.", "operationId": "onInvoiceFiscalRejected", "parameters": [{"description": "Comma-separated list of `v1=<hex HMAC-SHA256>` values, each computed over `\"{Relvo-Timestamp}.{raw body}\"` with one of the endpoint's signing secrets. After a secret rotation, deliveries carry one value per still-valid secret (the new one and, for the overlap window, the previous one); accept the request when any value matches a secret you hold.", "in": "header", "name": "Relvo-Signature", "required": true, "schema": {"type": "string"}}, {"description": "Unix seconds when this attempt was signed. Rejecting values more than 5 minutes old is recommended.", "in": "header", "name": "Relvo-Timestamp", "required": true, "schema": {"type": "string"}}, {"description": "Equals the envelope `id`; stable across retries.", "in": "header", "name": "Relvo-Event-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "The delivery id (see `listWebhookDeliveries`).", "in": "header", "name": "Relvo-Delivery-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "Signature scheme version; currently `v1`.", "in": "header", "name": "Relvo-Webhook-Version", "required": true, "schema": {"type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"additionalProperties": false, "properties": {"data": {"additionalProperties": false, "description": "The tax authority rejected an invoice, or the customer claimed it.", "properties": {"invoice_id": {"description": "The invoice; read it with `GET /public/invoices/{invoice_id}`.", "format": "uuid", "type": "string"}, "rejection_reason": {"description": "Authority message or customer claim code explaining the rejection.", "type": "string"}, "rejection_source": {"anyOf": [{"description": "Who rejected the invoice.\n\n- `tax_authority`: the tax authority refused the document.\n- `customer_claim`: the customer claimed the accepted document before the tax\n  authority's deadline, which voids its fiscal acceptance.\n- `imported`: the document was already rejected when it was imported.", "enum": ["tax_authority", "customer_claim", "imported"], "type": "string"}, {"type": "null"}], "default": null, "description": "Who rejected the invoice; `null` when it was not recorded."}}, "required": ["invoice_id", "rejection_reason"], "type": "object"}, "id": {"description": "Event id, equal to the `Relvo-Event-Id` header and stable across retries and redeliveries; deduplicate on it. Readable with `GET /public/events/{event_id}`.", "format": "uuid", "type": "string"}, "occurred_at": {"format": "date-time", "type": "string"}, "organization_id": {"format": "uuid", "type": "string"}, "schema_version": {"const": 1, "type": "integer"}, "type": {"const": "invoice.fiscal_rejected", "type": "string"}}, "required": ["id", "type", "schema_version", "occurred_at", "organization_id", "data"], "type": "object"}}}, "required": true}, "responses": {"2XX": {"description": "Accepted. 408, 429, 5xx, a network error or no answer within 10 s is retried (honouring `Retry-After`); any other status ends the delivery as `dead`."}}, "summary": "invoice.fiscal_rejected", "tags": ["Webhooks"]}}, "invoice.issued": {"post": {"description": "The tax authority accepted an invoice; it is now fiscally issued. Subscribe with `{\"event_type\": \"invoice.issued\", \"schema_version\": 1}`.", "operationId": "onInvoiceIssued", "parameters": [{"description": "Comma-separated list of `v1=<hex HMAC-SHA256>` values, each computed over `\"{Relvo-Timestamp}.{raw body}\"` with one of the endpoint's signing secrets. After a secret rotation, deliveries carry one value per still-valid secret (the new one and, for the overlap window, the previous one); accept the request when any value matches a secret you hold.", "in": "header", "name": "Relvo-Signature", "required": true, "schema": {"type": "string"}}, {"description": "Unix seconds when this attempt was signed. Rejecting values more than 5 minutes old is recommended.", "in": "header", "name": "Relvo-Timestamp", "required": true, "schema": {"type": "string"}}, {"description": "Equals the envelope `id`; stable across retries.", "in": "header", "name": "Relvo-Event-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "The delivery id (see `listWebhookDeliveries`).", "in": "header", "name": "Relvo-Delivery-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "Signature scheme version; currently `v1`.", "in": "header", "name": "Relvo-Webhook-Version", "required": true, "schema": {"type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"additionalProperties": false, "properties": {"data": {"additionalProperties": false, "description": "The tax authority accepted an invoice; it is now fiscally issued.", "properties": {"fiscal_uuid": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Tax authority document id, when the provider gives one."}, "folio": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Fiscal folio number."}, "invoice_id": {"description": "The invoice; read it with `GET /public/invoices/{invoice_id}`.", "format": "uuid", "type": "string"}}, "required": ["invoice_id", "fiscal_uuid", "folio"], "type": "object"}, "id": {"description": "Event id, equal to the `Relvo-Event-Id` header and stable across retries and redeliveries; deduplicate on it. Readable with `GET /public/events/{event_id}`.", "format": "uuid", "type": "string"}, "occurred_at": {"format": "date-time", "type": "string"}, "organization_id": {"format": "uuid", "type": "string"}, "schema_version": {"const": 1, "type": "integer"}, "type": {"const": "invoice.issued", "type": "string"}}, "required": ["id", "type", "schema_version", "occurred_at", "organization_id", "data"], "type": "object"}}}, "required": true}, "responses": {"2XX": {"description": "Accepted. 408, 429, 5xx, a network error or no answer within 10 s is retried (honouring `Retry-After`); any other status ends the delivery as `dead`."}}, "summary": "invoice.issued", "tags": ["Webhooks"]}}, "invoice.paid": {"post": {"description": "An invoice became fully paid. Subscribe with `{\"event_type\": \"invoice.paid\", \"schema_version\": 1}`.", "operationId": "onInvoicePaid", "parameters": [{"description": "Comma-separated list of `v1=<hex HMAC-SHA256>` values, each computed over `\"{Relvo-Timestamp}.{raw body}\"` with one of the endpoint's signing secrets. After a secret rotation, deliveries carry one value per still-valid secret (the new one and, for the overlap window, the previous one); accept the request when any value matches a secret you hold.", "in": "header", "name": "Relvo-Signature", "required": true, "schema": {"type": "string"}}, {"description": "Unix seconds when this attempt was signed. Rejecting values more than 5 minutes old is recommended.", "in": "header", "name": "Relvo-Timestamp", "required": true, "schema": {"type": "string"}}, {"description": "Equals the envelope `id`; stable across retries.", "in": "header", "name": "Relvo-Event-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "The delivery id (see `listWebhookDeliveries`).", "in": "header", "name": "Relvo-Delivery-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "Signature scheme version; currently `v1`.", "in": "header", "name": "Relvo-Webhook-Version", "required": true, "schema": {"type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"additionalProperties": false, "properties": {"data": {"additionalProperties": false, "description": "An invoice became fully paid.", "properties": {"currency": {"description": "ISO 4217 currency code of the amount, uppercase.", "pattern": "^[A-Z]{3}$", "type": "string"}, "invoice_id": {"description": "The invoice; read it with `GET /public/invoices/{invoice_id}`.", "format": "uuid", "type": "string"}, "paid_at": {"description": "When the invoice became fully paid.", "format": "date-time", "type": "string"}, "total_amount": {"description": "The invoice total that is now paid, as a decimal string.", "pattern": "^\\d+(\\.\\d+)?$", "type": "string"}}, "required": ["invoice_id", "total_amount", "currency", "paid_at"], "type": "object"}, "id": {"description": "Event id, equal to the `Relvo-Event-Id` header and stable across retries and redeliveries; deduplicate on it. Readable with `GET /public/events/{event_id}`.", "format": "uuid", "type": "string"}, "occurred_at": {"format": "date-time", "type": "string"}, "organization_id": {"format": "uuid", "type": "string"}, "schema_version": {"const": 1, "type": "integer"}, "type": {"const": "invoice.paid", "type": "string"}}, "required": ["id", "type", "schema_version", "occurred_at", "organization_id", "data"], "type": "object"}}}, "required": true}, "responses": {"2XX": {"description": "Accepted. 408, 429, 5xx, a network error or no answer within 10 s is retried (honouring `Retry-After`); any other status ends the delivery as `dead`."}}, "summary": "invoice.paid", "tags": ["Webhooks"]}}, "invoice.payment_received": {"post": {"description": "A payment was applied to an invoice. `amount_paid` is the cumulative paid amount; a payment that is later reversed sends no event, so read the invoice for its current balance. Subscribe with `{\"event_type\": \"invoice.payment_received\", \"schema_version\": 1}`.", "operationId": "onInvoicePaymentReceived", "parameters": [{"description": "Comma-separated list of `v1=<hex HMAC-SHA256>` values, each computed over `\"{Relvo-Timestamp}.{raw body}\"` with one of the endpoint's signing secrets. After a secret rotation, deliveries carry one value per still-valid secret (the new one and, for the overlap window, the previous one); accept the request when any value matches a secret you hold.", "in": "header", "name": "Relvo-Signature", "required": true, "schema": {"type": "string"}}, {"description": "Unix seconds when this attempt was signed. Rejecting values more than 5 minutes old is recommended.", "in": "header", "name": "Relvo-Timestamp", "required": true, "schema": {"type": "string"}}, {"description": "Equals the envelope `id`; stable across retries.", "in": "header", "name": "Relvo-Event-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "The delivery id (see `listWebhookDeliveries`).", "in": "header", "name": "Relvo-Delivery-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "Signature scheme version; currently `v1`.", "in": "header", "name": "Relvo-Webhook-Version", "required": true, "schema": {"type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"additionalProperties": false, "properties": {"data": {"additionalProperties": false, "description": "A payment was applied to an invoice.", "properties": {"amount_paid": {"description": "Cumulative amount paid on the invoice after this payment, as a decimal string — not the amount of this payment alone.", "pattern": "^\\d+(\\.\\d+)?$", "type": "string"}, "currency": {"description": "ISO 4217 currency code of the amount, uppercase.", "pattern": "^[A-Z]{3}$", "type": "string"}, "invoice_id": {"description": "The invoice; read it with `GET /public/invoices/{invoice_id}`.", "format": "uuid", "type": "string"}, "payment_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "The payment that was applied, when the payment was recorded in Relvo."}, "payment_status": {"description": "How much of the invoice's balance is paid after this change.\n\n- `unpaid`: no payment applied.\n- `partially_paid`: some, but not all, of the amount owed is paid.\n- `paid`: the amount owed is fully paid.", "enum": ["unpaid", "partially_paid", "paid"], "type": "string"}}, "required": ["invoice_id", "amount_paid", "currency", "payment_status", "payment_id"], "type": "object"}, "id": {"description": "Event id, equal to the `Relvo-Event-Id` header and stable across retries and redeliveries; deduplicate on it. Readable with `GET /public/events/{event_id}`.", "format": "uuid", "type": "string"}, "occurred_at": {"format": "date-time", "type": "string"}, "organization_id": {"format": "uuid", "type": "string"}, "schema_version": {"const": 1, "type": "integer"}, "type": {"const": "invoice.payment_received", "type": "string"}}, "required": ["id", "type", "schema_version", "occurred_at", "organization_id", "data"], "type": "object"}}}, "required": true}, "responses": {"2XX": {"description": "Accepted. 408, 429, 5xx, a network error or no answer within 10 s is retried (honouring `Retry-After`); any other status ends the delivery as `dead`."}}, "summary": "invoice.payment_received", "tags": ["Webhooks"]}}, "invoice.voided": {"post": {"description": "An issued invoice was voided by an accepted correction document. Subscribe with `{\"event_type\": \"invoice.voided\", \"schema_version\": 1}`.", "operationId": "onInvoiceVoided", "parameters": [{"description": "Comma-separated list of `v1=<hex HMAC-SHA256>` values, each computed over `\"{Relvo-Timestamp}.{raw body}\"` with one of the endpoint's signing secrets. After a secret rotation, deliveries carry one value per still-valid secret (the new one and, for the overlap window, the previous one); accept the request when any value matches a secret you hold.", "in": "header", "name": "Relvo-Signature", "required": true, "schema": {"type": "string"}}, {"description": "Unix seconds when this attempt was signed. Rejecting values more than 5 minutes old is recommended.", "in": "header", "name": "Relvo-Timestamp", "required": true, "schema": {"type": "string"}}, {"description": "Equals the envelope `id`; stable across retries.", "in": "header", "name": "Relvo-Event-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "The delivery id (see `listWebhookDeliveries`).", "in": "header", "name": "Relvo-Delivery-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "Signature scheme version; currently `v1`.", "in": "header", "name": "Relvo-Webhook-Version", "required": true, "schema": {"type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"additionalProperties": false, "properties": {"data": {"additionalProperties": false, "description": "An issued invoice was voided by an accepted correction document.", "properties": {"credit_note_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "The accepted credit note that voided the invoice, when exactly one did."}, "invoice_id": {"description": "The voided invoice; read it with `GET /public/invoices/{invoice_id}`.", "format": "uuid", "type": "string"}}, "required": ["invoice_id", "credit_note_id"], "type": "object"}, "id": {"description": "Event id, equal to the `Relvo-Event-Id` header and stable across retries and redeliveries; deduplicate on it. Readable with `GET /public/events/{event_id}`.", "format": "uuid", "type": "string"}, "occurred_at": {"format": "date-time", "type": "string"}, "organization_id": {"format": "uuid", "type": "string"}, "schema_version": {"const": 1, "type": "integer"}, "type": {"const": "invoice.voided", "type": "string"}}, "required": ["id", "type", "schema_version", "occurred_at", "organization_id", "data"], "type": "object"}}}, "required": true}, "responses": {"2XX": {"description": "Accepted. 408, 429, 5xx, a network error or no answer within 10 s is retried (honouring `Retry-After`); any other status ends the delivery as `dead`."}}, "summary": "invoice.voided", "tags": ["Webhooks"]}}, "message.received": {"post": {"description": "An inbound email reached the organization's messaging inbox. Subscribe with `{\"event_type\": \"message.received\", \"schema_version\": 1}`.", "operationId": "onMessageReceived", "parameters": [{"description": "Comma-separated list of `v1=<hex HMAC-SHA256>` values, each computed over `\"{Relvo-Timestamp}.{raw body}\"` with one of the endpoint's signing secrets. After a secret rotation, deliveries carry one value per still-valid secret (the new one and, for the overlap window, the previous one); accept the request when any value matches a secret you hold.", "in": "header", "name": "Relvo-Signature", "required": true, "schema": {"type": "string"}}, {"description": "Unix seconds when this attempt was signed. Rejecting values more than 5 minutes old is recommended.", "in": "header", "name": "Relvo-Timestamp", "required": true, "schema": {"type": "string"}}, {"description": "Equals the envelope `id`; stable across retries.", "in": "header", "name": "Relvo-Event-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "The delivery id (see `listWebhookDeliveries`).", "in": "header", "name": "Relvo-Delivery-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "Signature scheme version; currently `v1`.", "in": "header", "name": "Relvo-Webhook-Version", "required": true, "schema": {"type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"additionalProperties": false, "properties": {"data": {"additionalProperties": false, "description": "An inbound email reached the organization's messaging inbox.", "properties": {"attachments": {"description": "Attachment metadata only; content is never included.", "items": {"additionalProperties": false, "description": "Attachment metadata named at receipt; content is never included.", "properties": {"content_type": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "MIME type declared by the sender, when present."}, "filename": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Attachment file name as sent, when present."}, "id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "Attachment id listed by `GET /public/messages/{message_id}`; null for messages ingested before ids were allocated."}}, "required": ["id", "filename", "content_type"], "type": "object"}, "type": "array"}, "conversation_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "The conversation the message was threaded into, when known."}, "invoice_ids": {"description": "Invoices the message was matched to.", "items": {"format": "uuid", "type": "string"}, "type": "array"}, "message_id": {"description": "The message; read it with `GET /public/messages/{message_id}`.", "format": "uuid", "type": "string"}, "received_at": {"description": "When the message was received.", "format": "date-time", "type": "string"}, "sender_email": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Sender address, when known."}, "subject": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Email subject line, when present."}, "text_preview": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Short plain-text excerpt of the body, when present."}}, "required": ["message_id", "conversation_id", "received_at", "sender_email", "subject", "text_preview", "attachments", "invoice_ids"], "type": "object"}, "id": {"description": "Event id, equal to the `Relvo-Event-Id` header and stable across retries and redeliveries; deduplicate on it. Readable with `GET /public/events/{event_id}`.", "format": "uuid", "type": "string"}, "occurred_at": {"format": "date-time", "type": "string"}, "organization_id": {"format": "uuid", "type": "string"}, "schema_version": {"const": 1, "type": "integer"}, "type": {"const": "message.received", "type": "string"}}, "required": ["id", "type", "schema_version", "occurred_at", "organization_id", "data"], "type": "object"}}}, "required": true}, "responses": {"2XX": {"description": "Accepted. 408, 429, 5xx, a network error or no answer within 10 s is retried (honouring `Retry-After`); any other status ends the delivery as `dead`."}}, "summary": "message.received", "tags": ["Webhooks"]}}, "payment.succeeded": {"post": {"description": "A payment was confirmed as received. It may not be applied to an invoice yet; each application sends `invoice.payment_received`. Subscribe with `{\"event_type\": \"payment.succeeded\", \"schema_version\": 1}`.", "operationId": "onPaymentSucceeded", "parameters": [{"description": "Comma-separated list of `v1=<hex HMAC-SHA256>` values, each computed over `\"{Relvo-Timestamp}.{raw body}\"` with one of the endpoint's signing secrets. After a secret rotation, deliveries carry one value per still-valid secret (the new one and, for the overlap window, the previous one); accept the request when any value matches a secret you hold.", "in": "header", "name": "Relvo-Signature", "required": true, "schema": {"type": "string"}}, {"description": "Unix seconds when this attempt was signed. Rejecting values more than 5 minutes old is recommended.", "in": "header", "name": "Relvo-Timestamp", "required": true, "schema": {"type": "string"}}, {"description": "Equals the envelope `id`; stable across retries.", "in": "header", "name": "Relvo-Event-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "The delivery id (see `listWebhookDeliveries`).", "in": "header", "name": "Relvo-Delivery-Id", "required": true, "schema": {"format": "uuid", "type": "string"}}, {"description": "Signature scheme version; currently `v1`.", "in": "header", "name": "Relvo-Webhook-Version", "required": true, "schema": {"type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"additionalProperties": false, "properties": {"data": {"additionalProperties": false, "description": "A payment was confirmed as received.\n\nIt may not be applied to any invoice yet: allocations follow as\n`invoice.payment_received` events, one per invoice the payment settles.", "properties": {"amount": {"description": "Amount received, as a decimal string.", "pattern": "^\\d+(\\.\\d+)?$", "type": "string"}, "currency": {"description": "ISO 4217 currency code of the amount, uppercase.", "pattern": "^[A-Z]{3}$", "type": "string"}, "customer_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "description": "The paying customer, or `null` while the payment is not yet attributed to one."}, "origin": {"description": "How the payment reached Relvo.\n\n- `manual`: recorded by your team.\n- `bank_transfer`: matched from a bank-statement movement.\n- `point_of_sale`: received through a point-of-sale terminal.\n- `payment_provider`: settled by an integrated payment processor; on a `Payment`,\n  `external_reference` carries the processor's transaction id.", "enum": ["manual", "bank_transfer", "point_of_sale", "payment_provider"], "type": "string"}, "payment_id": {"description": "The payment; read it with `GET /public/payments/{payment_id}`.", "format": "uuid", "type": "string"}}, "required": ["payment_id", "customer_id", "amount", "currency", "origin"], "type": "object"}, "id": {"description": "Event id, equal to the `Relvo-Event-Id` header and stable across retries and redeliveries; deduplicate on it. Readable with `GET /public/events/{event_id}`.", "format": "uuid", "type": "string"}, "occurred_at": {"format": "date-time", "type": "string"}, "organization_id": {"format": "uuid", "type": "string"}, "schema_version": {"const": 1, "type": "integer"}, "type": {"const": "payment.succeeded", "type": "string"}}, "required": ["id", "type", "schema_version", "occurred_at", "organization_id", "data"], "type": "object"}}}, "required": true}, "responses": {"2XX": {"description": "Accepted. 408, 429, 5xx, a network error or no answer within 10 s is retried (honouring `Retry-After`); any other status ends the delivery as `dead`."}}, "summary": "payment.succeeded", "tags": ["Webhooks"]}}}, "x-tagGroups": [{"name": "Customers", "tags": ["Customers", "Billing Entities", "Contacts", "Payment Methods"]}, {"name": "Catalog & Pricing", "tags": ["Catalog Items", "Billable Metrics", "Seat Metrics", "Prices"]}, {"name": "Quotes & Contracts", "tags": ["Quotes", "Contracts", "Commercial References", "Imports"]}, {"name": "Credits", "tags": ["Credit Grants", "One-off Credits", "Credit Balances & History"]}, {"name": "Usage", "tags": ["Usage Events", "Seat Events"]}, {"name": "Invoicing", "tags": ["Invoices", "Credit Notes", "Debit Notes"]}, {"name": "Collections & Messaging", "tags": ["Payments", "Reconciliation", "Messages"]}, {"name": "Reporting", "tags": ["Reports"]}, {"name": "Platform", "tags": ["Sandbox", "Webhooks", "Events", "Currency", "Taxpayers"]}]}