---
updatedAt: 2026-05-27T18:09:52.000Z
agentTools:
  projectIndex: https://docs.api.rillet.com/llms.txt
---

# Amends a contract

Applies a contract amendment when you need to add items, retire items, or change pricing/invoicing after go-live.
Unlike a full PUT update, amendments model business-time changes and preserve historical billing context.

Use preview-contract-amendment to dry-run the financial impact before committing.


# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Rillet Accounting API",
    "version": "v4.0"
  },
  "x-mcp-ready": true,
  "x-readme": {
    "headers": [
      {
        "key": "X-Rillet-API-Version",
        "value": "4"
      }
    ]
  },
  "servers": [
    {
      "url": "https://api.rillet.com",
      "description": "Production server url"
    },
    {
      "url": "https://sandbox.api.rillet.com",
      "description": "Test server url"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/contracts/{contract_id}/amendments": {
      "post": {
        "tags": [
          "Contracts"
        ],
        "operationId": "amend-a-contract",
        "x-rillet-contract-submission-response": true,
        "summary": "Amends a contract",
        "description": "Applies a contract amendment when you need to add items, retire items, or change pricing/invoicing after go-live.\nUnlike a full PUT update, amendments model business-time changes and preserve historical billing context.\n\nUse preview-contract-amendment to dry-run the financial impact before committing.\n",
        "parameters": [
          {
            "name": "contract_id",
            "in": "path",
            "required": true,
            "description": "UUID of the contract to amend.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AmendContractRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExpandedContract"
                }
              }
            }
          },
          "202": {
            "description": "Accepted: a contract approval rule matched, so the amendment was not applied yet. The contract, its invoices and credit memos stay as\nthey are until the approval request is approved, and the amendment is then applied as it was sent. Only returned when contract\napprovals are turned on for the organization.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContractPendingApproval"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "parameters": {
      "X-Rillet-Signature": {
        "name": "X-Rillet-Signature",
        "in": "header",
        "schema": {
          "type": "string"
        },
        "required": true,
        "description": "Signature of the webhook event. Computed using HMAC-SHA256 and AES encrypted with the configured webhook token. The contents of the body are prefixed with the timestamp and id before hashing."
      },
      "X-Rillet-Timestamp": {
        "name": "X-Rillet-Timestamp",
        "in": "header",
        "schema": {
          "type": "string",
          "format": "date-time"
        },
        "required": true,
        "description": "Timestamp of the webhook event in ISO-8601 format"
      },
      "X-Rillet-Id": {
        "name": "X-Rillet-Id",
        "in": "header",
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "required": true,
        "description": "ID of the webhook event"
      },
      "X-Rillet-Entity": {
        "name": "X-Rillet-Entity",
        "in": "header",
        "schema": {
          "type": "string"
        },
        "required": true,
        "description": "Entity type of the webhook event"
      },
      "X-Rillet-Event": {
        "name": "X-Rillet-Event",
        "in": "header",
        "schema": {
          "type": "string"
        },
        "required": true,
        "description": "Event type of the webhook event"
      }
    },
    "schemas": {
      "ContractStatus": {
        "type": "string",
        "enum": [
          "ACTIVE",
          "IN_EFFECT",
          "CANCELLED",
          "ENDED",
          "AMENDED"
        ]
      },
      "InvoiceStatus": {
        "type": "string",
        "enum": [
          "UNPAID",
          "PAID",
          "PARTIALLY_PAID",
          "UNBILLED",
          "CREDITED",
          "PARTIALLY_CREDITED"
        ]
      },
      "BillStatus": {
        "type": "string",
        "enum": [
          "DRAFT",
          "UNPAID",
          "PAID",
          "PARTIALLY_PAID",
          "CREDITED",
          "PARTIALLY_CREDITED",
          "APPLIED"
        ]
      },
      "PendingApprovalRequest": {
        "type": "object",
        "required": [
          "id",
          "workflow_id",
          "operation",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "workflow_id": {
            "type": "string",
            "format": "uuid"
          },
          "operation": {
            "type": "string",
            "enum": [
              "CREATE",
              "UPDATE",
              "DELETE"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING"
            ]
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "type",
          "title"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri",
            "description": "A URI reference that identifies the error type.",
            "example": "https://rillet.io/forbidden"
          },
          "title": {
            "type": "string",
            "description": "Summary of the problem.",
            "example": "Forbidden"
          },
          "status": {
            "type": "integer",
            "description": "The HTTP status code generated by the origin server for this occurrence of the error.",
            "example": 403
          },
          "detail": {
            "type": "string",
            "description": "Explanation specific to this occurrence of the error.",
            "example": "User does not have rights to perform this operation."
          }
        }
      },
      "CurrencyCode": {
        "type": "string",
        "description": "Currency code following ISO-4217",
        "example": "USD"
      },
      "MonetaryAmount": {
        "type": "object",
        "required": [
          "amount",
          "currency"
        ],
        "properties": {
          "amount": {
            "type": "string",
            "description": "Monetary amount in decimal format, using a period (.) as the decimal separator. (e.g. '1.01' in $ currency represents 1$ and 1 cent.)",
            "example": "1.01"
          },
          "currency": {
            "$ref": "#/components/schemas/CurrencyCode"
          }
        }
      },
      "RoundedMonetaryAmount": {
        "type": "object",
        "description": "A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).",
        "x-class-extra-annotation": "@io.rillet.common.infra.validators.IsRoundedAmount",
        "required": [
          "amount",
          "currency"
        ],
        "properties": {
          "amount": {
            "type": "string",
            "description": "Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).",
            "example": "1.01"
          },
          "currency": {
            "$ref": "#/components/schemas/CurrencyCode"
          }
        }
      },
      "CountryCode": {
        "type": "string",
        "description": "Two-letter country code (ISO 3166-1 alpha-2).",
        "example": "US"
      },
      "RevenuePattern": {
        "type": "string",
        "enum": [
          "DAILY",
          "EVEN_PERIOD",
          "PROGRESS"
        ],
        "description": "DAILY divides revenue equally per day. EVEN_PERIOD divides revenue equally per calendar month. PROGRESS uses a progress plan; the supported measure MILESTONES recognizes allocated revenue on milestone completion and requires a one-time price. FULL contract creation supports an explicit progress plan or snapshots the referenced product's template. Existing non-progress behavior is unchanged."
      },
      "ProgressMeasure": {
        "type": "string",
        "enum": [
          "MILESTONES"
        ],
        "description": "The progress measure. Only MILESTONES is currently supported."
      },
      "MilestoneValueMode": {
        "type": "string",
        "enum": [
          "PERCENTAGE",
          "AMOUNT"
        ],
        "description": "Values are non-negative plain decimal strings with no exponent notation. PERCENTAGE supports at most 4 decimal places; AMOUNT supports at most 10 decimal places. Excess decimal places, including trailing zeros, are rejected rather than rounded. PERCENTAGE values are whole percentages (\"30\" means 30%), range from 0 to 100, and must total exactly 100. AMOUNT values on product templates are proportional weights in the product's currency and must total more than zero; they are not fixed contract obligations."
      },
      "ProgressPlan": {
        "discriminator": {
          "propertyName": "measure",
          "mapping": {
            "MILESTONES": "#/components/schemas/MilestoneProgressPlan"
          }
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/MilestoneProgressPlan"
          }
        ]
      },
      "MilestoneProgressPlan": {
        "type": "object",
        "required": [
          "measure",
          "value_mode",
          "as_of_date",
          "milestones"
        ],
        "properties": {
          "measure": {
            "$ref": "#/components/schemas/ProgressMeasure"
          },
          "value_mode": {
            "$ref": "#/components/schemas/MilestoneValueMode"
          },
          "as_of_date": {
            "type": "string",
            "format": "date",
            "description": "Organization-local date used to derive pending milestone statuses."
          },
          "milestones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContractMilestone"
            }
          }
        }
      },
      "ContractMilestoneStatus": {
        "type": "string",
        "readOnly": true,
        "enum": [
          "OPEN",
          "DUE_THIS_PERIOD",
          "OVERDUE",
          "COMPLETED",
          "CANCELLED"
        ]
      },
      "ContractMilestoneCancellation": {
        "type": "object",
        "required": [
          "effective_date"
        ],
        "properties": {
          "effective_date": {
            "type": "string",
            "format": "date"
          },
          "credit_memo_id": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Linked credit memo for a nonzero allocation; null when the cancelled allocation is zero."
          }
        }
      },
      "ContractMilestone": {
        "type": "object",
        "required": [
          "id",
          "key",
          "name",
          "sequence",
          "status",
          "external_references"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Stable server-generated identifier for this contract milestone."
          },
          "key": {
            "type": "string",
            "description": "Stable integration key copied from the product template or explicit contract plan."
          },
          "name": {
            "type": "string"
          },
          "sequence": {
            "type": "integer",
            "format": "int32"
          },
          "percentage": {
            "type": "string",
            "nullable": true,
            "description": "Present only in PERCENTAGE mode. \"30\" means 30 percent."
          },
          "allocated_amount": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RoundedMonetaryAmount"
              }
            ],
            "nullable": true,
            "description": "Present only in PERCENTAGE mode; the monetary allocation calculated for this contract line."
          },
          "amount": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RoundedMonetaryAmount"
              }
            ],
            "nullable": true,
            "description": "Present only in AMOUNT mode. No duplicate allocated_amount is returned in that mode."
          },
          "expected_date": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "status": {
            "$ref": "#/components/schemas/ContractMilestoneStatus"
          },
          "completed_date": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "memo": {
            "type": "string",
            "nullable": true
          },
          "external_references": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/ExternalReference"
            }
          },
          "cancellation": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ContractMilestoneCancellation"
              }
            ],
            "nullable": true
          }
        }
      },
      "FixedPrice": {
        "type": "object",
        "required": [
          "amount"
        ],
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/MonetaryAmount"
          }
        }
      },
      "RecurringPrice": {
        "type": "object",
        "required": [
          "interval_months"
        ],
        "properties": {
          "interval_months": {
            "type": "integer",
            "format": "int32",
            "minimum": 1,
            "maximum": 12,
            "example": 1
          }
        }
      },
      "Price": {
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "FIXED_RECURRING": "#/components/schemas/FixedRecurringPrice",
            "ONE_TIME": "#/components/schemas/OneTimePrice",
            "USAGE": "#/components/schemas/UsagePrice"
          }
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/FixedRecurringPrice"
          },
          {
            "$ref": "#/components/schemas/OneTimePrice"
          },
          {
            "$ref": "#/components/schemas/UsagePrice"
          }
        ],
        "example": {
          "type": "FIXED_RECURRING",
          "amount": {
            "amount": "10.00",
            "currency": "USD"
          },
          "interval_months": 1
        }
      },
      "FixedRecurringPrice": {
        "allOf": [
          {
            "$ref": "#/components/schemas/FixedPrice"
          },
          {
            "$ref": "#/components/schemas/RecurringPrice"
          },
          {
            "type": "object",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "default": "FIXED_RECURRING"
              }
            }
          }
        ]
      },
      "OneTimePrice": {
        "allOf": [
          {
            "$ref": "#/components/schemas/FixedPrice"
          },
          {
            "type": "object",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "default": "ONE_TIME"
              }
            }
          }
        ]
      },
      "UsagePrice": {
        "allOf": [
          {
            "$ref": "#/components/schemas/RecurringPrice"
          },
          {
            "type": "object",
            "required": [
              "type",
              "billing_scheme"
            ],
            "properties": {
              "type": {
                "type": "string",
                "default": "USAGE"
              },
              "billing_scheme": {
                "$ref": "#/components/schemas/BillingScheme"
              }
            }
          }
        ]
      },
      "BillingScheme": {
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "PER_UNIT": "#/components/schemas/PerUnitBilling",
            "TIERED": "#/components/schemas/TieredBilling"
          }
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/PerUnitBilling"
          },
          {
            "$ref": "#/components/schemas/TieredBilling"
          }
        ]
      },
      "PerUnitBilling": {
        "type": "object",
        "required": [
          "type",
          "amount",
          "units"
        ],
        "properties": {
          "type": {
            "type": "string",
            "default": "PER_UNIT"
          },
          "amount": {
            "$ref": "#/components/schemas/MonetaryAmount"
          },
          "units": {
            "type": "integer",
            "format": "int32",
            "minimum": 1,
            "example": 1
          }
        }
      },
      "TieredBilling": {
        "type": "object",
        "required": [
          "type",
          "mode",
          "tiers"
        ],
        "properties": {
          "type": {
            "type": "string",
            "default": "TIERED"
          },
          "mode": {
            "type": "string",
            "enum": [
              "GRADUATED",
              "METERED"
            ],
            "description": "In metered tiering, the maximum quantity within a period determines the price. In graduated tiering, pricing changes as the quantity grows – the price from each tier up to the reported quantity is accumulated."
          },
          "tiers": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/Tier"
            }
          }
        },
        "description": "All tiers except for the highest have to define a value for upTo. There cannot be more than one tier with the same upTo value."
      },
      "Tier": {
        "type": "object",
        "required": [
          "up_to"
        ],
        "properties": {
          "up_to": {
            "type": "integer",
            "format": "int32",
            "minimum": 1,
            "example": 10
          },
          "flat_price": {
            "$ref": "#/components/schemas/MonetaryAmount"
          },
          "per_unit_price": {
            "$ref": "#/components/schemas/MonetaryAmount"
          }
        },
        "description": "At least one of flatPrice or perUnitPrice has to be defined. flatPrice is the price for the entire tier. perUnitPrice is price for units relevant to the tier."
      },
      "TaxRateWithOptionalAmount": {
        "type": "object",
        "required": [
          "country",
          "description",
          "percentage",
          "type"
        ],
        "properties": {
          "percentage": {
            "type": "string",
            "format": "number",
            "minimum": 0,
            "maximum": 100,
            "example": "0"
          },
          "tax_amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "country": {
            "$ref": "#/components/schemas/CountryCode"
          },
          "type": {
            "type": "string",
            "enum": [
              "VAT",
              "SALES_TAX"
            ]
          },
          "description": {
            "type": "string"
          }
        }
      },
      "TaxRate": {
        "allOf": [
          {
            "$ref": "#/components/schemas/TaxRateWithOptionalAmount"
          }
        ],
        "required": [
          "tax_amount"
        ]
      },
      "ExpenseTaxRate": {
        "allOf": [
          {
            "$ref": "#/components/schemas/TaxRate"
          },
          {
            "type": "object",
            "required": [
              "coverage"
            ],
            "properties": {
              "tax_code": {
                "type": "string",
                "description": "Code of a predefined tax rate. When provided, the rate's percentage, country, and description are used instead of the inline values."
              },
              "coverage": {
                "type": "string",
                "enum": [
                  "INCLUSIVE",
                  "EXCLUSIVE"
                ]
              }
            }
          }
        ]
      },
      "ProductType": {
        "type": "string",
        "enum": [
          "PRODUCT",
          "BUNDLE"
        ],
        "description": "PRODUCT is a standalone product. BUNDLE is a product made up of other products."
      },
      "BundleInvoiceDisplay": {
        "type": "string",
        "enum": [
          "BUNDLE_AND_COMPONENTS",
          "BUNDLE_LINE_ONLY"
        ],
        "description": "How a bundle appears on invoices and credit memos. BUNDLE_AND_COMPONENTS shows the bundle and its component products. BUNDLE_LINE_ONLY shows the bundle only."
      },
      "CustomerRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "example": "Bob"
          },
          "name_on_invoice": {
            "type": "string",
            "example": "Bob Johnson"
          },
          "address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Address"
              }
            ],
            "deprecated": true,
            "description": "Deprecated: use billing_addresses. In responses, the first address in billing_addresses. In requests without billing_addresses, it creates or edits that first billing address in place; the customer's other billing addresses are left untouched."
          },
          "shipping_address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Address"
              }
            ],
            "deprecated": true,
            "description": "Deprecated: use shipping_addresses. In responses, the first address in shipping_addresses. In requests without shipping_addresses, it creates or edits that first shipping address in place; the customer's other shipping addresses are left untouched."
          },
          "billing_addresses": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CustomerAddresses"
              }
            ],
            "nullable": true,
            "description": "All of the customer's billing addresses, returned in a stable order; the first is the default for new contracts and invoices. On update the list is authoritative: addresses sent with an id are updated, addresses without an id are added, and stored addresses left out are removed. Removing an address that is used by a contract or an invoice that can still be edited is rejected with a 400 naming those documents. Omit to leave billing addresses unchanged; send an empty list to remove them all. Cannot be combined with address."
          },
          "shipping_addresses": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CustomerAddresses"
              }
            ],
            "nullable": true,
            "description": "All of the customer's shipping addresses. Same rules as billing_addresses. Cannot be combined with shipping_address."
          },
          "emails": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerEmail"
            },
            "description": "All of the customer's emails. On update, send the full list: emails with an id are kept or edited, emails without an id are added, and emails left out are removed (omitting emails, or sending an empty list, removes them all). A removed email is also removed from every contract email_selection; to change an email and keep it selected, send its id. Rejected: an id on create, an id that doesn't belong to this customer, the same id twice, or the same address and type twice (addresses are compared ignoring case and surrounding spaces)."
          },
          "external_references": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalReference"
            }
          },
          "payment_terms": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "example": 0
          },
          "send_invoices_automatically": {
            "type": "boolean",
            "default": false,
            "description": "When set to true, invoices for this customer will be automatically sent via email on the invoice date."
          },
          "send_payment_reminders": {
            "type": "boolean",
            "default": false,
            "description": "When set to true, an email will be sent to customers periodically if they have not paid an invoice."
          },
          "allow_online_payments": {
            "type": "boolean",
            "description": "Allows this customer to pay invoices online via Stripe, and must be true before auto-payment can be set up for them. Omit on create to leave online payments off; omit on update to keep the customer's current setting. Enabling it requires Stripe to be configured for at least one subsidiary."
          },
          "fields": {
            "allOf": [
              {
                "$ref": "#/components/schemas/FieldAssignments"
              }
            ],
            "nullable": true
          },
          "tax_ids": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CustomerTaxIds"
              }
            ],
            "nullable": true,
            "description": "The customer's tax IDs. Omit on create for no tax IDs. On update, omit to keep the current tax IDs, send an empty list to clear them, or send a list to replace them all. Adding or changing tax IDs requires the customer to have an address, and they are validated with the organization's tax provider when one is connected."
          }
        }
      },
      "CustomerTaxIds": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/CustomerTaxId"
        }
      },
      "CustomerTaxId": {
        "type": "object",
        "required": [
          "type",
          "value"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "EU_VAT_REGISTRATION_NUMBER",
              "GENERIC_VAT_NUMBER"
            ]
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "example": "DE123456789"
          }
        }
      },
      "Discount": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/AmountDiscount"
          },
          {
            "$ref": "#/components/schemas/PercentageDiscount"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "AMOUNT": "#/components/schemas/AmountDiscount",
            "PERCENTAGE": "#/components/schemas/PercentageDiscount"
          }
        },
        "example": {
          "type": "AMOUNT",
          "amount_off": {
            "amount": "10.00",
            "currency": "USD"
          }
        }
      },
      "AmountDiscount": {
        "type": "object",
        "required": [
          "amount_off"
        ],
        "properties": {
          "amount_off": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "type": {
            "type": "string",
            "default": "AMOUNT"
          }
        }
      },
      "PercentageDiscount": {
        "type": "object",
        "required": [
          "percentage_off"
        ],
        "properties": {
          "percentage_off": {
            "type": "number",
            "format": "double",
            "minimum": 0,
            "maximum": 100,
            "example": 10
          },
          "type": {
            "type": "string",
            "default": "PERCENTAGE"
          }
        }
      },
      "Invoicing": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/MonthlyInvoicing"
          },
          {
            "$ref": "#/components/schemas/MonthlyProratedInvoicing"
          },
          {
            "$ref": "#/components/schemas/QuarterlyInvoicing"
          },
          {
            "$ref": "#/components/schemas/SemiAnnualInvoicing"
          },
          {
            "$ref": "#/components/schemas/YearlyInvoicing"
          }
        ],
        "discriminator": {
          "propertyName": "interval",
          "mapping": {
            "MONTHLY": "#/components/schemas/MonthlyInvoicing",
            "MONTHLY_PRORATED": "#/components/schemas/MonthlyProratedInvoicing",
            "QUARTERLY": "#/components/schemas/QuarterlyInvoicing",
            "SEMI_ANNUAL": "#/components/schemas/SemiAnnualInvoicing",
            "YEARLY": "#/components/schemas/YearlyInvoicing"
          }
        }
      },
      "MonthlyInvoicing": {
        "type": "object",
        "required": [
          "payment_terms",
          "interval",
          "day"
        ],
        "properties": {
          "payment_terms": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "example": 0
          },
          "interval": {
            "type": "string",
            "default": "MONTHLY"
          },
          "day": {
            "type": "integer",
            "format": "int32",
            "minimum": 1,
            "maximum": 31,
            "example": 1
          }
        }
      },
      "MonthlyProratedInvoicing": {
        "type": "object",
        "required": [
          "payment_terms",
          "interval",
          "day"
        ],
        "properties": {
          "payment_terms": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "example": 0
          },
          "interval": {
            "type": "string",
            "default": "MONTHLY_PRORATED"
          },
          "day": {
            "type": "integer",
            "format": "int32",
            "minimum": 1,
            "maximum": 31,
            "example": 1
          }
        },
        "description": "Monthly prorated invoicing is only available for contracts with usage products and a minimum usage commitment.\n"
      },
      "QuarterlyInvoicing": {
        "type": "object",
        "required": [
          "payment_terms",
          "interval",
          "month_day"
        ],
        "properties": {
          "payment_terms": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "example": 0
          },
          "interval": {
            "type": "string",
            "default": "QUARTERLY"
          },
          "month_day": {
            "type": "string",
            "pattern": "^--\\d{2}-\\d{2}$",
            "description": "A string in --MM-dd format. Invoices will be created starting on that date and every 3 months.",
            "example": "--01-01"
          }
        }
      },
      "SemiAnnualInvoicing": {
        "type": "object",
        "required": [
          "payment_terms",
          "interval",
          "month_day"
        ],
        "properties": {
          "payment_terms": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "example": 0
          },
          "interval": {
            "type": "string",
            "default": "SEMI_ANNUAL"
          },
          "month_day": {
            "type": "string",
            "pattern": "^--\\d{2}-\\d{2}$",
            "description": "A string in --MM-dd format. Invoices will be created starting on that date and every 6 months.",
            "example": "--01-01"
          }
        }
      },
      "YearlyInvoicing": {
        "type": "object",
        "required": [
          "payment_terms",
          "interval",
          "month_day"
        ],
        "properties": {
          "payment_terms": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "example": 0
          },
          "interval": {
            "type": "string",
            "default": "YEARLY"
          },
          "month_day": {
            "type": "string",
            "pattern": "^--\\d{2}-\\d{2}$",
            "description": "A string in --MM-dd format",
            "example": "--01-01"
          }
        }
      },
      "UsageInvoicingFrequency": {
        "type": "string",
        "enum": [
          "MONTHLY",
          "QUARTERLY",
          "SEMI_ANNUAL",
          "YEARLY"
        ]
      },
      "MinimumCommitmentInvoicingFrequency": {
        "type": "string",
        "enum": [
          "MONTHLY",
          "MONTHLY_PRORATED",
          "QUARTERLY",
          "SEMI_ANNUAL",
          "YEARLY"
        ],
        "description": "MONTHLY_PRORATED is only available for CALENDAR usage invoice cycle. It need to be the same as contract level invoicing frequency."
      },
      "UsageInvoicing": {
        "type": "object",
        "required": [
          "frequency",
          "payment_terms",
          "invoice_date",
          "cycle"
        ],
        "properties": {
          "frequency": {
            "$ref": "#/components/schemas/UsageInvoicingFrequency"
          },
          "payment_terms": {
            "$ref": "#/components/schemas/PaymentTerms",
            "description": "Should be the same across different invoicing objects."
          },
          "invoice_date": {
            "$ref": "#/components/schemas/UsageInvoiceDate"
          },
          "cycle": {
            "$ref": "#/components/schemas/UsageInvoiceCycle"
          }
        }
      },
      "MinimumCommitmentInvoicing": {
        "type": "object",
        "required": [
          "frequency",
          "payment_terms"
        ],
        "properties": {
          "frequency": {
            "$ref": "#/components/schemas/MinimumCommitmentInvoicingFrequency"
          },
          "payment_terms": {
            "$ref": "#/components/schemas/PaymentTerms",
            "description": "Should be the same across different invoicing objects."
          }
        }
      },
      "OverageInvoicing": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/OverageMonthlyInvoicing"
          },
          {
            "$ref": "#/components/schemas/OverageMonthlyProratedInvoicing"
          },
          {
            "$ref": "#/components/schemas/OverageQuarterlyInvoicing"
          },
          {
            "$ref": "#/components/schemas/OverageSemiAnnualInvoicing"
          },
          {
            "$ref": "#/components/schemas/OverageYearlyInvoicing"
          }
        ],
        "discriminator": {
          "propertyName": "interval",
          "mapping": {
            "MONTHLY": "#/components/schemas/OverageMonthlyInvoicing",
            "MONTHLY_PRORATED": "#/components/schemas/OverageMonthlyProratedInvoicing",
            "QUARTERLY": "#/components/schemas/OverageQuarterlyInvoicing",
            "SEMI_ANNUAL": "#/components/schemas/OverageSemiAnnualInvoicing",
            "YEARLY": "#/components/schemas/OverageYearlyInvoicing"
          }
        }
      },
      "OverageMonthlyInvoicing": {
        "type": "object",
        "required": [
          "payment_terms",
          "interval"
        ],
        "properties": {
          "payment_terms": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "example": 0
          },
          "interval": {
            "type": "string",
            "default": "MONTHLY"
          }
        }
      },
      "OverageMonthlyProratedInvoicing": {
        "type": "object",
        "required": [
          "payment_terms",
          "interval"
        ],
        "properties": {
          "payment_terms": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "example": 0
          },
          "interval": {
            "type": "string",
            "default": "MONTHLY_PRORATED"
          }
        },
        "description": "Monthly prorated invoicing is only available for contracts with usage products and a minimum usage commitment.\n"
      },
      "OverageQuarterlyInvoicing": {
        "type": "object",
        "required": [
          "payment_terms",
          "interval"
        ],
        "properties": {
          "payment_terms": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "example": 0
          },
          "interval": {
            "type": "string",
            "default": "QUARTERLY"
          }
        }
      },
      "OverageSemiAnnualInvoicing": {
        "type": "object",
        "required": [
          "payment_terms",
          "interval"
        ],
        "properties": {
          "payment_terms": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "example": 0
          },
          "interval": {
            "type": "string",
            "default": "SEMI_ANNUAL"
          }
        }
      },
      "OverageYearlyInvoicing": {
        "type": "object",
        "required": [
          "payment_terms",
          "interval"
        ],
        "properties": {
          "payment_terms": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "example": 0
          },
          "interval": {
            "type": "string",
            "default": "YEARLY"
          }
        }
      },
      "ContractScope": {
        "type": "string",
        "enum": [
          "FULL",
          "REVENUE_RECOGNITION_ONLY"
        ],
        "description": "The \"FULL\" scope includes revenue recognition and invoicing handled in Rillet. With the \"REVENUE_RECOGNITION_ONLY\" scope, invoicing is handled outside Rillet."
      },
      "UsageConfiguration": {
        "required": [
          "usage_invoicing"
        ],
        "properties": {
          "usage_invoicing": {
            "$ref": "#/components/schemas/UsageInvoicing"
          },
          "minimum_commitment_invoicing": {
            "$ref": "#/components/schemas/MinimumCommitmentInvoicing"
          },
          "minimum_commitment_cycle": {
            "type": "string",
            "enum": [
              "MONTHLY",
              "CONTRACT"
            ],
            "description": "Determines how often does the minimum commitment reset."
          },
          "contract_level_minimum_commitment": {
            "$ref": "#/components/schemas/UsageCommitment",
            "description": "Minimum commitment that will be shared across all contract items with usage price."
          }
        }
      },
      "UsageInvoiceDate": {
        "type": "string",
        "enum": [
          "FIRST_DAY_OF_NEXT_CYCLE",
          "LAST_DAY_OF_CURRENT_CYCLE"
        ],
        "description": "When the usage invoice is created in relation to the usage cycle."
      },
      "UsageInvoiceCycle": {
        "type": "string",
        "enum": [
          "CALENDAR",
          "SUBSCRIPTION_ANNIVERSARY"
        ],
        "description": "When does the invoicing pricing cycle reset and results in an invoice. Calendar option is only allowed when usage invoice frequency is Monthly, and contract does not start on the 1st of the Month."
      },
      "ContractApproval": {
        "type": "object",
        "description": "Where the latest approval request for a contract stands.",
        "required": [
          "approval_request_id",
          "operation",
          "status"
        ],
        "properties": {
          "approval_request_id": {
            "type": "string",
            "format": "uuid"
          },
          "operation": {
            "type": "string",
            "enum": [
              "CREATE",
              "UPDATE"
            ],
            "description": "CREATE for a new contract, UPDATE for an edit, an amendment or a change to its custom fields."
          },
          "status": {
            "type": "string",
            "enum": [
              "WAITING",
              "APPROVED",
              "REJECTED",
              "CANCELLED",
              "WITHDRAWN"
            ],
            "description": "WAITING until someone decides. APPROVED once applied. REJECTED by an approver, CANCELLED by the person who sent it, and WITHDRAWN\nby Rillet when what it would change was changed or deleted first; reason says why.\n"
          },
          "reason": {
            "type": "string",
            "nullable": true,
            "description": "Why the request was rejected or withdrawn. Null when nobody gave a reason."
          }
        }
      },
      "AmendmentEffectiveFrom": {
        "type": "string",
        "enum": [
          "AS_OF_AMENDMENT_DATE",
          "END_OF_CURRENT_BILLING_CYCLE"
        ],
        "description": "Defines when the amendment takes effect. - `AS_OF_AMENDMENT_DATE`: apply changes as of the amendment date - `END_OF_CURRENT_BILLING_CYCLE`: apply at the end of the current billing cycle\n"
      },
      "AmendContractRequest": {
        "type": "object",
        "discriminator": {
          "propertyName": "scope",
          "mapping": {
            "FULL": "#/components/schemas/AmendFullContractRequest",
            "REVENUE_RECOGNITION_ONLY": "#/components/schemas/AmendRevenueRecognitionOnlyContractRequest"
          }
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/AmendFullContractRequest"
          },
          {
            "$ref": "#/components/schemas/AmendRevenueRecognitionOnlyContractRequest"
          }
        ],
        "required": [
          "scope"
        ],
        "properties": {
          "scope": {
            "$ref": "#/components/schemas/ContractScope"
          }
        }
      },
      "AmendFullContractRequest": {
        "type": "object",
        "required": [
          "items",
          "amendment_date",
          "amendment_reason",
          "invoicing"
        ],
        "properties": {
          "amendment_date": {
            "type": "string",
            "format": "date",
            "description": "It cannot be earlier than the previous amendment date if the contract has already been amended."
          },
          "amendment_reason": {
            "type": "string",
            "example": "Amendment requested by user"
          },
          "items": {
            "type": "array",
            "minItems": 0,
            "description": "List of new contract items and new versions of amended contract items. Existing contract items that do not appear in the list will remain unchanged.",
            "items": {
              "$ref": "#/components/schemas/AmendFullContractItemRequest"
            }
          },
          "invoicing": {
            "$ref": "#/components/schemas/Invoicing",
            "description": "Mandatory for contracts with scope different than REVENUE_RECOGNITION_ONLY. For contracts with any nonzero contract-level or item-level minimum commitment, the invoice date resolved from this schedule must equal start_date.\n"
          }
        }
      },
      "AmendRevenueRecognitionOnlyContractRequest": {
        "type": "object",
        "required": [
          "items",
          "amendment_date",
          "amendment_reason",
          "invoice_schedule"
        ],
        "properties": {
          "amendment_date": {
            "type": "string",
            "format": "date",
            "description": "It cannot be earlier than the previous amendment date if the contract has already been amended."
          },
          "amendment_reason": {
            "type": "string",
            "example": "Amendment requested by user"
          },
          "items": {
            "type": "array",
            "minItems": 0,
            "description": "List of new contract items and new versions of amended contract items.\nExisting contract items that do not appear in the list will remain unchanged.\nIf you want to delete a contract item from the amendment date onwards, use the `TERMINATED_ITEM`.\"\n",
            "items": {
              "type": "object",
              "discriminator": {
                "propertyName": "type",
                "mapping": {
                  "NEW_ITEM": "#/components/schemas/RevenueRecognitionOnlyContractNewItemInAmendmentRequest",
                  "AMENDING_ITEM": "#/components/schemas/RevenueRecognitionOnlyContractAmendingItemRequest",
                  "TERMINATED_ITEM": "#/components/schemas/RevenueRecognitionOnlyContractTerminatedItemRequest"
                }
              },
              "oneOf": [
                {
                  "$ref": "#/components/schemas/RevenueRecognitionOnlyContractNewItemInAmendmentRequest"
                },
                {
                  "$ref": "#/components/schemas/RevenueRecognitionOnlyContractAmendingItemRequest"
                },
                {
                  "$ref": "#/components/schemas/RevenueRecognitionOnlyContractTerminatedItemRequest"
                }
              ],
              "required": [
                "type"
              ],
              "properties": {
                "type": {
                  "type": "string"
                }
              }
            }
          },
          "invoice_schedule": {
            "$ref": "#/components/schemas/InvoiceSchedule"
          }
        }
      },
      "AmendFullContractItemRequest": {
        "type": "object",
        "required": [
          "price",
          "product_id",
          "quantity",
          "start_date"
        ],
        "properties": {
          "product_id": {
            "type": "string",
            "format": "uuid",
            "description": "A bundle is accepted only when `amending` names a line that sells the same bundle."
          },
          "price": {
            "$ref": "#/components/schemas/Price"
          },
          "quantity": {
            "type": "number",
            "minimum": 1,
            "example": 1,
            "description": "Must be 1 for USAGE prices."
          },
          "revenue_pattern": {
            "description": "How revenue from this line is recognized. Required for standalone products. Ignored on bundle lines.",
            "allOf": [
              {
                "$ref": "#/components/schemas/RevenuePattern"
              }
            ]
          },
          "discount": {
            "$ref": "#/components/schemas/Discount"
          },
          "tax_rate": {
            "$ref": "#/components/schemas/TaxRate"
          },
          "start_date": {
            "type": "string",
            "format": "date",
            "description": "Must be on or after the amendment date."
          },
          "end_date": {
            "type": "string",
            "format": "date",
            "description": "Defaults to the contract end date"
          },
          "effective_from": {
            "$ref": "#/components/schemas/AmendmentEffectiveFrom"
          },
          "amending": {
            "type": "string",
            "format": "uuid",
            "description": "Contract item ID that is being amended. If empty, a new item will be created."
          }
        }
      },
      "RevenueRecognitionOnlyContractAmendingItemRequest": {
        "type": "object",
        "required": [
          "price",
          "amending_reference"
        ],
        "properties": {
          "price": {
            "$ref": "#/components/schemas/MonetaryAmount"
          },
          "discount": {
            "$ref": "#/components/schemas/Discount"
          },
          "revenue_pattern": {
            "$ref": "#/components/schemas/RevenuePattern"
          },
          "amending_reference": {
            "type": "string",
            "description": "External Reference of the contract item being amended."
          },
          "end_date": {
            "type": "string",
            "format": "date",
            "description": "New end date for the amended (continuing) item. If omitted, the item keeps its current end date. Must be on or after the amendment date."
          }
        }
      },
      "RevenueRecognitionOnlyContractTerminatedItemRequest": {
        "type": "object",
        "required": [
          "external_reference"
        ],
        "properties": {
          "external_reference": {
            "type": "string",
            "description": "External Reference of the contract item being terminated."
          },
          "end_date": {
            "type": "string",
            "format": "date",
            "description": "Date the item is terminated on. Revenue is recognized through this date. Must be on or after the amendment date. If omitted, the item is terminated as of the amendment date."
          }
        }
      },
      "RevenueRecognitionOnlyContractNewItemInAmendmentRequest": {
        "type": "object",
        "required": [
          "price",
          "product_id",
          "revenue_pattern",
          "external_reference"
        ],
        "properties": {
          "product_id": {
            "type": "string",
            "format": "uuid"
          },
          "price": {
            "$ref": "#/components/schemas/MonetaryAmount"
          },
          "discount": {
            "$ref": "#/components/schemas/Discount"
          },
          "revenue_pattern": {
            "$ref": "#/components/schemas/RevenuePattern"
          },
          "start_date": {
            "type": "string",
            "format": "date",
            "description": "By default is the amendment date. If provided, the date has to be on or after the amendment date."
          },
          "end_date": {
            "type": "string",
            "format": "date",
            "description": "End date for the new item. If omitted, defaults to the contract end date. If provided, must be on or after the item's start date."
          },
          "external_reference": {
            "$ref": "#/components/schemas/ExternalReference",
            "description": null
          }
        }
      },
      "Address": {
        "type": "object",
        "required": [
          "city",
          "country",
          "line1",
          "zip_code"
        ],
        "properties": {
          "line1": {
            "type": "string",
            "example": "123 Main St"
          },
          "line2": {
            "type": "string",
            "nullable": true,
            "example": "Apt 4B"
          },
          "city": {
            "type": "string",
            "example": "Nashville"
          },
          "state": {
            "type": "string",
            "nullable": true,
            "example": "TN",
            "description": "State or province code. Required for United States addresses and optional where it does not apply."
          },
          "zip_code": {
            "type": "string",
            "example": "37201"
          },
          "country": {
            "$ref": "#/components/schemas/CountryCode"
          }
        }
      },
      "CustomerAddress": {
        "allOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "Stable ID of a stored customer address. Use it as billing_address_id or shipping_address_id on contracts and invoices. On customer update, send it to keep or edit an existing address; omit it to add a new address. Omitted in responses when the address no longer exists on the customer."
              }
            }
          },
          {
            "$ref": "#/components/schemas/Address"
          }
        ]
      },
      "CustomerAddresses": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/CustomerAddress"
        }
      },
      "CustomerEmail": {
        "type": "object",
        "required": [
          "email",
          "type"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "0193a6f2-4c1e-7b8a-9d3f-2e5c8a1b7f40",
            "description": "Stable ID of the customer email, always returned. On customer update, send it to keep or edit the email; omit it to add a new email. Not accepted on customer create."
          },
          "email": {
            "type": "string",
            "example": "bobjohnson@somedomain.com"
          },
          "type": {
            "type": "string",
            "enum": [
              "MAIN_SENDER",
              "CC",
              "BCC"
            ]
          }
        }
      },
      "EmailRecipientType": {
        "type": "string",
        "enum": [
          "MAIN_SENDER",
          "CC",
          "BCC"
        ],
        "description": "How the email receives the invoice: MAIN_SENDER is To, CC and BCC are copies."
      },
      "EmailRecipient": {
        "type": "object",
        "required": [
          "customer_email_id",
          "recipient_type"
        ],
        "properties": {
          "customer_email_id": {
            "type": "string",
            "format": "uuid",
            "description": "ID of one of the billing customer's emails."
          },
          "recipient_type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/EmailRecipientType"
              }
            ],
            "description": "How this email receives this contract's invoices. It can differ from the customer email's type, and changing the customer email's type does not change it."
          }
        }
      },
      "EmailRecipients": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/EmailRecipient"
        }
      },
      "EmailSelectionMode": {
        "type": "string",
        "enum": [
          "ALL_CUSTOMER_EMAILS",
          "SELECTED_EMAILS"
        ],
        "description": "ALL_CUSTOMER_EMAILS: sent to every email on the billing customer at the time of sending, including emails added later, each as its own type. SELECTED_EMAILS: sent only to recipients."
      },
      "EmailSelection": {
        "type": "object",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "$ref": "#/components/schemas/EmailSelectionMode"
          },
          "recipients": {
            "allOf": [
              {
                "$ref": "#/components/schemas/EmailRecipients"
              }
            ],
            "nullable": true,
            "description": "Required when mode is SELECTED_EMAILS, and an empty list means the invoice is not sent to anyone. Must be omitted or empty when mode is ALL_CUSTOMER_EMAILS. Always returned; empty in ALL_CUSTOMER_EMAILS mode. An email removed from the customer is removed from recipients."
          }
        }
      },
      "Customer": {
        "required": [
          "id",
          "name",
          "updated_at"
        ],
        "allOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "updated_at": {
                "type": "string",
                "format": "date-time",
                "description": "ISO 8601 timestamp in UTC timezone (must end with 'Z')"
              },
              "metadata": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                },
                "description": "Customer metadata values keyed by metadata definition key."
              },
              "family_id": {
                "type": "string",
                "format": "uuid",
                "nullable": true,
                "description": "The family this customer belongs to. Set through the customer-families endpoints, not here."
              },
              "parent_customer_id": {
                "type": "string",
                "format": "uuid",
                "nullable": true,
                "description": "The member this customer reports to within its family. The family's root parent reports to no one."
              }
            }
          },
          {
            "$ref": "#/components/schemas/CustomerRequest"
          }
        ]
      },
      "ContractPendingApproval": {
        "type": "object",
        "description": "A new contract, or an update to a contract, waiting for approval instead of being applied.",
        "required": [
          "contract_id",
          "approval_request_id"
        ],
        "properties": {
          "contract_id": {
            "type": "string",
            "format": "uuid",
            "description": "The id of the contract. A new contract waits as a draft with this id and keeps it once the request is approved; an updated contract\nkeeps its id.\n"
          },
          "approval_request_id": {
            "type": "string",
            "format": "uuid",
            "description": "The approval request the contract waits on."
          }
        }
      },
      "ExpandedContract": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Contract"
          },
          {
            "type": "object",
            "properties": {
              "invoices": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ContractInvoice"
                }
              },
              "approval": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ContractApproval"
                  }
                ],
                "nullable": true,
                "description": "The latest approval request for this contract, such as an update waiting for approval. Only retrieve-a-contract fills it in; null when the contract was never sent for approval."
              }
            }
          }
        ]
      },
      "Contract": {
        "type": "object",
        "required": [
          "close_date",
          "customer_id",
          "email_selection",
          "id",
          "invoicing",
          "items",
          "name",
          "start_date",
          "status",
          "total_value",
          "subsidiary_id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "subsidiary_id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "example": "New API Contract"
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/ContractItem"
            }
          },
          "status": {
            "$ref": "#/components/schemas/ContractStatus"
          },
          "start_date": {
            "type": "string",
            "format": "date"
          },
          "end_date": {
            "type": "string",
            "format": "date"
          },
          "close_date": {
            "type": "string",
            "format": "date"
          },
          "invoicing": {
            "$ref": "#/components/schemas/Invoicing",
            "description": "Mandatory for contracts with scope different than REVENUE_RECOGNITION_ONLY."
          },
          "usage_configuration": {
            "$ref": "#/components/schemas/UsageConfiguration",
            "description": "Configuration for contracts with usage products."
          },
          "total_value": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "external_references": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalReference"
            }
          },
          "exchange_rate": {
            "$ref": "#/components/schemas/ExchangeRate"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Contract metadata values keyed by metadata definition key."
          },
          "purchase_order_number": {
            "type": "string",
            "example": "PO-12345",
            "description": "Purchase order number set on the contract. It is copied onto every invoice the contract generates. Null when none was set."
          },
          "shipping_customer_id": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "The customer the contract ships to. Equal to customer_id when shipping to the billing customer. Null when no ship-to customer is set."
          },
          "billing_address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CustomerAddress"
              }
            ],
            "nullable": true,
            "description": "The selected billing address, as currently stored on the billing customer. id is the value to send as billing_address_id. Null when no billing address is selected."
          },
          "shipping_address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CustomerAddress"
              }
            ],
            "nullable": true,
            "description": "The selected shipping address, as currently stored on the ship-to customer. id is the value to send as shipping_address_id. Null when no shipping address is selected."
          },
          "email_selection": {
            "allOf": [
              {
                "$ref": "#/components/schemas/EmailSelection"
              }
            ],
            "description": "Who receives the contract's invoices."
          }
        }
      },
      "WebhookContract": {
        "type": "object",
        "required": [
          "close_date",
          "customer_id",
          "id",
          "invoicing",
          "items",
          "name",
          "start_date",
          "status",
          "total_value",
          "subsidiary_id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "subsidiary_id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "example": "New API Contract"
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/WebhookContractItem"
            }
          },
          "status": {
            "$ref": "#/components/schemas/ContractStatus"
          },
          "start_date": {
            "type": "string",
            "format": "date"
          },
          "end_date": {
            "type": "string",
            "format": "date"
          },
          "close_date": {
            "type": "string",
            "format": "date"
          },
          "invoicing": {
            "$ref": "#/components/schemas/Invoicing",
            "description": "Mandatory for contracts with scope different than REVENUE_RECOGNITION_ONLY."
          },
          "usage_overage_invoicing": {
            "$ref": "#/components/schemas/OverageInvoicing",
            "description": "When set, allows the invoicing of usage overages at a separate frequency from the regular invoicing of the contract."
          },
          "total_value": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "external_references": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalReference"
            }
          },
          "exchange_rate": {
            "$ref": "#/components/schemas/ExchangeRate"
          },
          "usage_commitment": {
            "$ref": "#/components/schemas/UsageCommitment"
          }
        }
      },
      "UsageCommitment": {
        "type": "object",
        "required": [
          "amount",
          "revenue_account"
        ],
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "revenue_account": {
            "$ref": "#/components/schemas/AccountCode"
          }
        }
      },
      "ExchangeRate": {
        "type": "object",
        "required": [
          "base",
          "date",
          "rate",
          "target"
        ],
        "properties": {
          "base": {
            "$ref": "#/components/schemas/CurrencyCode"
          },
          "target": {
            "$ref": "#/components/schemas/CurrencyCode"
          },
          "rate": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "ExternalReference": {
        "type": "object",
        "required": [
          "type",
          "id"
        ],
        "properties": {
          "type": {
            "type": "string",
            "example": "xyzSystemId"
          },
          "id": {
            "type": "string",
            "example": "234"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "example": "https://xyzsystempage.com/ids/234"
          }
        },
        "description": "For requests, only pre-defined custom IDs are accepted. In responses, an object imported through an integration (e.g. Stripe) would return the provider's object ID."
      },
      "ContractItem": {
        "type": "object",
        "required": [
          "id",
          "price",
          "product_id",
          "product_type",
          "quantity",
          "start_date",
          "status",
          "total_value",
          "external_references"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "product_id": {
            "type": "string",
            "format": "uuid"
          },
          "product_type": {
            "description": "Whether this line sells a standalone product or a bundle.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ProductType"
              }
            ]
          },
          "price": {
            "$ref": "#/components/schemas/Price"
          },
          "quantity": {
            "type": "string",
            "format": "number",
            "minimum": 1,
            "example": "1"
          },
          "total_value": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "revenue_pattern": {
            "description": "How revenue from this line is recognized. Omitted on bundle lines.",
            "allOf": [
              {
                "$ref": "#/components/schemas/RevenuePattern"
              }
            ]
          },
          "progress_plan": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ProgressPlan"
              }
            ],
            "nullable": true,
            "description": "Saved contract snapshot for PROGRESS items. Product template edits do not change this plan."
          },
          "discount": {
            "$ref": "#/components/schemas/Discount"
          },
          "tax_rate": {
            "$ref": "#/components/schemas/TaxRate"
          },
          "start_date": {
            "type": "string",
            "format": "date"
          },
          "end_date": {
            "type": "string",
            "format": "date"
          },
          "status": {
            "type": "string",
            "enum": [
              "AMENDED",
              "ACTIVE"
            ]
          },
          "amending": {
            "type": "string",
            "format": "uuid",
            "description": "When set, references the item this item is amending."
          },
          "fields": {
            "$ref": "#/components/schemas/FieldAssignments"
          },
          "external_references": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalReference"
            }
          },
          "usage_minimum_commitment": {
            "$ref": "#/components/schemas/UsageCommitment",
            "description": "Usage Minimum commitment for this contract item."
          },
          "description": {
            "type": "string",
            "description": "Overrides the product description on invoice lines generated for this item. Null when the product description is used."
          },
          "bundle": {
            "description": "Present only when product_type is BUNDLE.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ContractItemBundle"
              }
            ]
          },
          "declared_ssp": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MonetaryAmount"
              }
            ],
            "description": "Stored line SSP override. Omitted when the product SSP is used.",
            "nullable": true
          }
        },
        "allOf": [
          {
            "if": {
              "required": [
                "product_type"
              ],
              "properties": {
                "product_type": {
                  "const": "PRODUCT"
                }
              }
            },
            "then": {
              "required": [
                "revenue_pattern"
              ]
            }
          },
          {
            "if": {
              "required": [
                "product_type"
              ],
              "properties": {
                "product_type": {
                  "const": "BUNDLE"
                }
              }
            },
            "then": {
              "required": [
                "bundle"
              ]
            }
          }
        ]
      },
      "ContractItemBundle": {
        "type": "object",
        "description": "The bundle as it was when the contract was signed. Later changes to the bundle don't affect this contract.",
        "required": [
          "invoice_display",
          "components"
        ],
        "properties": {
          "invoice_display": {
            "$ref": "#/components/schemas/BundleInvoiceDisplay"
          },
          "components": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContractItemBundleComponent"
            }
          }
        }
      },
      "ContractItemBundleComponent": {
        "type": "object",
        "required": [
          "id",
          "product_id",
          "product_name",
          "quantity",
          "revenue_pattern",
          "allocated_amount"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Identifies this component on this contract line. Doesn't change between reads."
          },
          "product_id": {
            "type": "string",
            "format": "uuid",
            "description": "The component product."
          },
          "product_name": {
            "type": "string",
            "description": "The product's name as recorded when the contract was signed."
          },
          "quantity": {
            "type": "string",
            "format": "number",
            "example": "1",
            "description": "Units of this product in one unit of the bundle, as recorded when the contract was signed.\nThe line's total for this product is this quantity multiplied by the line's quantity.\n"
          },
          "revenue_pattern": {
            "description": "How this component recognizes revenue, as recorded when the contract was signed.",
            "allOf": [
              {
                "$ref": "#/components/schemas/RevenuePattern"
              }
            ]
          },
          "allocated_amount": {
            "description": "This component's share of the line's total value, in proportion to the standalone selling prices\nrecorded when the contract was signed. A line's components add up to its total_value.\n",
            "allOf": [
              {
                "$ref": "#/components/schemas/RoundedMonetaryAmount"
              }
            ]
          }
        }
      },
      "WebhookContractItem": {
        "type": "object",
        "required": [
          "id",
          "price",
          "product_id",
          "quantity",
          "revenue_pattern",
          "start_date",
          "status",
          "total_value",
          "external_references"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "product_id": {
            "type": "string",
            "format": "uuid"
          },
          "price": {
            "$ref": "#/components/schemas/Price"
          },
          "quantity": {
            "type": "string",
            "format": "number",
            "minimum": 1,
            "example": "1"
          },
          "total_value": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "revenue_pattern": {
            "$ref": "#/components/schemas/RevenuePattern"
          },
          "discount": {
            "$ref": "#/components/schemas/Discount"
          },
          "tax_rate": {
            "$ref": "#/components/schemas/TaxRate"
          },
          "start_date": {
            "type": "string",
            "format": "date"
          },
          "end_date": {
            "type": "string",
            "format": "date"
          },
          "status": {
            "type": "string",
            "enum": [
              "AMENDED",
              "ACTIVE"
            ]
          },
          "amending": {
            "type": "string",
            "format": "uuid",
            "description": "When set, references the item this item is amending."
          },
          "fields": {
            "$ref": "#/components/schemas/FieldAssignments"
          },
          "external_references": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalReference"
            }
          }
        }
      },
      "ContractInvoice": {
        "type": "object",
        "required": [
          "id",
          "invoice_number",
          "invoice_date",
          "due_date",
          "status",
          "total",
          "taxed_amount",
          "items",
          "external_references"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "invoice_number": {
            "type": "string",
            "example": "INV01"
          },
          "invoice_date": {
            "type": "string",
            "format": "date"
          },
          "due_date": {
            "type": "string",
            "format": "date"
          },
          "status": {
            "$ref": "#/components/schemas/InvoiceStatus"
          },
          "total": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "taxed_amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/InvoiceItem"
            }
          },
          "external_references": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalReference"
            }
          }
        }
      },
      "InvoiceWebhook": {
        "type": "object",
        "description": "The invoice sent in the body of invoice webhooks. It keeps the shape invoice webhooks have always had, so it differs from the Invoice the invoice endpoints return: amounts are sent without rounding, item quantities are numbers, and it has no `shipping_customer_id`, `sent_at` or `email_selection`.",
        "required": [
          "amount_due",
          "customer_id",
          "due_date",
          "id",
          "invoice_date",
          "invoice_number",
          "items",
          "metadata",
          "net_amount",
          "overdue",
          "payment_terms",
          "status",
          "subsidiary_id",
          "subtotal",
          "taxed_amount",
          "total",
          "total_discount",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "subsidiary_id": {
            "type": "string",
            "format": "uuid"
          },
          "invoice_number": {
            "type": "string",
            "example": "INV01"
          },
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "contract_id": {
            "type": "string",
            "format": "uuid"
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/InvoiceWebhookItem"
            }
          },
          "due_date": {
            "type": "string",
            "format": "date"
          },
          "invoice_date": {
            "type": "string",
            "format": "date"
          },
          "address": {
            "$ref": "#/components/schemas/Address",
            "description": "Sender address"
          },
          "customer_address": {
            "$ref": "#/components/schemas/Address"
          },
          "shipping_address": {
            "$ref": "#/components/schemas/Address"
          },
          "bank_account": {
            "$ref": "#/components/schemas/InvoicingBankAccount"
          },
          "status": {
            "$ref": "#/components/schemas/InvoiceStatus"
          },
          "net_amount": {
            "$ref": "#/components/schemas/MonetaryAmount"
          },
          "amount_due": {
            "$ref": "#/components/schemas/MonetaryAmount"
          },
          "total": {
            "$ref": "#/components/schemas/MonetaryAmount"
          },
          "payment_terms": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "example": 0
          },
          "subtotal": {
            "$ref": "#/components/schemas/MonetaryAmount"
          },
          "total_discount": {
            "$ref": "#/components/schemas/MonetaryAmount"
          },
          "purchase_order_number": {
            "type": "string",
            "example": "1"
          },
          "exchange_rate": {
            "$ref": "#/components/schemas/ExchangeRate"
          },
          "taxed_amount": {
            "$ref": "#/components/schemas/MonetaryAmount"
          },
          "memo": {
            "type": "string"
          },
          "overdue": {
            "type": "boolean"
          },
          "external_references": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalReference"
            }
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Invoice metadata values keyed by metadata definition key. Empty when the invoice has none."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp in UTC timezone (must end with 'Z')"
          },
          "taxes_calculated_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp in UTC timezone (ends with 'Z') of the last tax calculation on the invoice. For an invoice created in Rillet, update-taxes-for-an-invoice sets it to the `taxes_calculated_at` sent in that request. Omitted when no tax calculation has completed for the invoice."
          }
        }
      },
      "InvoiceWebhookItem": {
        "type": "object",
        "required": [
          "description",
          "gross_rate",
          "id",
          "quantity",
          "revenue",
          "taxed_amount",
          "total_amount",
          "total_discount",
          "product_id",
          "external_references"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "description": {
            "type": "string",
            "example": "Description"
          },
          "revenue": {
            "$ref": "#/components/schemas/ItemRevenue"
          },
          "total_amount": {
            "$ref": "#/components/schemas/MonetaryAmount"
          },
          "total_discount": {
            "$ref": "#/components/schemas/MonetaryAmount"
          },
          "taxed_amount": {
            "$ref": "#/components/schemas/MonetaryAmount"
          },
          "gross_rate": {
            "$ref": "#/components/schemas/MonetaryAmount"
          },
          "quantity": {
            "type": "number",
            "example": 1
          },
          "product_id": {
            "type": "string",
            "format": "uuid"
          },
          "external_references": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalReference"
            }
          }
        }
      },
      "InvoiceItem": {
        "type": "object",
        "required": [
          "description",
          "gross_rate",
          "id",
          "quantity",
          "revenue",
          "taxed_amount",
          "total_amount",
          "total_discount",
          "product_id",
          "external_references"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "description": {
            "type": "string",
            "example": "Description"
          },
          "revenue": {
            "$ref": "#/components/schemas/ItemRevenue"
          },
          "total_amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "total_discount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "taxed_amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "gross_rate": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "quantity": {
            "type": "string",
            "format": "number",
            "example": "1.0000"
          },
          "product_id": {
            "type": "string",
            "format": "uuid"
          },
          "external_references": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalReference"
            }
          },
          "fields": {
            "$ref": "#/components/schemas/FieldAssignments"
          }
        }
      },
      "CreditMemo": {
        "type": "object",
        "required": [
          "address",
          "applications",
          "applied_amount",
          "customer_id",
          "id",
          "credit_memo_date",
          "credit_memo_number",
          "items",
          "net_amount",
          "remaining_amount",
          "status",
          "subsidiary_id",
          "taxed_amount",
          "total",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "subsidiary_id": {
            "type": "string",
            "format": "uuid"
          },
          "credit_memo_number": {
            "type": "string",
            "example": "CM01"
          },
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/CreditMemoItem"
            }
          },
          "credit_memo_date": {
            "type": "string",
            "format": "date"
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "status": {
            "enum": [
              "UNAPPLIED",
              "PARTIALLY_APPLIED",
              "APPLIED",
              "REFUNDED"
            ]
          },
          "net_amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "total": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "applied_amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "remaining_amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreditMemoApplication"
            }
          },
          "exchange_rate": {
            "$ref": "#/components/schemas/ExchangeRate"
          },
          "taxed_amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "external_references": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalReference"
            }
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp in UTC timezone (must end with 'Z')"
          }
        }
      },
      "CreditMemoItem": {
        "type": "object",
        "required": [
          "description",
          "net_amount",
          "id",
          "quantity",
          "revenue",
          "total_amount",
          "product_id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "description": {
            "type": "string",
            "example": "Description"
          },
          "revenue": {
            "$ref": "#/components/schemas/ItemRevenue"
          },
          "total_amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "taxed_amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "net_amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "quantity": {
            "type": "string",
            "format": "number",
            "example": "1.0000"
          },
          "product_id": {
            "type": "string",
            "format": "uuid"
          },
          "fields": {
            "$ref": "#/components/schemas/FieldAssignments"
          }
        }
      },
      "ItemRevenue": {
        "type": "object",
        "properties": {
          "period": {
            "$ref": "#/components/schemas/CalendarPeriod",
            "description": "Represents the period in which the service was rendered. This period is used for revenue recognition – the revenue is spread over this period. If not provided, the period starts and ends on the invoice date."
          },
          "pattern": {
            "$ref": "#/components/schemas/RevenuePattern",
            "description": "If not provided, the one from the product will be used."
          },
          "account_code": {
            "$ref": "#/components/schemas/AccountCode",
            "description": "If not provided, the one from the product will be used."
          }
        }
      },
      "AccountCode": {
        "type": "string",
        "description": "The account code found in the Chart of Accounts",
        "example": "11112"
      },
      "CalendarPeriod": {
        "type": "object",
        "required": [
          "end",
          "start"
        ],
        "properties": {
          "start": {
            "type": "string",
            "format": "date"
          },
          "end": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "InvoicingBankAccount": {
        "type": "object",
        "required": [
          "id",
          "ach_account",
          "ach_routing",
          "bank_name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "ach_account": {
            "type": "string"
          },
          "ach_routing": {
            "type": "string"
          },
          "bank_name": {
            "type": "string"
          },
          "bank_address": {
            "type": "string"
          },
          "swift_code": {
            "type": "string"
          },
          "payment_instructions": {
            "type": "string"
          }
        }
      },
      "JournalEntryRelatedEntity": {
        "type": "object",
        "required": [
          "id",
          "type"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "enum": [
              "CUSTOMER",
              "VENDOR"
            ]
          }
        }
      },
      "JournalEntryWebhook": {
        "type": "object",
        "required": [
          "id",
          "date",
          "name",
          "currency",
          "items",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "subsidiary_id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/CurrencyCode"
          },
          "related_entity": {
            "$ref": "#/components/schemas/JournalEntryRelatedEntity"
          },
          "items": {
            "type": "array",
            "minItems": 2,
            "items": {
              "$ref": "#/components/schemas/JournalEntryItem"
            }
          },
          "date": {
            "type": "string",
            "format": "date",
            "description": "The date this journal entry was posted to the general ledger."
          },
          "reversal_date": {
            "type": "string",
            "format": "date"
          },
          "attachmentUrl": {
            "type": "string",
            "format": "uri"
          },
          "exchange_rate": {
            "$ref": "#/components/schemas/ExchangeRate"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp in UTC timezone (must end with 'Z')"
          }
        }
      },
      "JournalEntryItem": {
        "type": "object",
        "required": [
          "id",
          "amount",
          "account_id",
          "account_code",
          "side"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "description": {
            "type": "string"
          },
          "amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "original_transaction_amount": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RoundedMonetaryAmount"
              }
            ],
            "nullable": true,
            "description": "The line amount in its original transaction currency, when the line was booked in a currency other than the entry currency. Null otherwise."
          },
          "account_id": {
            "type": "string",
            "format": "uuid",
            "description": "Immutable account identifier."
          },
          "account_code": {
            "$ref": "#/components/schemas/AccountCode"
          },
          "side": {
            "type": "string",
            "enum": [
              "DEBIT",
              "CREDIT"
            ]
          },
          "fields": {
            "$ref": "#/components/schemas/FieldAssignments"
          }
        }
      },
      "CreditMemoApplication": {
        "type": "object",
        "required": [
          "id",
          "credit_memo_id",
          "invoice_id",
          "amount",
          "application_date"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "credit_memo_id": {
            "type": "string",
            "format": "uuid"
          },
          "invoice_id": {
            "type": "string",
            "format": "uuid"
          },
          "invoice_number": {
            "type": "string"
          },
          "amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "application_date": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "VendorRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "example": "MyVendor"
          },
          "account_code": {
            "$ref": "#/components/schemas/AccountCode"
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "payment_terms": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "maximum": 180
          },
          "external_references": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalReference"
            }
          },
          "ten_ninety_nine_eligible": {
            "type": "boolean"
          },
          "tax_id": {
            "type": "string",
            "example": "123"
          },
          "fields": {
            "$ref": "#/components/schemas/FieldAssignments"
          }
        }
      },
      "VendorResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/VendorRequest"
          },
          {
            "type": "object",
            "required": [
              "id",
              "updated_at"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "updated_at": {
                "type": "string",
                "format": "date-time"
              }
            }
          }
        ]
      },
      "CreateBillRequest": {
        "type": "object",
        "required": [
          "vendor_id",
          "expense_number",
          "items",
          "bill_date",
          "due_date"
        ],
        "properties": {
          "vendor_id": {
            "type": "string",
            "format": "uuid"
          },
          "expense_number": {
            "type": "string",
            "example": "B123"
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/BillItemRequest"
            }
          },
          "bill_date": {
            "type": "string",
            "format": "date"
          },
          "due_date": {
            "type": "string",
            "format": "date"
          },
          "impact_date": {
            "type": "string",
            "format": "date"
          },
          "subsidiary_id": {
            "type": "string",
            "format": "uuid"
          },
          "external_references": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalReference"
            }
          },
          "exchange_rate": {
            "$ref": "#/components/schemas/ExchangeRate"
          },
          "metadata": {
            "$ref": "#/components/schemas/InlineMetadataValues"
          }
        }
      },
      "Bill": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CreateBillRequest"
          },
          {
            "type": "object",
            "required": [
              "id",
              "status",
              "updated_at"
            ],
            "properties": {
              "metadata": {
                "type": "object",
                "description": "Values keyed by metadata definition key. Keys without a value are omitted.",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "status": {
                "$ref": "#/components/schemas/BillStatus"
              },
              "pending_approval_request": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/PendingApprovalRequest"
                  }
                ],
                "nullable": true
              },
              "updated_at": {
                "type": "string",
                "format": "date-time",
                "description": "Timestamp when the bill was last modified"
              },
              "items": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "$ref": "#/components/schemas/BillItem"
                }
              }
            }
          }
        ]
      },
      "BillItemRequest": {
        "type": "object",
        "required": [
          "account_code",
          "amount"
        ],
        "properties": {
          "description": {
            "type": "string",
            "example": "API Bill"
          },
          "account_code": {
            "$ref": "#/components/schemas/AccountCode"
          },
          "amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "tax_rate": {
            "$ref": "#/components/schemas/ExpenseTaxRate"
          },
          "service_period": {
            "$ref": "#/components/schemas/CalendarPeriod"
          },
          "fields": {
            "$ref": "#/components/schemas/FieldAssignments"
          }
        }
      },
      "BillItem": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BillItemRequest"
          },
          {
            "type": "object",
            "required": [
              "id"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              }
            }
          }
        ]
      },
      "InvoiceSchedule": {
        "type": "object",
        "properties": {
          "invoices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceScheduleInvoice"
            }
          }
        }
      },
      "InvoiceScheduleInvoice": {
        "type": "object",
        "required": [
          "invoice_date",
          "invoice_number",
          "items",
          "external_references"
        ],
        "properties": {
          "due_date": {
            "type": "string",
            "format": "date",
            "description": "Defaults to invoice_date, if not provided"
          },
          "invoice_date": {
            "type": "string",
            "format": "date"
          },
          "invoice_number": {
            "type": "string"
          },
          "tax_amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/InvoiceScheduleInvoiceItem"
            }
          },
          "external_references": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalReference"
            }
          }
        }
      },
      "InvoiceScheduleInvoiceItem": {
        "type": "object",
        "required": [
          "description",
          "contract_item_reference",
          "quantity",
          "total_amount",
          "external_references"
        ],
        "properties": {
          "description": {
            "type": "string"
          },
          "contract_item_reference": {
            "type": "string",
            "description": "Refers to the ID of the contract item's external_reference."
          },
          "quantity": {
            "type": "string",
            "format": "number",
            "minimum": 0.00001
          },
          "total_amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "tax_amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "discount_amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "external_references": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalReference"
            }
          }
        }
      },
      "InlineMetadataValues": {
        "type": "object",
        "description": "Partial metadata update keyed by definition key. Omitting this property preserves all existing metadata. When supplied, omitted keys remain unchanged; null, empty, or whitespace-only values clear only the named key.",
        "additionalProperties": {
          "type": "string",
          "nullable": true
        }
      },
      "FieldAssignments": {
        "type": "array",
        "items": {
          "type": "object",
          "required": [
            "field_id",
            "field_value_id"
          ],
          "properties": {
            "field_id": {
              "type": "string",
              "format": "uuid"
            },
            "field_value_id": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "WebhookResponse": {
        "description": "A placeholder indicating a response from a webhook. The contents of this response are ignored.",
        "type": "string"
      },
      "PaymentTerms": {
        "type": "integer",
        "format": "int32",
        "minimum": 0,
        "example": 0
      }
    }
  },
  "webhooks": {
    "invoice-created": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "x-blank-ext": "No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175",
        "operationId": "invoice-created-webhook",
        "description": "Webhook to notify when an invoice is created.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Rillet-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Id"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Entity",
            "schema": {
              "type": "string",
              "enum": [
                "INVOICE"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Event",
            "schema": {
              "type": "string",
              "enum": [
                "CREATED"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceWebhook"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "No Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "invoice-updated": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "x-blank-ext": "No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175",
        "operationId": "invoice-updated-webhook",
        "description": "Webhook to notify when an invoice is updated.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Rillet-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Id"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Entity",
            "schema": {
              "type": "string",
              "enum": [
                "INVOICE"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Event",
            "schema": {
              "type": "string",
              "enum": [
                "UPDATED"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceWebhook"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "invoice-payment-updated": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "x-blank-ext": "No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175",
        "operationId": "invoice-payment-updated-webhook",
        "description": "Webhook to notify when an invoice is updated.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Rillet-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Id"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Entity",
            "schema": {
              "type": "string",
              "enum": [
                "INVOICE"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Event",
            "schema": {
              "type": "string",
              "enum": [
                "PAYMENT_UPDATED"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceWebhook"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "invoice-deleted": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "x-blank-ext": "No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175",
        "operationId": "invoice-deleted-webhook",
        "description": "Webhook to notify when an invoice is deleted.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Rillet-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Id"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Entity",
            "schema": {
              "type": "string",
              "enum": [
                "INVOICE"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Event",
            "schema": {
              "type": "string",
              "enum": [
                "DELETED"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "The id of the deleted invoice",
                "type": "string",
                "format": "uuid"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "contract-created": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "x-blank-ext": "No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175",
        "operationId": "contract-created-webhook",
        "description": "Webhook to notify when a contract is created.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Rillet-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Id"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Entity",
            "schema": {
              "type": "string",
              "enum": [
                "CONTRACT"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Event",
            "schema": {
              "type": "string",
              "enum": [
                "CREATED"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookContract"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "contract-updated": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "x-blank-ext": "No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175",
        "operationId": "contract-updated-webhook",
        "description": "Webhook to notify when a contract is updated.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Rillet-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Id"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Entity",
            "schema": {
              "type": "string",
              "enum": [
                "CONTRACT"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Event",
            "schema": {
              "type": "string",
              "enum": [
                "UPDATED"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookContract"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "contract-deleted": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "x-blank-ext": "No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175",
        "operationId": "contract-deleted-webhook",
        "description": "Webhook to notify when a contract is deleted.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Rillet-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Id"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Entity",
            "schema": {
              "type": "string",
              "enum": [
                "CONTRACT"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Event",
            "schema": {
              "type": "string",
              "enum": [
                "DELETED"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "The id of the deleted contract",
                "type": "string",
                "format": "uuid"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "credit-memo-created": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "x-blank-ext": "No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175",
        "operationId": "credit-memo-created-webhook",
        "description": "Webhook to notify when a credit memo is created.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Rillet-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Id"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Entity",
            "schema": {
              "type": "string",
              "enum": [
                "CREDIT_MEMO"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Event",
            "schema": {
              "type": "string",
              "enum": [
                "CREATED"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreditMemo"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "credit-memo-updated": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "x-blank-ext": "No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175",
        "operationId": "credit-memo-updated-webhook",
        "description": "Webhook to notify when a credit memo is updated.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Rillet-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Id"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Entity",
            "schema": {
              "type": "string",
              "enum": [
                "CREDIT_MEMO"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Event",
            "schema": {
              "type": "string",
              "enum": [
                "UPDATED"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreditMemo"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "credit-memo-payment-updated": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "x-blank-ext": "No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175",
        "operationId": "credit-memo-payment-updated-webhook",
        "description": "Webhook to notify when a credit memo payment is updated.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Rillet-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Id"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Entity",
            "schema": {
              "type": "string",
              "enum": [
                "CREDIT_MEMO"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Event",
            "schema": {
              "type": "string",
              "enum": [
                "PAYMENT_UPDATED"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreditMemo"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "credit-memo-deleted": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "x-blank-ext": "No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175",
        "operationId": "credit-memo-deleted-webhook",
        "description": "Webhook to notify when a credit memo is deleted.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Rillet-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Id"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Entity",
            "schema": {
              "type": "string",
              "enum": [
                "CREDIT_MEMO"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Event",
            "schema": {
              "type": "string",
              "enum": [
                "DELETED"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "The id of the deleted credit memo",
                "type": "string",
                "format": "uuid"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "customer-created": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "x-blank-ext": "No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175",
        "operationId": "customer-created-webhook",
        "description": "Webhook to notify when a customer is created.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Rillet-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Id"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Entity",
            "schema": {
              "type": "string",
              "enum": [
                "CUSTOMER"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Event",
            "schema": {
              "type": "string",
              "enum": [
                "CREATED"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Customer"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "customer-updated": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "x-blank-ext": "No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175",
        "operationId": "customer-updated-webhook",
        "description": "Webhook to notify when a customer is updated.\nChanges that only affect customer metadata do not emit this webhook.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Rillet-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Id"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Entity",
            "schema": {
              "type": "string",
              "enum": [
                "CUSTOMER"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Event",
            "schema": {
              "type": "string",
              "enum": [
                "UPDATED"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Customer"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "customer-deleted": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "x-blank-ext": "No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175",
        "operationId": "customer-deleted-webhook",
        "description": "Webhook to notify when a customer is deleted.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Rillet-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Id"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Entity",
            "schema": {
              "type": "string",
              "enum": [
                "CUSTOMER"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Event",
            "schema": {
              "type": "string",
              "enum": [
                "DELETED"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "The id of the deleted customer",
                "type": "string",
                "format": "uuid"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "bill-created": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "x-blank-ext": "No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175",
        "operationId": "bill-created-webhook",
        "description": "Webhook to notify when a bill is created.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Rillet-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Id"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Entity",
            "schema": {
              "type": "string",
              "enum": [
                "BILL"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Event",
            "schema": {
              "type": "string",
              "enum": [
                "CREATED"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Bill"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "bill-updated": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "x-blank-ext": "No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175",
        "operationId": "bill-updated-webhook",
        "description": "Webhook to notify when a bill is updated.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Rillet-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Id"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Entity",
            "schema": {
              "type": "string",
              "enum": [
                "BILL"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Event",
            "schema": {
              "type": "string",
              "enum": [
                "UPDATED"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Bill"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "bill-deleted": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "x-blank-ext": "No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175",
        "operationId": "bill-deleted-webhook",
        "description": "Webhook to notify when a bill is deleted.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Rillet-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Id"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Entity",
            "schema": {
              "type": "string",
              "enum": [
                "BILL"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Event",
            "schema": {
              "type": "string",
              "enum": [
                "DELETED"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "The id of the deleted bill",
                "type": "string",
                "format": "uuid"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "vendor-created": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "x-blank-ext": "No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175",
        "operationId": "vendor-created-webhook",
        "description": "Webhook to notify when a vendor is created.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Rillet-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Id"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Entity",
            "schema": {
              "type": "string",
              "enum": [
                "VENDOR"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Event",
            "schema": {
              "type": "string",
              "enum": [
                "CREATED"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VendorResponse"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "vendor-updated": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "x-blank-ext": "No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175",
        "operationId": "vendor-updated-webhook",
        "description": "Webhook to notify when a vendor is updated.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Rillet-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Id"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Entity",
            "schema": {
              "type": "string",
              "enum": [
                "VENDOR"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Event",
            "schema": {
              "type": "string",
              "enum": [
                "UPDATED"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VendorResponse"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "vendor-deleted": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "x-blank-ext": "No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175",
        "operationId": "vendor-deleted-webhook",
        "description": "Webhook to notify when a vendor is deleted.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Rillet-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Id"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Entity",
            "schema": {
              "type": "string",
              "enum": [
                "VENDOR"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Event",
            "schema": {
              "type": "string",
              "enum": [
                "DELETED"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "The id of the deleted vendor",
                "type": "string",
                "format": "uuid"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "journal-entry-created": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "x-blank-ext": "No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175",
        "operationId": "journal-entry-created-webhook",
        "description": "Webhook to notify when a journal entry is created.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Rillet-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Id"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Entity",
            "schema": {
              "type": "string",
              "enum": [
                "JOURNAL_ENTRY"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Event",
            "schema": {
              "type": "string",
              "enum": [
                "CREATED"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JournalEntryWebhook"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "journal-entry-updated": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "x-blank-ext": "No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175",
        "operationId": "journal-entry-updated-webhook",
        "description": "Webhook to notify when a journal entry is updated.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Rillet-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Id"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Entity",
            "schema": {
              "type": "string",
              "enum": [
                "JOURNAL_ENTRY"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Event",
            "schema": {
              "type": "string",
              "enum": [
                "UPDATED"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JournalEntryWebhook"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "journal-entry-deleted": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "x-blank-ext": "No effect. Added to work around codegen bug: https://github.com/OpenAPITools/openapi-generator/issues/20175",
        "operationId": "journal-entry-deleted-webhook",
        "description": "Webhook to notify when a journal entry is deleted.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Rillet-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Id"
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Entity",
            "schema": {
              "type": "string",
              "enum": [
                "JOURNAL_ENTRY"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/X-Rillet-Event",
            "schema": {
              "type": "string",
              "enum": [
                "DELETED"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "The id of the deleted journal entry",
                "type": "string",
                "format": "uuid"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          }
        }
      }
    }
  }
}
```