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

# Creates an invoice

A matching creation approval workflow returns HTTP 202 with invoice_id, approval_request_id, and status PENDING.
This is a proposal, not a created invoice. Retrieve its contents using retrieve-an-invoice-creation-proposal.
For approval proposals, pass idempotency_key on the initial call and retain it across retries.
The key is optional; each call without one creates a new submission, including retries.
The key does not deduplicate legacy creation when approvals are disabled or the invoice belongs to a contract.
A rejected proposal remains closed; a deliberate new invoice uses a new key.

Rillet supports two invoice scope types: FULL and REVENUE_RECOGNITION_ONLY. The selected scope determines how the invoice is created and what information the user needs to provide.

The FULL scope is used when the invoice is generated and sent directly from Rillet. In this case, Rillet automatically assigns the invoice number.

The REVENUE_RECOGNITION_ONLY scope is intended for situations where the invoice is issued from another system and only needs to be recorded in Rillet for accounting purposes. In this workflow, users must provide the invoice number manually. Other fields can be populated based on the data imported from the external system.

For example, if your organization issues invoices through an external billing platform but tracks financials in Rillet, you should select REVENUE_RECOGNITION_ONLY. If Rillet handles the entire invoicing and sending process, choose the FULL scope.


# 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": {
    "/invoices": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "operationId": "create-an-invoice",
        "x-rillet-invoice-creation-response": true,
        "summary": "Creates an invoice",
        "description": "A matching creation approval workflow returns HTTP 202 with invoice_id, approval_request_id, and status PENDING.\nThis is a proposal, not a created invoice. Retrieve its contents using retrieve-an-invoice-creation-proposal.\nFor approval proposals, pass idempotency_key on the initial call and retain it across retries.\nThe key is optional; each call without one creates a new submission, including retries.\nThe key does not deduplicate legacy creation when approvals are disabled or the invoice belongs to a contract.\nA rejected proposal remains closed; a deliberate new invoice uses a new key.\n\nRillet supports two invoice scope types: FULL and REVENUE_RECOGNITION_ONLY. The selected scope determines how the invoice is created and what information the user needs to provide.\n\nThe FULL scope is used when the invoice is generated and sent directly from Rillet. In this case, Rillet automatically assigns the invoice number.\n\nThe REVENUE_RECOGNITION_ONLY scope is intended for situations where the invoice is issued from another system and only needs to be recorded in Rillet for accounting purposes. In this workflow, users must provide the invoice number manually. Other fields can be populated based on the data imported from the external system.\n\nFor example, if your organization issues invoices through an external billing platform but tracks financials in Rillet, you should select REVENUE_RECOGNITION_ONLY. If Rillet handles the entire invoicing and sending process, choose the FULL scope.\n",
        "parameters": [
          {
            "name": "idempotency_key",
            "in": "query",
            "required": false,
            "description": "Stable key for retries of an approval proposal. Ignored when approvals are disabled or the invoice belongs to a contract. Use a new key for a distinct proposal.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "replaces_request_id",
            "in": "query",
            "required": false,
            "description": "Current approval request to replace when deliberately revising a held proposal using the same key.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvoiceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "202": {
            "description": "Creation is held for approval. No invoice, accounting, or sending has occurred.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceCreationProposal"
                }
              }
            }
          },
          "409": {
            "description": "The proposal is closed, requires explicit replacement, or changed concurrently. Inspect the response before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/InvoiceCreationProposal"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          },
          "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."
      },
      "FixedPrice": {
        "type": "object",
        "required": [
          "amount"
        ],
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/MonetaryAmount"
          }
        }
      },
      "RecurringPrice": {
        "type": "object",
        "required": [
          "interval_months"
        ],
        "properties": {
          "interval_months": {
            "type": "integer",
            "format": "int32",
            "minimum": 1,
            "maximum": 12,
            "example": 1
          }
        }
      },
      "Price": {
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "FIXED_RECURRING": "#/components/schemas/FixedRecurringPrice",
            "ONE_TIME": "#/components/schemas/OneTimePrice",
            "USAGE": "#/components/schemas/UsagePrice"
          }
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/FixedRecurringPrice"
          },
          {
            "$ref": "#/components/schemas/OneTimePrice"
          },
          {
            "$ref": "#/components/schemas/UsagePrice"
          }
        ],
        "example": {
          "type": "FIXED_RECURRING",
          "amount": {
            "amount": "10.00",
            "currency": "USD"
          },
          "interval_months": 1
        }
      },
      "FixedRecurringPrice": {
        "allOf": [
          {
            "$ref": "#/components/schemas/FixedPrice"
          },
          {
            "$ref": "#/components/schemas/RecurringPrice"
          },
          {
            "type": "object",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "default": "FIXED_RECURRING"
              }
            }
          }
        ]
      },
      "OneTimePrice": {
        "allOf": [
          {
            "$ref": "#/components/schemas/FixedPrice"
          },
          {
            "type": "object",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "default": "ONE_TIME"
              }
            }
          }
        ]
      },
      "UsagePrice": {
        "allOf": [
          {
            "$ref": "#/components/schemas/RecurringPrice"
          },
          {
            "type": "object",
            "required": [
              "type",
              "billing_scheme"
            ],
            "properties": {
              "type": {
                "type": "string",
                "default": "USAGE"
              },
              "billing_scheme": {
                "$ref": "#/components/schemas/BillingScheme"
              }
            }
          }
        ]
      },
      "BillingScheme": {
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "PER_UNIT": "#/components/schemas/PerUnitBilling",
            "TIERED": "#/components/schemas/TieredBilling"
          }
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/PerUnitBilling"
          },
          {
            "$ref": "#/components/schemas/TieredBilling"
          }
        ]
      },
      "PerUnitBilling": {
        "type": "object",
        "required": [
          "type",
          "amount",
          "units"
        ],
        "properties": {
          "type": {
            "type": "string",
            "default": "PER_UNIT"
          },
          "amount": {
            "$ref": "#/components/schemas/MonetaryAmount"
          },
          "units": {
            "type": "integer",
            "format": "int32",
            "minimum": 1,
            "example": 1
          }
        }
      },
      "TieredBilling": {
        "type": "object",
        "required": [
          "type",
          "mode",
          "tiers"
        ],
        "properties": {
          "type": {
            "type": "string",
            "default": "TIERED"
          },
          "mode": {
            "type": "string",
            "enum": [
              "GRADUATED",
              "METERED"
            ],
            "description": "In metered tiering, the maximum quantity within a period determines the price. In graduated tiering, pricing changes as the quantity grows – the price from each tier up to the reported quantity is accumulated."
          },
          "tiers": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/Tier"
            }
          }
        },
        "description": "All tiers except for the highest have to define a value for upTo. There cannot be more than one tier with the same upTo value."
      },
      "Tier": {
        "type": "object",
        "required": [
          "up_to"
        ],
        "properties": {
          "up_to": {
            "type": "integer",
            "format": "int32",
            "minimum": 1,
            "example": 10
          },
          "flat_price": {
            "$ref": "#/components/schemas/MonetaryAmount"
          },
          "per_unit_price": {
            "$ref": "#/components/schemas/MonetaryAmount"
          }
        },
        "description": "At least one of flatPrice or perUnitPrice has to be defined. flatPrice is the price for the entire tier. perUnitPrice is price for units relevant to the tier."
      },
      "TaxRateWithOptionalAmount": {
        "type": "object",
        "required": [
          "country",
          "description",
          "percentage",
          "type"
        ],
        "properties": {
          "percentage": {
            "type": "string",
            "format": "number",
            "minimum": 0,
            "maximum": 100,
            "example": "0"
          },
          "tax_amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "country": {
            "$ref": "#/components/schemas/CountryCode"
          },
          "type": {
            "type": "string",
            "enum": [
              "VAT",
              "SALES_TAX"
            ]
          },
          "description": {
            "type": "string"
          }
        }
      },
      "TaxRateWithOptionalAmountAndCode": {
        "allOf": [
          {
            "$ref": "#/components/schemas/TaxRateWithOptionalAmount"
          }
        ],
        "properties": {
          "tax_code": {
            "type": "string",
            "description": "Code of a predefined tax rate. When provided, the rate's percentage, country, type, and description are loaded from the tax rate catalog. Available codes can be fetched from the list tax rates endpoint."
          }
        }
      },
      "TaxRate": {
        "allOf": [
          {
            "$ref": "#/components/schemas/TaxRateWithOptionalAmount"
          }
        ],
        "required": [
          "tax_amount"
        ]
      },
      "ExpenseTaxRate": {
        "allOf": [
          {
            "$ref": "#/components/schemas/TaxRate"
          },
          {
            "type": "object",
            "required": [
              "coverage"
            ],
            "properties": {
              "tax_code": {
                "type": "string",
                "description": "Code of a predefined tax rate. When provided, the rate's percentage, country, and description are used instead of the inline values."
              },
              "coverage": {
                "type": "string",
                "enum": [
                  "INCLUSIVE",
                  "EXCLUSIVE"
                ]
              }
            }
          }
        ]
      },
      "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"
          }
        }
      },
      "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"
          }
        }
      },
      "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"
        }
      },
      "NullableId": {
        "type": "string",
        "format": "uuid",
        "nullable": true,
        "description": "A UUID, or null to explicitly select nothing. Omitting the field is not the same as sending null."
      },
      "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"
          }
        ]
      },
      "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."
      },
      "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"
            }
          }
        }
      },
      "Invoice": {
        "type": "object",
        "required": [
          "amount_due",
          "customer_id",
          "due_date",
          "email_selection",
          "id",
          "invoice_date",
          "invoice_number",
          "items",
          "net_amount",
          "overdue",
          "payment_terms",
          "status",
          "subsidiary_id",
          "subtotal",
          "taxed_amount",
          "total",
          "total_discount",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "subsidiary_id": {
            "type": "string",
            "format": "uuid"
          },
          "invoice_number": {
            "type": "string",
            "example": "INV01"
          },
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "contract_id": {
            "type": "string",
            "format": "uuid"
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/InvoiceItem"
            }
          },
          "due_date": {
            "type": "string",
            "format": "date"
          },
          "invoice_date": {
            "type": "string",
            "format": "date"
          },
          "address": {
            "$ref": "#/components/schemas/Address",
            "description": "Sender address"
          },
          "customer_address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CustomerAddress"
              }
            ],
            "description": "Billing address as it appears on the invoice. id is the customer address it was copied from, usable as billing_address_id; the other fields are the copy, which can differ from that address once the invoice is locked. id is omitted when that customer address no longer exists."
          },
          "shipping_address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CustomerAddress"
              }
            ],
            "description": "Shipping address as it appears on the invoice. id is the ship-to customer's address it was copied from, usable as shipping_address_id. id is omitted when that customer address no longer exists."
          },
          "shipping_customer_id": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "The customer the invoice ships to. Equal to customer_id when shipping to the billing customer. Null when no ship-to customer is set."
          },
          "bank_account": {
            "$ref": "#/components/schemas/InvoicingBankAccount"
          },
          "status": {
            "$ref": "#/components/schemas/InvoiceStatus"
          },
          "net_amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "amount_due": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "total": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "payment_terms": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "example": 0
          },
          "subtotal": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "total_discount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "purchase_order_number": {
            "type": "string",
            "example": "1"
          },
          "exchange_rate": {
            "$ref": "#/components/schemas/ExchangeRate"
          },
          "taxed_amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "memo": {
            "type": "string"
          },
          "overdue": {
            "type": "boolean"
          },
          "external_references": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalReference"
            }
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Invoice metadata values keyed by metadata definition key."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp in UTC timezone (must end with 'Z')"
          },
          "sent_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp in UTC timezone (must end with 'Z') marking when the invoice was first sent to the customer\nfrom Rillet (either by a user action or by automation). Null if the invoice has never been sent from Rillet.\n"
          },
          "email_selection": {
            "allOf": [
              {
                "$ref": "#/components/schemas/EmailSelection"
              }
            ],
            "description": "Who receives the invoice. On an invoice generated by a contract, this is the contract's selection."
          }
        }
      },
      "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"
          }
        }
      },
      "CreateFullInvoiceItemRequest": {
        "type": "object",
        "required": [
          "description",
          "price"
        ],
        "properties": {
          "description": {
            "type": "string"
          },
          "price": {
            "$ref": "#/components/schemas/InvoiceItemPriceRequest"
          },
          "revenue": {
            "$ref": "#/components/schemas/ItemRevenue"
          },
          "tax_rate": {
            "$ref": "#/components/schemas/TaxRateWithOptionalAmountAndCode"
          },
          "fields": {
            "$ref": "#/components/schemas/FieldAssignments"
          }
        }
      },
      "InvoiceItemPriceRequest": {
        "type": "object",
        "required": [
          "product_id",
          "quantity",
          "amount_per_unit"
        ],
        "properties": {
          "product_id": {
            "type": "string",
            "format": "uuid"
          },
          "quantity": {
            "type": "number"
          },
          "discount": {
            "$ref": "#/components/schemas/Discount"
          },
          "amount_per_unit": {
            "$ref": "#/components/schemas/MonetaryAmount",
            "description": "This amount shows up a *rate* on the invoice, after applying the discount."
          }
        }
      },
      "InvoiceCreationProposal": {
        "type": "object",
        "description": "A creation proposal, not an effective invoice. Use the review reference to track approval.",
        "required": [
          "invoice_id",
          "approval_request_id",
          "status"
        ],
        "properties": {
          "invoice_id": {
            "type": "string",
            "format": "uuid"
          },
          "approval_request_id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "REJECTED",
              "CANCELLED",
              "REPLACED"
            ]
          },
          "proposal": {
            "$ref": "#/components/schemas/InvoiceCreationPreview"
          }
        }
      },
      "InvoiceCreationPreview": {
        "type": "object",
        "description": "Captured invoice contents awaiting creation approval.",
        "required": [
          "customer_id",
          "subsidiary_id",
          "scope",
          "invoice_date",
          "due_date",
          "currency",
          "total_amount",
          "tax_amount",
          "items",
          "metadata"
        ],
        "properties": {
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "subsidiary_id": {
            "type": "string",
            "format": "uuid"
          },
          "scope": {
            "type": "string"
          },
          "invoice_date": {
            "type": "string",
            "format": "date"
          },
          "due_date": {
            "type": "string",
            "format": "date"
          },
          "currency": {
            "type": "string"
          },
          "total_amount": {
            "type": "number"
          },
          "tax_amount": {
            "type": "number"
          },
          "memo": {
            "type": "string"
          },
          "purchase_order_number": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceCreationLinePreview"
            }
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "InvoiceCreationLinePreview": {
        "type": "object",
        "required": [
          "id",
          "description",
          "net_amount",
          "tax_amount",
          "quantity"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "product_id": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "description": {
            "type": "string"
          },
          "net_amount": {
            "type": "number"
          },
          "tax_amount": {
            "type": "number"
          },
          "quantity": {
            "type": "number"
          }
        }
      },
      "CreateInvoiceRequest": {
        "type": "object",
        "discriminator": {
          "propertyName": "scope",
          "mapping": {
            "FULL": "#/components/schemas/CreateFullInvoiceRequest",
            "REVENUE_RECOGNITION_ONLY": "#/components/schemas/CreateRevenueRecognitionOnlyInvoiceRequest",
            "AR_ONLY": "#/components/schemas/CreateArOnlyInvoiceRequest"
          }
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/CreateFullInvoiceRequest"
          },
          {
            "$ref": "#/components/schemas/CreateRevenueRecognitionOnlyInvoiceRequest"
          },
          {
            "$ref": "#/components/schemas/CreateArOnlyInvoiceRequest"
          }
        ]
      },
      "CreateFullInvoiceRequest": {
        "type": "object",
        "required": [
          "invoice_date",
          "items",
          "customer_id"
        ],
        "properties": {
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "subsidiary_id": {
            "type": "string",
            "format": "uuid"
          },
          "shipping_customer_id": {
            "type": "string",
            "format": "uuid",
            "description": "The customer to ship to. Omit, or send customer_id, to ship to the billing customer."
          },
          "billing_address_id": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NullableId"
              }
            ],
            "description": "ID of one of the billing customer's billing_addresses. If omitted, the first address in the customer's billing_addresses is used, or none when the customer has no billing address. Send null for no billing address; rejected when a tax provider is connected. Rejected when the address does not belong to the billing customer or is not a billing address."
          },
          "shipping_address_id": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NullableId"
              }
            ],
            "description": "ID of one of the ship-to customer's shipping_addresses. If omitted, the first address in the ship-to customer's shipping_addresses is used, or none when it has no shipping address. Send null for no shipping address. Rejected when the address does not belong to the ship-to customer or is not a shipping address. When a shipping address is set it determines tax; otherwise the billing address does."
          },
          "email_selection": {
            "allOf": [
              {
                "$ref": "#/components/schemas/EmailSelection"
              }
            ],
            "description": "Who receives this invoice. Omit to send it to all of the billing customer's emails (ALL_CUSTOMER_EMAILS)."
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/CreateFullInvoiceItemRequest"
            }
          },
          "due_date": {
            "type": "string",
            "format": "date",
            "description": "If not provided, defaults to the invoice date."
          },
          "invoice_date": {
            "type": "string",
            "format": "date"
          },
          "purchase_order_number": {
            "type": "string",
            "example": "1"
          },
          "memo": {
            "type": "string"
          },
          "bank_account_id": {
            "type": "string",
            "format": "uuid",
            "description": "The ID for the bank account that, should be shown on the invoice. You can find the ID in the UI at /settings/bank-accounts."
          },
          "external_references": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalReference"
            }
          },
          "exchange_rate": {
            "$ref": "#/components/schemas/ExchangeRate"
          },
          "scope": {
            "type": "string",
            "default": "FULL"
          }
        }
      },
      "CreateRevenueRecognitionOnlyInvoiceRequest": {
        "type": "object",
        "required": [
          "customer_id",
          "invoice_date",
          "invoice_number",
          "items",
          "external_references"
        ],
        "properties": {
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "due_date": {
            "type": "string",
            "format": "date",
            "description": "Defaults to invoice_date, if not provided"
          },
          "invoice_date": {
            "type": "string",
            "format": "date"
          },
          "invoice_number": {
            "type": "string"
          },
          "tax_amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/CreateRevenueRecognitionOnlyInvoiceItemRequest"
            }
          },
          "external_references": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalReference"
            }
          },
          "subsidiary_id": {
            "type": "string",
            "format": "uuid"
          },
          "exchange_rate": {
            "$ref": "#/components/schemas/ExchangeRate"
          },
          "scope": {
            "type": "string",
            "default": "REVENUE_RECOGNITION_ONLY"
          }
        }
      },
      "CreateArOnlyInvoiceRequest": {
        "type": "object",
        "required": [
          "customer_id",
          "invoice_date",
          "invoice_number",
          "items",
          "external_references"
        ],
        "properties": {
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "due_date": {
            "type": "string",
            "format": "date",
            "description": "Defaults to invoice_date, if not provided"
          },
          "invoice_date": {
            "type": "string",
            "format": "date"
          },
          "invoice_number": {
            "type": "string"
          },
          "tax_amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/CreateRevenueRecognitionOnlyInvoiceItemRequest"
            }
          },
          "external_references": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalReference"
            }
          },
          "subsidiary_id": {
            "type": "string",
            "format": "uuid"
          },
          "scope": {
            "type": "string",
            "default": "AR_ONLY"
          }
        }
      },
      "CreateRevenueRecognitionOnlyInvoiceItemRequest": {
        "type": "object",
        "required": [
          "product_id",
          "description",
          "quantity",
          "total_amount",
          "external_references"
        ],
        "properties": {
          "product_id": {
            "type": "string",
            "format": "uuid"
          },
          "description": {
            "type": "string"
          },
          "quantity": {
            "type": "number",
            "minimum": 0,
            "description": "Zero is accepted for a usage line whose metric saw no usage in the period; billing systems emit such lines, and the item's unit amounts then fall back to its totals."
          },
          "total_amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "tax_amount": {
            "$ref": "#/components/schemas/RoundedMonetaryAmount"
          },
          "revenue": {
            "$ref": "#/components/schemas/ItemRevenue"
          },
          "external_references": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalReference"
            }
          },
          "fields": {
            "$ref": "#/components/schemas/FieldAssignments"
          }
        }
      },
      "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"
              }
            }
          }
        ]
      },
      "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"
      }
    }
  },
  "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"
                }
              }
            }
          }
        }
      }
    }
  }
}
```